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

◆ DrawNPCDirect()

void Terraria.Main.DrawNPCDirect ( SpriteBatch mySpriteBatch,
NPC rCurrentNPC,
bool behindTiles,
Vector2 screenPos )
inline

Definition at line 20995 of file Main.cs.

20996 {
20997 int type = rCurrentNPC.type;
20998 rCurrentNPC.SetFrameSize();
20999 if (rCurrentNPC.realLife == -1 && rCurrentNPC.life >= rCurrentNPC.lifeMax && !rCurrentNPC.boss)
21000 {
21001 bool flag = Lighting.GetColor((int)((double)rCurrentNPC.position.X + (double)rCurrentNPC.width * 0.5) / 16, (int)(((double)rCurrentNPC.position.Y + (double)rCurrentNPC.height * 0.5) / 16.0)).ToVector3().Length() > 0.4325f;
21002 bool flag2 = false;
21004 {
21005 flag2 = true;
21006 }
21007 else if (rCurrentNPC.Distance(Main.player[myPlayer].Center) < 350f && flag)
21008 {
21009 flag2 = true;
21010 }
21011 if (flag2 && rCurrentNPC.lifeMax < 5)
21012 {
21013 flag2 = false;
21014 }
21015 if (flag2 && rCurrentNPC.aiStyle == 25 && rCurrentNPC.ai[0] == 0f)
21016 {
21017 flag2 = false;
21018 }
21019 if (flag2)
21020 {
21021 rCurrentNPC.nameOver = MathHelper.Clamp(rCurrentNPC.nameOver + 0.025f, 0f, 1f);
21022 }
21023 else
21024 {
21025 rCurrentNPC.nameOver = MathHelper.Clamp(rCurrentNPC.nameOver - 0.025f, 0f, 1f);
21026 }
21027 }
21028 else
21029 {
21030 rCurrentNPC.nameOver = MathHelper.Clamp(rCurrentNPC.nameOver - 0.025f, 0f, 1f);
21031 }
21032 if (type == 1 && rCurrentNPC.ai[0] == -999f)
21033 {
21034 return;
21035 }
21036 if (type == 101)
21037 {
21038 bool flag3 = true;
21039 Vector2 vector = new Vector2(rCurrentNPC.position.X + (float)(rCurrentNPC.width / 2), rCurrentNPC.position.Y + (float)(rCurrentNPC.height / 2));
21040 float num = rCurrentNPC.ai[0] * 16f + 8f - vector.X;
21041 float num2 = rCurrentNPC.ai[1] * 16f + 8f - vector.Y;
21042 float rotation = (float)Math.Atan2(num2, num) - 1.57f;
21043 bool flag4 = true;
21044 while (flag4)
21045 {
21046 float num3 = 0.75f;
21047 int height = 28;
21048 float num4 = (float)Math.Sqrt(num * num + num2 * num2);
21049 if (num4 < 28f * num3)
21050 {
21051 height = (int)num4 - 40 + 28;
21052 flag4 = false;
21053 }
21054 num4 = 20f * num3 / num4;
21055 num *= num4;
21056 num2 *= num4;
21057 vector.X += num;
21058 vector.Y += num2;
21059 num = rCurrentNPC.ai[0] * 16f + 8f - vector.X;
21060 num2 = rCurrentNPC.ai[1] * 16f + 8f - vector.Y;
21061 Microsoft.Xna.Framework.Color color = Lighting.GetColor((int)vector.X / 16, (int)(vector.Y / 16f));
21062 if (rCurrentNPC.IsABestiaryIconDummy)
21063 {
21064 color = rCurrentNPC.GetBestiaryEntryColor();
21065 }
21066 if (!flag3)
21067 {
21068 flag3 = true;
21069 mySpriteBatch.Draw(TextureAssets.Chain10.Value, new Vector2(vector.X - screenPos.X, vector.Y - screenPos.Y), new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain10.Width(), height), color, rotation, new Vector2((float)TextureAssets.Chain10.Width() * 0.5f, (float)TextureAssets.Chain10.Height() * 0.5f), num3, SpriteEffects.None, 0f);
21070 }
21071 else
21072 {
21073 flag3 = false;
21074 mySpriteBatch.Draw(TextureAssets.Chain11.Value, new Vector2(vector.X - screenPos.X, vector.Y - screenPos.Y), new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain10.Width(), height), color, rotation, new Vector2((float)TextureAssets.Chain10.Width() * 0.5f, (float)TextureAssets.Chain10.Height() * 0.5f), num3, SpriteEffects.None, 0f);
21075 }
21076 }
21077 }
21078 else if (rCurrentNPC.aiStyle == 13)
21079 {
21080 Vector2 vector2 = new Vector2(rCurrentNPC.position.X + (float)(rCurrentNPC.width / 2), rCurrentNPC.position.Y + (float)(rCurrentNPC.height / 2));
21081 float num5 = rCurrentNPC.ai[0] * 16f + 8f - vector2.X;
21082 float num6 = rCurrentNPC.ai[1] * 16f + 8f - vector2.Y;
21083 float rotation2 = (float)Math.Atan2(num6, num5) - 1.57f;
21084 bool flag5 = true;
21085 while (flag5)
21086 {
21087 int num7 = 28;
21088 int num8 = 40;
21089 if (type == 259 || type == 260)
21090 {
21091 num8 = 20;
21092 num7 = 12;
21093 }
21094 float num9 = (float)Math.Sqrt(num5 * num5 + num6 * num6);
21095 if (num9 < (float)num8)
21096 {
21097 num7 = (int)num9 - num8 + num7;
21098 flag5 = false;
21099 }
21100 num9 = (float)num7 / num9;
21101 num5 *= num9;
21102 num6 *= num9;
21103 vector2.X += num5;
21104 vector2.Y += num6;
21105 num5 = rCurrentNPC.ai[0] * 16f + 8f - vector2.X;
21106 num6 = rCurrentNPC.ai[1] * 16f + 8f - vector2.Y;
21107 Microsoft.Xna.Framework.Color color2 = Lighting.GetColor((int)vector2.X / 16, (int)(vector2.Y / 16f));
21108 if (rCurrentNPC.IsABestiaryIconDummy)
21109 {
21110 color2 = rCurrentNPC.GetBestiaryEntryColor();
21111 }
21112 if (type == 259 || type == 260)
21113 {
21114 color2.B = byte.MaxValue;
21115 if (color2.R < 100)
21116 {
21117 color2.R = 100;
21118 }
21119 if (color2.G < 150)
21120 {
21121 color2.G = 150;
21122 }
21123 }
21124 switch (type)
21125 {
21126 case 56:
21127 mySpriteBatch.Draw(TextureAssets.Chain5.Value, new Vector2(vector2.X - screenPos.X, vector2.Y - screenPos.Y), new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain4.Width(), num7), color2, rotation2, new Vector2((float)TextureAssets.Chain4.Width() * 0.5f, (float)TextureAssets.Chain4.Height() * 0.5f), 1f, SpriteEffects.None, 0f);
21128 break;
21129 case 175:
21130 mySpriteBatch.Draw(TextureAssets.Chain14.Value, new Vector2(vector2.X - screenPos.X, vector2.Y - screenPos.Y), new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain14.Width(), num7), color2, rotation2, new Vector2((float)TextureAssets.Chain14.Width() * 0.5f, (float)TextureAssets.Chain14.Height() * 0.5f), 1f, SpriteEffects.None, 0f);
21131 break;
21132 case 259:
21133 mySpriteBatch.Draw(TextureAssets.Chain24.Value, new Vector2(vector2.X - screenPos.X, vector2.Y - screenPos.Y), new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain24.Width(), num7), color2, rotation2, new Vector2((float)TextureAssets.Chain24.Width() * 0.5f, (float)TextureAssets.Chain24.Height() * 0.5f), 1f, SpriteEffects.None, 0f);
21134 break;
21135 case 260:
21136 mySpriteBatch.Draw(TextureAssets.Chain25.Value, new Vector2(vector2.X - screenPos.X, vector2.Y - screenPos.Y), new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain25.Width(), num7), color2, rotation2, new Vector2((float)TextureAssets.Chain25.Width() * 0.5f, (float)TextureAssets.Chain25.Height() * 0.5f), 1f, SpriteEffects.None, 0f);
21137 break;
21138 default:
21139 mySpriteBatch.Draw(TextureAssets.Chain4.Value, new Vector2(vector2.X - screenPos.X, vector2.Y - screenPos.Y), new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain4.Width(), num7), color2, rotation2, new Vector2((float)TextureAssets.Chain4.Width() * 0.5f, (float)TextureAssets.Chain4.Height() * 0.5f), 1f, SpriteEffects.None, 0f);
21140 break;
21141 }
21142 }
21143 }
21144 if (type == 327)
21145 {
21146 float rotation3 = 0f;
21147 Vector2 vector3 = new Vector2(rCurrentNPC.Center.X, rCurrentNPC.Center.Y + 80f);
21148 int num10 = (int)rCurrentNPC.localAI[1];
21149 Microsoft.Xna.Framework.Color color3 = Lighting.GetColor((int)vector3.X / 16, (int)(vector3.Y / 16f));
21151 }
21152 if (type == 328)
21153 {
21154 Vector2 vector4 = new Vector2(rCurrentNPC.position.X + (float)rCurrentNPC.width * 0.5f - 5f * rCurrentNPC.ai[0], rCurrentNPC.position.Y + 20f);
21155 for (int i = 0; i < 2; i++)
21156 {
21157 float num11 = npc[(int)rCurrentNPC.ai[1]].position.X + (float)(npc[(int)rCurrentNPC.ai[1]].width / 2) - vector4.X;
21158 float num12 = npc[(int)rCurrentNPC.ai[1]].position.Y + (float)(npc[(int)rCurrentNPC.ai[1]].height / 2) - 30f - vector4.Y;
21159 float num13 = 0f;
21160 if (i == 0)
21161 {
21162 num11 -= 200f * rCurrentNPC.ai[0];
21163 num12 += 130f;
21164 num13 = (float)Math.Sqrt(num11 * num11 + num12 * num12);
21165 num13 = 92f / num13;
21166 vector4.X += num11 * num13;
21167 vector4.Y += num12 * num13;
21168 }
21169 else
21170 {
21171 num11 -= 50f * rCurrentNPC.ai[0];
21172 num12 += 80f;
21173 num13 = (float)Math.Sqrt(num11 * num11 + num12 * num12);
21174 num13 = 60f / num13;
21175 vector4.X += num11 * num13;
21176 vector4.Y += num12 * num13;
21177 }
21178 float rotation4 = (float)Math.Atan2(num12, num11) - 1.57f;
21179 Microsoft.Xna.Framework.Color color4 = Lighting.GetColor((int)vector4.X / 16, (int)(vector4.Y / 16f));
21180 mySpriteBatch.Draw(TextureAssets.PumpkingArm.Value, new Vector2(vector4.X - screenPos.X, vector4.Y - screenPos.Y), new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.PumpkingArm.Width(), TextureAssets.PumpkingArm.Height()), color4, rotation4, new Vector2((float)TextureAssets.PumpkingArm.Width() * 0.5f, (float)TextureAssets.PumpkingArm.Height() * 0.5f), 1f, SpriteEffects.None, 0f);
21181 if (i == 0)
21182 {
21183 vector4.X += num11 * num13 / 2f;
21184 vector4.Y += num12 * num13 / 2f;
21185 }
21186 }
21187 }
21188 if (type == 36)
21189 {
21190 Vector2 vector5 = new Vector2(rCurrentNPC.position.X + (float)rCurrentNPC.width * 0.5f - 5f * rCurrentNPC.ai[0], rCurrentNPC.position.Y + 20f);
21191 for (int j = 0; j < 2; j++)
21192 {
21193 float num14 = npc[(int)rCurrentNPC.ai[1]].position.X + (float)(npc[(int)rCurrentNPC.ai[1]].width / 2) - vector5.X;
21194 float num15 = npc[(int)rCurrentNPC.ai[1]].position.Y + (float)(npc[(int)rCurrentNPC.ai[1]].height / 2) - vector5.Y;
21195 float num16 = 0f;
21196 if (j == 0)
21197 {
21198 num14 -= 200f * rCurrentNPC.ai[0];
21199 num15 += 130f;
21200 num16 = (float)Math.Sqrt(num14 * num14 + num15 * num15);
21201 num16 = 92f / num16;
21202 vector5.X += num14 * num16;
21203 vector5.Y += num15 * num16;
21204 }
21205 else
21206 {
21207 num14 -= 50f * rCurrentNPC.ai[0];
21208 num15 += 80f;
21209 num16 = (float)Math.Sqrt(num14 * num14 + num15 * num15);
21210 num16 = 60f / num16;
21211 vector5.X += num14 * num16;
21212 vector5.Y += num15 * num16;
21213 }
21214 float rotation5 = (float)Math.Atan2(num15, num14) - 1.57f;
21215 Microsoft.Xna.Framework.Color color5 = Lighting.GetColor((int)vector5.X / 16, (int)(vector5.Y / 16f));
21216 mySpriteBatch.Draw(TextureAssets.BoneArm.Value, new Vector2(vector5.X - screenPos.X, vector5.Y - screenPos.Y), new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.BoneArm.Width(), TextureAssets.BoneArm.Height()), color5, rotation5, new Vector2((float)TextureAssets.BoneArm.Width() * 0.5f, (float)TextureAssets.BoneArm.Height() * 0.5f), 1f, SpriteEffects.None, 0f);
21217 if (j == 0)
21218 {
21219 vector5.X += num14 * num16 / 2f;
21220 vector5.Y += num15 * num16 / 2f;
21221 }
21222 else if (base.IsActive)
21223 {
21224 vector5.X += num14 * num16 - 16f;
21225 vector5.Y += num15 * num16 - 6f;
21226 int num17 = Dust.NewDust(new Vector2(vector5.X, vector5.Y), 30, 10, 5, num14 * 0.02f, num15 * 0.02f, 0, default(Microsoft.Xna.Framework.Color), 2f);
21227 dust[num17].noGravity = true;
21228 }
21229 }
21230 }
21231 if (rCurrentNPC.aiStyle == 47)
21232 {
21233 float scale = rCurrentNPC.scale;
21234 Vector2 vector6 = new Vector2(rCurrentNPC.Center.X, rCurrentNPC.Center.Y);
21235 Vector2 center = rCurrentNPC.Center;
21236 if (NPC.golemBoss != -1)
21237 {
21238 center = npc[NPC.golemBoss].Center;
21239 }
21240 float num18 = center.X - vector6.X;
21241 float num19 = center.Y - vector6.Y;
21242 num19 -= 7f * scale;
21243 num18 = ((type != 247) ? (num18 + 66f * scale) : (num18 - 70f * scale));
21244 float rotation6 = (float)Math.Atan2(num19, num18) - 1.57f;
21245 bool flag6 = true;
21246 while (flag6)
21247 {
21248 float num20 = (float)Math.Sqrt(num18 * num18 + num19 * num19);
21249 if (num20 < 16f)
21250 {
21251 flag6 = false;
21252 continue;
21253 }
21254 num20 = 16f * scale / num20;
21255 num18 *= num20;
21256 num19 *= num20;
21257 vector6.X += num18;
21258 vector6.Y += num19;
21259 num18 = center.X - vector6.X;
21260 num19 = center.Y - vector6.Y;
21261 num19 -= 7f * scale;
21262 num18 = ((type != 247) ? (num18 + 66f * scale) : (num18 - 70f * scale));
21263 if (getGoodWorld)
21264 {
21265 num19 += 8f;
21266 }
21267 Microsoft.Xna.Framework.Color color6 = Lighting.GetColor((int)vector6.X / 16, (int)(vector6.Y / 16f));
21268 mySpriteBatch.Draw(TextureAssets.Chain21.Value, new Vector2(vector6.X - screenPos.X, vector6.Y - screenPos.Y), new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain21.Width(), TextureAssets.Chain21.Height()), color6, rotation6, new Vector2((float)TextureAssets.Chain21.Width() * 0.5f, (float)TextureAssets.Chain21.Height() * 0.5f), scale, SpriteEffects.None, 0f);
21269 }
21270 }
21271 if (rCurrentNPC.aiStyle >= 33 && rCurrentNPC.aiStyle <= 36)
21272 {
21273 Vector2 vector7 = new Vector2(rCurrentNPC.position.X + (float)rCurrentNPC.width * 0.5f - 5f * rCurrentNPC.ai[0], rCurrentNPC.position.Y + 20f);
21274 for (int k = 0; k < 2; k++)
21275 {
21276 float num21 = npc[(int)rCurrentNPC.ai[1]].position.X + (float)(npc[(int)rCurrentNPC.ai[1]].width / 2) - vector7.X;
21277 float num22 = npc[(int)rCurrentNPC.ai[1]].position.Y + (float)(npc[(int)rCurrentNPC.ai[1]].height / 2) - vector7.Y;
21278 float num23 = 0f;
21279 if (k == 0)
21280 {
21281 num21 -= 200f * rCurrentNPC.ai[0];
21282 num22 += 130f;
21283 num23 = (float)Math.Sqrt(num21 * num21 + num22 * num22);
21284 num23 = 92f / num23;
21285 vector7.X += num21 * num23;
21286 vector7.Y += num22 * num23;
21287 }
21288 else
21289 {
21290 num21 -= 50f * rCurrentNPC.ai[0];
21291 num22 += 80f;
21292 num23 = (float)Math.Sqrt(num21 * num21 + num22 * num22);
21293 num23 = 60f / num23;
21294 vector7.X += num21 * num23;
21295 vector7.Y += num22 * num23;
21296 }
21297 float rotation7 = (float)Math.Atan2(num22, num21) - 1.57f;
21298 Microsoft.Xna.Framework.Color color7 = Lighting.GetColor((int)vector7.X / 16, (int)(vector7.Y / 16f));
21299 mySpriteBatch.Draw(TextureAssets.BoneArm2.Value, new Vector2(vector7.X - screenPos.X, vector7.Y - screenPos.Y), new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.BoneArm.Width(), TextureAssets.BoneArm.Height()), color7, rotation7, new Vector2((float)TextureAssets.BoneArm.Width() * 0.5f, (float)TextureAssets.BoneArm.Height() * 0.5f), 1f, SpriteEffects.None, 0f);
21300 if (k == 0)
21301 {
21302 vector7.X += num21 * num23 / 2f;
21303 vector7.Y += num22 * num23 / 2f;
21304 }
21305 else if (base.IsActive)
21306 {
21307 vector7.X += num21 * num23 - 16f;
21308 vector7.Y += num22 * num23 - 6f;
21309 int num24 = Dust.NewDust(new Vector2(vector7.X, vector7.Y), 30, 10, 6, num21 * 0.02f, num22 * 0.02f, 0, default(Microsoft.Xna.Framework.Color), 2.5f);
21310 dust[num24].noGravity = true;
21311 }
21312 }
21313 }
21314 if (rCurrentNPC.aiStyle == 20)
21315 {
21316 Vector2 vector8 = new Vector2(rCurrentNPC.position.X + (float)(rCurrentNPC.width / 2), rCurrentNPC.position.Y + (float)(rCurrentNPC.height / 2));
21317 float num25 = rCurrentNPC.ai[1] - vector8.X;
21318 float num26 = rCurrentNPC.ai[2] - vector8.Y;
21319 float num27 = (rCurrentNPC.rotation = (float)Math.Atan2(num26, num25) - 1.57f);
21320 bool flag7 = true;
21321 while (flag7)
21322 {
21323 int height2 = 12;
21324 float num28 = (float)Math.Sqrt(num25 * num25 + num26 * num26);
21325 if (num28 < 20f)
21326 {
21327 height2 = (int)num28 - 20 + 12;
21328 flag7 = false;
21329 }
21330 num28 = 12f / num28;
21331 num25 *= num28;
21332 num26 *= num28;
21333 vector8.X += num25;
21334 vector8.Y += num26;
21335 num25 = rCurrentNPC.ai[1] - vector8.X;
21336 num26 = rCurrentNPC.ai[2] - vector8.Y;
21337 Microsoft.Xna.Framework.Color color8 = Lighting.GetColor((int)vector8.X / 16, (int)(vector8.Y / 16f));
21338 mySpriteBatch.Draw(TextureAssets.Chain.Value, new Vector2(vector8.X - screenPos.X, vector8.Y - screenPos.Y), new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain.Width(), height2), color8, num27, new Vector2((float)TextureAssets.Chain.Width() * 0.5f, (float)TextureAssets.Chain.Height() * 0.5f), 1f, SpriteEffects.None, 0f);
21339 }
21340 mySpriteBatch.Draw(TextureAssets.SpikeBase.Value, new Vector2(rCurrentNPC.ai[1] - screenPos.X, rCurrentNPC.ai[2] - screenPos.Y), new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.SpikeBase.Width(), TextureAssets.SpikeBase.Height()), Lighting.GetColor((int)rCurrentNPC.ai[1] / 16, (int)(rCurrentNPC.ai[2] / 16f)), num27 - 0.75f, new Vector2((float)TextureAssets.SpikeBase.Width() * 0.5f, (float)TextureAssets.SpikeBase.Height() * 0.5f), 1f, SpriteEffects.None, 0f);
21341 }
21342 Microsoft.Xna.Framework.Color npcColor = Lighting.GetColor((int)((double)rCurrentNPC.position.X + (double)rCurrentNPC.width * 0.5) / 16, (int)(((double)rCurrentNPC.position.Y + (double)rCurrentNPC.height * 0.5) / 16.0));
21343 if (rCurrentNPC.IsABestiaryIconDummy)
21344 {
21345 npcColor = rCurrentNPC.GetBestiaryEntryColor();
21346 }
21347 if (type >= 277 && type <= 280)
21348 {
21349 if (npcColor.R < byte.MaxValue)
21350 {
21351 npcColor.R = byte.MaxValue;
21352 }
21353 if (npcColor.G < 175)
21354 {
21355 npcColor.G = 175;
21356 }
21357 }
21358 if (type == -4)
21359 {
21360 int r = npcColor.R;
21361 int g = npcColor.G;
21362 int b = npcColor.B;
21363 r *= 2;
21364 if (r > 255)
21365 {
21366 r = 255;
21367 }
21368 g *= 2;
21369 if (g > 255)
21370 {
21371 g = 255;
21372 }
21373 b *= 2;
21374 if (b > 255)
21375 {
21376 b = 255;
21377 }
21378 npcColor = new Microsoft.Xna.Framework.Color(r, g, b);
21379 }
21380 if (behindTiles && type != 113 && type != 114)
21381 {
21382 int num29 = (int)((rCurrentNPC.position.X - 8f) / 16f);
21383 int num30 = (int)((rCurrentNPC.position.X + (float)rCurrentNPC.width + 8f) / 16f);
21384 int num31 = (int)((rCurrentNPC.position.Y - 8f) / 16f);
21385 int num32 = (int)((rCurrentNPC.position.Y + (float)rCurrentNPC.height + 8f) / 16f);
21386 for (int l = num29; l <= num30; l++)
21387 {
21388 for (int m = num31; m <= num32; m++)
21389 {
21390 if (Lighting.Brightness(l, m) == 0f)
21391 {
21393 }
21394 }
21395 }
21396 }
21397 npcColor = rCurrentNPC.GetNPCColorTintedByBuffs(npcColor);
21398 if (type == 50)
21399 {
21401 float num33 = 0f;
21402 zero.Y -= rCurrentNPC.velocity.Y;
21403 zero.X -= rCurrentNPC.velocity.X * 2f;
21404 num33 += rCurrentNPC.velocity.X * 0.05f;
21405 if (rCurrentNPC.frame.Y == 120)
21406 {
21407 zero.Y += 2f;
21408 }
21409 if (rCurrentNPC.frame.Y == 360)
21410 {
21411 zero.Y -= 2f;
21412 }
21413 if (rCurrentNPC.frame.Y == 480)
21414 {
21415 zero.Y -= 6f;
21416 }
21417 mySpriteBatch.Draw(TextureAssets.Ninja.Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) + zero.X, rCurrentNPC.position.Y - screenPos.Y + (float)(rCurrentNPC.height / 2) + zero.Y), new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Ninja.Width(), TextureAssets.Ninja.Height()), npcColor, num33, new Vector2(TextureAssets.Ninja.Width() / 2, TextureAssets.Ninja.Height() / 2), 1f, SpriteEffects.None, 0f);
21418 }
21419 if (type == 71)
21420 {
21422 float num34 = 0f;
21423 zero2.Y -= rCurrentNPC.velocity.Y * 0.3f;
21424 zero2.X -= rCurrentNPC.velocity.X * 0.6f;
21425 num34 += rCurrentNPC.velocity.X * 0.09f;
21426 if (rCurrentNPC.frame.Y == 120)
21427 {
21428 zero2.Y += 2f;
21429 }
21430 if (rCurrentNPC.frame.Y == 360)
21431 {
21432 zero2.Y -= 2f;
21433 }
21434 if (rCurrentNPC.frame.Y == 480)
21435 {
21436 zero2.Y -= 6f;
21437 }
21439 mySpriteBatch.Draw(itemTexture, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) + zero2.X, rCurrentNPC.position.Y - screenPos.Y + (float)(rCurrentNPC.height / 2) + zero2.Y), rectangle, npcColor, num34, rectangle.Size() / 2f, 1f, SpriteEffects.None, 0f);
21440 }
21441 if (type == 69)
21442 {
21443 mySpriteBatch.Draw(TextureAssets.AntLion.Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2), rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height + 14f), new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.AntLion.Width(), TextureAssets.AntLion.Height()), npcColor, (0f - rCurrentNPC.rotation) * 0.3f, new Vector2(TextureAssets.AntLion.Width() / 2, TextureAssets.AntLion.Height() / 2), 1f, SpriteEffects.None, 0f);
21444 }
21445 if (type == 1 && rCurrentNPC.ai[1] > 0f)
21446 {
21448 }
21449 float num35 = 0f;
21451 Vector2 halfSize = new Vector2(TextureAssets.Npc[type].Width() / 2, TextureAssets.Npc[type].Height() / npcFrameCount[type] / 2);
21452 if (type == 108 || type == 124 || type == 625)
21453 {
21454 num35 = 2f;
21455 }
21456 else if (type == 357)
21457 {
21458 num35 = rCurrentNPC.localAI[0];
21459 }
21460 else if (type == 467)
21461 {
21462 num35 = 7f;
21463 }
21464 else if (type == 537)
21465 {
21466 num35 = 2f;
21467 }
21468 else if (type == 581)
21469 {
21470 num35 = -6f;
21471 }
21472 else if (type == 490)
21473 {
21474 num35 = 4f;
21475 }
21476 else if (type == 484)
21477 {
21478 num35 = 2f;
21479 }
21480 else if (type == 483)
21481 {
21482 num35 = 14f;
21483 }
21484 else if (type == 477)
21485 {
21486 num36 = 22f;
21487 }
21488 else if (type == 478)
21489 {
21490 num35 -= 2f;
21491 }
21492 else if (type == 606)
21493 {
21494 num35 -= 2f;
21495 }
21496 else if (type == 612 || type == 613)
21497 {
21498 num35 -= 2f;
21499 }
21500 else if (type == 469 && rCurrentNPC.ai[2] == 1f)
21501 {
21502 num35 = 14f;
21503 }
21504 else
21505 {
21506 switch (type)
21507 {
21508 case 4:
21509 halfSize = new Vector2(55f, 107f);
21510 break;
21511 case 125:
21512 halfSize = new Vector2(55f, 107f);
21513 break;
21514 case 126:
21515 halfSize = new Vector2(55f, 107f);
21516 break;
21517 case 626:
21518 case 627:
21519 if (rCurrentNPC.wet)
21520 {
21521 num35 = -2f;
21522 halfSize = rCurrentNPC.frame.Size() * new Vector2(0.5f, 0.5f) + new Vector2(0f, -4f);
21523 }
21524 else
21525 {
21526 num35 = 2f;
21527 }
21528 break;
21529 case 63:
21530 case 64:
21531 case 103:
21532 halfSize.Y += 4f;
21533 break;
21534 case 69:
21535 halfSize.Y += 8f;
21536 break;
21537 case 262:
21538 halfSize.Y = 77f;
21539 num36 += 26f;
21540 break;
21541 case 264:
21542 halfSize.Y = 21f;
21543 num36 += 2f;
21544 break;
21545 case 266:
21546 num36 += 50f * rCurrentNPC.scale;
21547 break;
21548 case 268:
21549 num36 += 16f;
21550 break;
21551 case 288:
21552 num36 += 6f;
21553 break;
21554 }
21555 }
21556 if (rCurrentNPC.aiStyle == 10 || type == 72)
21557 {
21559 }
21561 if (rCurrentNPC.spriteDirection == 1)
21562 {
21563 spriteEffects = SpriteEffects.FlipHorizontally;
21564 }
21565 if (type == 124 && rCurrentNPC.localAI[0] == 0f)
21566 {
21567 int num37 = 0;
21568 if (rCurrentNPC.frame.Y > 56)
21569 {
21570 num37 += 4;
21571 }
21572 num37 += rCurrentNPC.frame.Y / 56;
21573 if (num37 >= OffsetsPlayerHeadgear.Length)
21574 {
21575 num37 = 0;
21576 }
21577 float y = OffsetsPlayerHeadgear[num37].Y;
21578 LoadProjectile(582);
21580 if (rCurrentNPC.townNpcVariationIndex == 1)
21581 {
21582 value = TextureAssets.Extra[263].Value;
21583 }
21584 Vector2 position = rCurrentNPC.Center - screenPos;
21585 position -= new Vector2(value.Width, value.Height / npcFrameCount[type]) * rCurrentNPC.scale / 2f;
21586 position += new Vector2(0f, num35 + num36 + rCurrentNPC.gfxOffY + y);
21587 position += new Vector2(-rCurrentNPC.spriteDirection * 2, -2f);
21588 mySpriteBatch.Draw(value, position, null, rCurrentNPC.GetAlpha(npcColor), rCurrentNPC.rotation, value.Size() * new Vector2(0f, 0.5f), rCurrentNPC.scale, spriteEffects, 0f);
21589 }
21590 switch (type)
21591 {
21592 default:
21593 if (type != 546 && type != 552 && type != 553 && type != 554 && type != 561 && type != 562 && type != 563 && type != 555 && type != 556 && type != 557 && type != 558 && type != 559 && type != 560 && type != 574 && type != 575 && type != 568 && type != 569 && type != 572 && type != 573 && type != 566 && type != 567 && type != 570 && type != 578 && type != 571 && type != 583 && type != 584 && type != 585 && type != 618 && type != 620 && type != 661)
21594 {
21595 switch (type)
21596 {
21597 case 551:
21598 {
21600 Vector2 vector9 = rCurrentNPC.Center - screenPos;
21602 _ = frame.Size() / 2f;
21604 float rotation8 = rCurrentNPC.rotation;
21607 color10.A = 66;
21608 Vector2 vector10 = new Vector2(171f, 44f);
21609 Vector2 vector11 = new Vector2(230f, 52f);
21610 Vector2 vector12 = Vector2.Lerp(vector10, vector11, 0.5f) + new Vector2(-50f, 30f);
21611 int num38 = (int)rCurrentNPC.localAI[0] / 4;
21614 Texture2D value3 = TextureAssets.Extra[82].Value;
21615 if (spriteEffects2.HasFlag(SpriteEffects.FlipHorizontally))
21616 {
21617 spinningpoint2.X *= -1f;
21618 }
21620 Vector2 origin = new Vector2(16f, 176f);
21621 if (spriteEffects2.HasFlag(SpriteEffects.FlipHorizontally))
21622 {
21623 origin.X = (float)value4.Width - origin.X;
21624 }
21625 if (spriteEffects2.HasFlag(SpriteEffects.FlipHorizontally))
21626 {
21627 vector12.X = (float)frame.Width - vector12.X;
21628 }
21629 Texture2D value5 = TextureAssets.Extra[81].Value;
21630 if (spriteEffects2.HasFlag(SpriteEffects.FlipHorizontally))
21631 {
21632 spinningpoint.X *= -1f;
21633 }
21635 Vector2 origin2 = new Vector2(215f, 170f);
21636 if (spriteEffects2.HasFlag(SpriteEffects.FlipHorizontally))
21637 {
21638 origin2.X = (float)value6.Width - origin2.X;
21639 }
21640 float lerpValue = Utils.GetLerpValue(0f, 30f, rCurrentNPC.localAI[1], clamped: true);
21641 if (lerpValue == 1f)
21642 {
21643 lerpValue = Utils.GetLerpValue(60f, 30f, rCurrentNPC.localAI[1], clamped: true);
21644 }
21645 lerpValue = 2f;
21646 Vector2 vector13 = rCurrentNPC.Size / 2f - screenPos;
21647 int num39 = -3;
21648 int num40 = 0;
21649 byte b2 = 2;
21650 for (int n = 9; n > num40; n += num39)
21651 {
21653 float num41 = rCurrentNPC.oldRot[n];
21654 Microsoft.Xna.Framework.Color color11 = color9 * (1f - (float)n / 10f) * 0.35f;
21655 color11.A /= b2;
21656 mySpriteBatch.Draw(value3, vector14 + spinningpoint2.RotatedBy(num41), value4, color11, num41, origin, 1f, spriteEffects2, 0f);
21659 }
21662 mySpriteBatch.Draw(TextureAssets.GlowMask[226].Value, vector9, frame, color10 * (0.7f + 0.3f * lerpValue), rotation8, vector12, 1f, spriteEffects2, 0f);
21664 return;
21665 }
21666 case 657:
21667 {
21669 Vector2 position7 = rCurrentNPC.Bottom - screenPos;
21670 position7.Y += 2f;
21671 int num53 = npcFrameCount[rCurrentNPC.type];
21672 int num54 = rCurrentNPC.frame.Y / rCurrentNPC.frame.Height;
21674 rectangle3.Inflate(0, -2);
21675 Vector2 origin4 = rectangle3.Size() * new Vector2(0.5f, 1f);
21677 if (rCurrentNPC.life <= rCurrentNPC.lifeMax / 2)
21678 {
21680 }
21681 Texture2D value11 = TextureAssets.Extra[186].Value;
21683 Vector2 origin5 = rectangle4.Size() * new Vector2(0.5f, 0.5f);
21684 Vector2 vector16 = new Vector2(rCurrentNPC.Center.X, rCurrentNPC.Center.Y);
21685 float num55 = 0f;
21686 switch (num54)
21687 {
21688 case 1:
21689 case 6:
21690 num55 -= 10f;
21691 break;
21692 case 3:
21693 case 5:
21694 num55 += 10f;
21695 break;
21696 case 4:
21697 case 12:
21698 case 13:
21699 case 14:
21700 case 15:
21701 num55 += 18f;
21702 break;
21703 case 7:
21704 case 8:
21705 num55 -= 14f;
21706 break;
21707 case 9:
21708 num55 -= 16f;
21709 break;
21710 case 10:
21711 num55 -= 18f;
21712 break;
21713 case 11:
21714 num55 += 20f;
21715 break;
21716 case 20:
21717 num55 -= 14f;
21718 break;
21719 case 21:
21720 case 23:
21721 num55 -= 18f;
21722 break;
21723 case 22:
21724 num55 -= 22f;
21725 break;
21726 }
21727 vector16.Y += num55;
21728 if (rCurrentNPC.rotation != 0f)
21729 {
21730 vector16 = vector16.RotatedBy(rCurrentNPC.rotation, rCurrentNPC.Bottom);
21731 }
21733 if (!rCurrentNPC.IsABestiaryIconDummy)
21734 {
21735 mySpriteBatch.End();
21737 }
21738 GameShaders.Misc["QueenSlime"].Apply();
21739 if (rCurrentNPC.ai[0] == 4f && rCurrentNPC.velocity.Y != 0f)
21740 {
21741 float num56 = 1f;
21742 if (rCurrentNPC.ai[2] == 1f)
21743 {
21744 num56 = 6f;
21745 }
21746 for (int num57 = 7; num57 >= 0; num57--)
21747 {
21748 float num58 = 1f - (float)num57 / 8f;
21749 Vector2 vector17 = rCurrentNPC.oldPos[num57] + new Vector2((float)rCurrentNPC.width * 0.5f, rCurrentNPC.height);
21750 vector17 -= (rCurrentNPC.Bottom - Vector2.Lerp(vector17, rCurrentNPC.Bottom, 0.75f)) * num56;
21753 mySpriteBatch.Draw(value10, vector17, rectangle3, color16, rCurrentNPC.rotation, origin4, rCurrentNPC.scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0f);
21754 }
21755 }
21756 if (!rCurrentNPC.IsABestiaryIconDummy)
21757 {
21758 mySpriteBatch.End();
21760 }
21761 pixelShader.CurrentTechnique.Passes[0].Apply();
21762 mySpriteBatch.Draw(value11, vector16, rectangle4, color15, rCurrentNPC.rotation, origin5, 1f, spriteEffects ^ SpriteEffects.FlipHorizontally, 0f);
21763 GameShaders.Misc["QueenSlime"].Apply();
21764 if (!rCurrentNPC.IsABestiaryIconDummy)
21765 {
21766 mySpriteBatch.End();
21768 }
21770 GameShaders.Misc["QueenSlime"].Apply(value12);
21771 value12.Draw(mySpriteBatch);
21772 pixelShader.CurrentTechnique.Passes[0].Apply();
21773 if (!rCurrentNPC.IsABestiaryIconDummy)
21774 {
21775 mySpriteBatch.End();
21777 }
21778 Texture2D value13 = TextureAssets.Extra[177].Value;
21779 rectangle3 = value13.Frame();
21780 origin4 = rectangle3.Size() * new Vector2(0.5f, 0.5f);
21781 position7 = new Vector2(rCurrentNPC.Center.X, rCurrentNPC.Top.Y - (float)rectangle3.Bottom + 44f);
21782 float num59 = 0f;
21783 switch (num54)
21784 {
21785 case 1:
21786 num59 -= 10f;
21787 break;
21788 case 3:
21789 case 5:
21790 case 6:
21791 num59 += 10f;
21792 break;
21793 case 4:
21794 case 12:
21795 case 13:
21796 case 14:
21797 case 15:
21798 num59 += 18f;
21799 break;
21800 case 7:
21801 case 8:
21802 num59 -= 14f;
21803 break;
21804 case 9:
21805 num59 -= 16f;
21806 break;
21807 case 10:
21808 num59 -= 18f;
21809 break;
21810 case 11:
21811 num59 += 20f;
21812 break;
21813 case 20:
21814 num59 -= 14f;
21815 break;
21816 case 21:
21817 case 23:
21818 num59 -= 18f;
21819 break;
21820 case 22:
21821 num59 -= 22f;
21822 break;
21823 }
21824 position7.Y += num59;
21825 if (rCurrentNPC.rotation != 0f)
21826 {
21827 position7 = position7.RotatedBy(rCurrentNPC.rotation, rCurrentNPC.Bottom);
21828 }
21830 mySpriteBatch.Draw(value13, position7, rectangle3, color15, rCurrentNPC.rotation, origin4, 1f, spriteEffects ^ SpriteEffects.FlipHorizontally, 0f);
21831 return;
21832 }
21833 case 576:
21834 case 577:
21835 {
21837 Vector2 vector18 = rCurrentNPC.Bottom - screenPos;
21838 Microsoft.Xna.Framework.Rectangle rectangle7 = value17.Frame(5, 10, rCurrentNPC.frame.Y / 10, rCurrentNPC.frame.Y % 10);
21839 Vector2 origin8 = rectangle7.Size() * new Vector2(0.5f, 1f);
21840 origin8.Y -= 4f;
21841 int num60 = 94;
21842 if (rCurrentNPC.spriteDirection == 1)
21843 {
21844 origin8.X = num60;
21845 }
21846 else
21847 {
21848 origin8.X = rectangle7.Width - num60;
21849 }
21851 float amount3 = 0f;
21852 float amount4 = 0f;
21853 int num61 = 0;
21854 float num62 = 0f;
21856 if (rCurrentNPC.localAI[3] < 60f)
21857 {
21858 _ = 8f;
21859 float num63 = rCurrentNPC.localAI[3] / 60f;
21860 num61 = 3;
21861 num62 = 1f - num63 * num63;
21862 value18 = new Microsoft.Xna.Framework.Color(127, 0, 255, 0);
21863 amount4 = 1f;
21865 }
21866 for (int num64 = 0; num64 < num61; num64++)
21867 {
21870 value19 = rCurrentNPC.GetAlpha(value19);
21872 value19 *= 1f - num62;
21874 position10 -= new Vector2(value17.Width, value17.Height / npcFrameCount[type]) * rCurrentNPC.scale / 2f;
21875 position10 += halfSize * rCurrentNPC.scale + new Vector2(0f, num35 + num36 + rCurrentNPC.gfxOffY);
21877 }
21878 mySpriteBatch.Draw(value17, vector18, rectangle7, rCurrentNPC.GetAlpha(color18), rCurrentNPC.rotation, origin8, rCurrentNPC.scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0f);
21879 return;
21880 }
21881 case 594:
21882 {
21884 Vector2 position8 = rCurrentNPC.Top - screenPos;
21887 Vector2 origin6 = rectangle5.Size() * new Vector2(0.5f, 0f);
21889 float scale3 = 1f;
21890 NPC nPC = rCurrentNPC.AI_113_WindyBalloon_GetSlaveNPC();
21891 if (nPC != null)
21892 {
21893 scale3 = nPC.scale;
21894 if (nPC.ai[1] > 0f)
21895 {
21896 DrawNPC_SlimeItem(nPC, nPC.type, color17, rCurrentNPC.rotation);
21897 }
21900 }
21902 return;
21903 }
21904 case 686:
21905 {
21907 Vector2 position9 = rCurrentNPC.Top - screenPos;
21909 Vector2 origin7 = rectangle6.Size() * new Vector2(0.5f, 0f);
21912 return;
21913 }
21914 case 564:
21915 case 565:
21916 {
21918 Vector2 vector19 = rCurrentNPC.Bottom - screenPos;
21919 Microsoft.Xna.Framework.Rectangle rectangle8 = value20.Frame(5, 9, rCurrentNPC.frame.Y / 9, rCurrentNPC.frame.Y % 9);
21920 Vector2 origin9 = rectangle8.Size() * new Vector2(0.5f, 1f);
21921 origin9.Y -= 10f;
21922 int num65 = 52;
21923 if (rCurrentNPC.spriteDirection == 1)
21924 {
21925 origin9.X = num65;
21926 }
21927 else
21928 {
21929 origin9.X = rectangle8.Width - num65;
21930 }
21932 float amount5 = 0f;
21933 float amount6 = 0f;
21934 int num66 = 0;
21935 float num67 = 0f;
21936 float num68 = 0f;
21938 if (rCurrentNPC.localAI[3] < 60f)
21939 {
21940 float num69 = rCurrentNPC.localAI[3] / 60f;
21941 num66 = 3;
21942 num67 = 1f - num69 * num69;
21943 num68 = 8f;
21944 value21 = new Microsoft.Xna.Framework.Color(127, 0, 255, 0);
21945 amount6 = 1f;
21947 }
21948 for (int num70 = 0; num70 < num66; num70++)
21949 {
21952 value22 = rCurrentNPC.GetAlpha(value22);
21954 value22 *= 1f - num67;
21956 position11 -= new Vector2(value20.Width, value20.Height / npcFrameCount[type]) * rCurrentNPC.scale / 2f;
21957 position11 += halfSize * rCurrentNPC.scale + new Vector2(0f, num35 + num36 + rCurrentNPC.gfxOffY);
21958 position11 += ((float)num70 / (float)num66 * ((float)Math.PI * 2f)).ToRotationVector2() * num68 * num67;
21960 }
21962 num66 = 4;
21963 num68 = 4f;
21964 num67 = 0.625f + (float)Math.Sin(GlobalTimeWrappedHourly * ((float)Math.PI * 2f) * 0.75f + (float)Math.PI) * 0.125f;
21965 for (int num71 = 0; num71 < num66; num71++)
21966 {
21968 color20 *= 1f - num67;
21970 position12 -= new Vector2(value20.Width, value20.Height / npcFrameCount[type]) * rCurrentNPC.scale / 2f;
21971 position12 += halfSize * rCurrentNPC.scale + new Vector2(0f, num35 + num36 + rCurrentNPC.gfxOffY);
21972 position12 += ((float)num71 / (float)num66 * ((float)Math.PI * 2f)).ToRotationVector2() * num68 * num67;
21974 }
21975 mySpriteBatch.Draw(value20, vector19, rectangle8, alpha2, rCurrentNPC.rotation, origin9, rCurrentNPC.scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0f);
21976 if (rCurrentNPC.Opacity > 0f)
21977 {
21979 white2.A /= 2;
21980 white2 *= rCurrentNPC.Opacity;
21981 mySpriteBatch.Draw(TextureAssets.GlowMask[225].Value, vector19, rectangle8, white2, rCurrentNPC.rotation, origin9, rCurrentNPC.scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0f);
21982 num66 = 4;
21983 num68 = 4f;
21984 num67 = 0.5f + (float)Math.Sin(GlobalTimeWrappedHourly * ((float)Math.PI * 2f) * 0.75f) * 0.5f;
21985 for (int num72 = 0; num72 < num66; num72++)
21986 {
21988 color21 *= 1f - num67;
21990 position13 -= new Vector2(value20.Width, value20.Height / npcFrameCount[type]) * rCurrentNPC.scale / 2f;
21991 position13 += halfSize * rCurrentNPC.scale + new Vector2(0f, num35 + num36 + rCurrentNPC.gfxOffY);
21992 position13 += ((float)num72 / (float)num66 * ((float)Math.PI * 2f)).ToRotationVector2() * num68 * num67;
21993 mySpriteBatch.Draw(TextureAssets.GlowMask[225].Value, position13, rectangle8, color21, rCurrentNPC.rotation, origin9, rCurrentNPC.scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0f);
21994 }
21995 }
21996 return;
21997 }
21998 case 548:
21999 {
22001 Vector2 vector15 = rCurrentNPC.Bottom - screenPos;
22003 Vector2 origin3 = rectangle2.Size() / 2f;
22004 origin3.Y += 30f;
22005 origin3.Y += 8f;
22006 origin3.X -= 1f;
22008 float amount = 0f;
22009 float amount2 = 0f;
22010 int num42 = 0;
22011 float num43 = 0f;
22012 float num44 = 0f;
22014 for (int num45 = 0; num45 < num42; num45++)
22015 {
22018 value9 = rCurrentNPC.GetAlpha(value9);
22020 value9 *= 1f - num43;
22022 position3 -= new Vector2(value8.Width, value8.Height / npcFrameCount[type]) * rCurrentNPC.scale / 2f;
22023 position3 += halfSize * rCurrentNPC.scale + new Vector2(0f, num35 + num36 + rCurrentNPC.gfxOffY);
22024 position3 += ((float)num45 / (float)num42 * ((float)Math.PI * 2f)).ToRotationVector2() * num44 * num43;
22025 mySpriteBatch.Draw(value8, position3, rectangle2, value9, rCurrentNPC.rotation, origin3, rCurrentNPC.scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0f);
22026 }
22028 num42 = 4;
22029 num44 = 4f;
22030 num43 = 0.625f + (float)Math.Sin(GlobalTimeWrappedHourly * ((float)Math.PI * 2f) * 0.75f + (float)Math.PI) * 0.125f;
22031 for (int num46 = 0; num46 < num42; num46++)
22032 {
22034 color12.A = 0;
22035 color12 *= 1f - num43;
22037 position4 -= new Vector2(value8.Width, value8.Height / npcFrameCount[type]) * rCurrentNPC.scale / 2f;
22038 position4 += halfSize * rCurrentNPC.scale + new Vector2(0f, num35 + num36 + rCurrentNPC.gfxOffY);
22039 position4 += ((float)num46 / (float)num42 * ((float)Math.PI * 2f)).ToRotationVector2() * num44 * num43;
22040 mySpriteBatch.Draw(value8, position4, rectangle2, color12, rCurrentNPC.rotation, origin3, rCurrentNPC.scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0f);
22041 }
22042 mySpriteBatch.Draw(value8, vector15, rectangle2, alpha, rCurrentNPC.rotation, origin3, rCurrentNPC.scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0f);
22043 if (rCurrentNPC.ai[1] == 2f)
22044 {
22045 float num47 = Math.Min(1f, rCurrentNPC.ai[0] / 120f);
22046 mySpriteBatch.Draw(value8, vector15, rectangle2, new Microsoft.Xna.Framework.Color(1f, 1f, 1f, 0f) * num47, rCurrentNPC.rotation, origin3, rCurrentNPC.scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0f);
22047 float progress = MathHelper.Clamp(rCurrentNPC.ai[0] / 450f, 0f, 1f);
22048 if (!Terraria.Graphics.Effects.Filters.Scene["CrystalWin"].IsActive())
22049 {
22050 Terraria.Graphics.Effects.Filters.Scene.Activate("CrystalWin", rCurrentNPC.Center);
22051 }
22052 else
22053 {
22054 Terraria.Graphics.Effects.Filters.Scene["CrystalWin"].GetShader().UseProgress(progress);
22055 }
22056 Terraria.Graphics.Effects.Filters.Scene["CrystalWin"].GetShader().UseTargetPosition(rCurrentNPC.Center);
22057 }
22058 num42 = 4;
22059 num44 = 4f;
22060 num43 = 0.625f + (float)Math.Sin(GlobalTimeWrappedHourly * ((float)Math.PI * 2f) * 0.75f) * 0.125f;
22061 for (int num48 = 0; num48 < num42; num48++)
22062 {
22064 color13.A = 0;
22065 color13 *= 0.3f;
22066 color13 *= 1f - num43;
22068 position5 -= new Vector2(value8.Width, value8.Height / npcFrameCount[type]) * rCurrentNPC.scale / 2f;
22069 position5 += halfSize * rCurrentNPC.scale + new Vector2(0f, num35 + num36 + rCurrentNPC.gfxOffY);
22070 position5 += ((float)num48 / (float)num42 * ((float)Math.PI * 2f)).ToRotationVector2() * num44 * num43;
22071 mySpriteBatch.Draw(value8, position5, rectangle2, color13, rCurrentNPC.rotation, origin3, rCurrentNPC.scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0f);
22072 }
22073 if (rCurrentNPC.alpha < 255)
22074 {
22075 float num49 = GlobalTimeWrappedHourly % 3f / 3f;
22076 float num50 = num49;
22077 if (num50 > 0.5f)
22078 {
22079 num50 = 1f - num49;
22080 }
22081 if (num50 < 0f)
22082 {
22083 num50 = 0f;
22084 }
22085 float num51 = (num49 + 0.5f) % 1f;
22086 float num52 = num51;
22087 if (num52 > 0.5f)
22088 {
22089 num52 = 1f - num51;
22090 }
22091 if (num52 < 0f)
22092 {
22093 num52 = 0f;
22094 }
22095 value8 = TextureAssets.GlowMask[239].Value;
22096 rectangle2 = value8.Frame();
22097 origin3 = rectangle2.Size() / 2f;
22098 Vector2 position6 = vector15 + new Vector2(0f, -40f);
22100 color14 *= 0.6f;
22101 mySpriteBatch.Draw(value8, position6, rectangle2, color14, rCurrentNPC.rotation, origin3, rCurrentNPC.scale * 0.75f, spriteEffects ^ SpriteEffects.FlipHorizontally, 0f);
22102 num43 = 1f + num49 * 0.75f;
22103 mySpriteBatch.Draw(value8, position6, rectangle2, color14 * num50, rCurrentNPC.rotation, origin3, rCurrentNPC.scale * 0.75f * num43, spriteEffects ^ SpriteEffects.FlipHorizontally, 0f);
22104 num43 = 1f + num51 * 0.75f;
22105 mySpriteBatch.Draw(value8, position6, rectangle2, color14 * num52, rCurrentNPC.rotation, origin3, rCurrentNPC.scale * 0.75f * num43, spriteEffects ^ SpriteEffects.FlipHorizontally, 0f);
22106 value8 = TextureAssets.Extra[89].Value;
22107 rectangle2 = value8.Frame();
22108 origin3 = rectangle2.Size() / 2f;
22109 Vector2 scale2 = new Vector2(0.75f, 1f + num43) * 1.5f;
22110 num43 = 1f + num51 * 0.75f;
22111 if (rCurrentNPC.dontTakeDamageFromHostiles)
22112 {
22113 scale2.Y *= 0.6f;
22114 }
22115 position6.Y -= 6f;
22116 mySpriteBatch.Draw(value8, position6, rectangle2, color14 * num52, rCurrentNPC.rotation + (float)Math.PI / 2f, origin3, scale2, spriteEffects ^ SpriteEffects.FlipHorizontally, 0f);
22118 }
22119 return;
22120 }
22121 default:
22122 if (type < 621 || type > 623)
22123 {
22124 break;
22125 }
22126 goto case 371;
22127 case 371:
22128 case 454:
22129 case 455:
22130 case 456:
22131 case 457:
22132 case 458:
22133 case 459:
22134 {
22136 Vector2 position2 = rCurrentNPC.Center - screenPos;
22137 position2 -= new Vector2(value7.Width, value7.Height / npcFrameCount[type]) * rCurrentNPC.scale / 2f;
22138 position2 += halfSize * rCurrentNPC.scale + new Vector2(0f, num35 + num36 + rCurrentNPC.gfxOffY);
22140 return;
22141 }
22142 }
22143 switch (type)
22144 {
22145 case 549:
22146 {
22148 Vector2 vector61 = rCurrentNPC.Center - screenPos;
22150 Vector2 origin22 = new Vector2(70f, 127f);
22151 origin22.Y += 8f;
22152 Vector2 scale6 = new Vector2(rCurrentNPC.scale);
22153 float num201 = rCurrentNPC.localAI[0];
22154 if (num201 < 120f)
22155 {
22156 scale6 *= num201 / 240f + 0.5f;
22157 }
22159 float lerpValue2 = Utils.GetLerpValue(0f, 120f, num201, clamped: true);
22160 float num202 = MathHelper.Lerp(32f, 0f, lerpValue2);
22162 color42.A = (byte)MathHelper.Lerp((int)color42.A, 0f, lerpValue2);
22164 if (num201 >= 120f)
22165 {
22166 color42 = alpha12;
22167 }
22169 float y3 = (((rCurrentNPC.ai[0] + 54f) % 180f - 120f) / 180f * 2f * ((float)Math.PI * 2f)).ToRotationVector2().Y;
22170 if (num201 >= 120f)
22171 {
22172 num202 = y3 * 0f;
22173 color42.A = (byte)((float)(int)color42.A * 0.5f);
22174 color42 *= y3 / 2f + 0.5f;
22175 float num203 = 1f;
22176 for (float num204 = 0f; num204 < num203; num204 += 1f)
22177 {
22178 mySpriteBatch.Draw(value58, vector61 + ((float)Math.PI * 2f / num203 * num204).ToRotationVector2() * num202, frame9, color42, rCurrentNPC.rotation, origin22, scale6, spriteEffects, 0f);
22179 }
22180 }
22181 float num205 = rCurrentNPC.ai[0] / 180f - 0.76f;
22182 if (num205 < 0f)
22183 {
22184 num205 += 1f;
22185 }
22186 float num206 = 0f;
22187 float num207 = 0f;
22188 float num208 = 0.6f;
22189 float num209 = 0.8f;
22190 if (num205 >= num208 && num205 <= num209)
22191 {
22192 num206 = Utils.GetLerpValue(num208, num209, num205);
22193 num207 = MathHelper.Lerp(0.75f, 0.85f, num206);
22194 }
22195 num208 = num209;
22196 num209 = num208 + 0.13f;
22197 if (num205 >= num208 && num205 <= num209)
22198 {
22199 num206 = 1f - Utils.GetLerpValue(num208, num209, num205);
22200 num207 = MathHelper.Lerp(1.3f, 0.85f, num206);
22201 }
22202 Vector2 vector62 = new Vector2(0f, -150f);
22203 int frameNumber = frame9.Y / frame9.Height;
22204 float num210 = MathHelper.Clamp((num201 - 100f) / 40f, 0f, 1f);
22205 DrawElderEye(mySpriteBatch, rCurrentNPC.Center + vector62, 0.75f * num210, 0.75f, frameNumber, Microsoft.Xna.Framework.Color.White);
22206 DrawElderEye(mySpriteBatch, rCurrentNPC.Center + vector62, 0.75f * num210, 0.75f, frameNumber, new Microsoft.Xna.Framework.Color(255, 255, 255, 127) * (y3 / 2f + 0.5f));
22207 if (num206 > 0f && num207 > 0f)
22208 {
22209 DrawElderEye(mySpriteBatch, rCurrentNPC.Center + vector62, num206 * 0.5f, num207, frameNumber, new Microsoft.Xna.Framework.Color(255, 255, 255, 127));
22210 }
22211 if (num201 < 120f)
22212 {
22213 float num211 = (float)Math.PI * 2f * lerpValue2 * (float)Math.Pow(lerpValue2, 2.0) * 2f + lerpValue2;
22214 color42.A = (byte)((float)(int)alpha12.A * (float)Math.Pow(lerpValue2, 2.0) * 0.5f);
22215 float num212 = 3f;
22216 for (float num213 = 0f; num213 < num212; num213 += 1f)
22217 {
22218 mySpriteBatch.Draw(value58, vector61 + (num211 + (float)Math.PI * 2f / num212 * num213).ToRotationVector2() * num202, frame9, color42, rCurrentNPC.rotation, origin22, scale6, spriteEffects, 0f);
22219 }
22220 }
22221 break;
22222 }
22223 case 636:
22225 break;
22226 case 677:
22228 break;
22229 case 668:
22231 break;
22232 case 422:
22233 case 493:
22234 case 507:
22235 case 517:
22236 {
22238 Vector2 vector65 = rCurrentNPC.Center - screenPos;
22239 Vector2 vector66 = vector65 - new Vector2(300f, 310f);
22240 vector65 -= new Vector2(value60.Width, value60.Height / npcFrameCount[type]) * rCurrentNPC.scale / 2f;
22241 vector65 += halfSize * rCurrentNPC.scale + new Vector2(0f, num35 + num36 + rCurrentNPC.gfxOffY);
22243 switch (type)
22244 {
22245 case 493:
22246 {
22247 value60 = TextureAssets.GlowMask[132].Value;
22248 float num228 = 4f + (rCurrentNPC.GetAlpha(npcColor).ToVector3() - new Vector3(0.5f)).Length() * 4f;
22249 for (int num229 = 0; num229 < 4; num229++)
22250 {
22251 mySpriteBatch.Draw(value60, vector65 + rCurrentNPC.velocity.RotatedBy((float)num229 * ((float)Math.PI / 2f)) * num228, rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(64, 64, 64, 0) * rCurrentNPC.Opacity, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
22252 }
22253 break;
22254 }
22255 case 507:
22256 {
22257 value60 = TextureAssets.GlowMask[143].Value;
22258 float num224 = 4f + (rCurrentNPC.GetAlpha(npcColor).ToVector3() - new Vector3(0.5f)).Length() * 4f;
22259 for (int num225 = 0; num225 < 4; num225++)
22260 {
22261 mySpriteBatch.Draw(value60, vector65 + rCurrentNPC.velocity.RotatedBy((float)num225 * ((float)Math.PI / 2f)) * num224, rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(64, 64, 64, 0) * rCurrentNPC.Opacity, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
22262 }
22263 break;
22264 }
22265 case 422:
22266 {
22267 value60 = TextureAssets.GlowMask[149].Value;
22268 float num226 = 4f + (rCurrentNPC.GetAlpha(npcColor).ToVector3() - new Vector3(0.5f)).Length() * 4f;
22269 for (int num227 = 0; num227 < 4; num227++)
22270 {
22271 mySpriteBatch.Draw(value60, vector65 + rCurrentNPC.velocity.RotatedBy((float)num227 * ((float)Math.PI / 2f)) * num226, rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(64, 64, 64, 0) * rCurrentNPC.Opacity, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
22272 }
22273 break;
22274 }
22275 case 517:
22276 {
22277 value60 = TextureAssets.GlowMask[162].Value;
22278 float num222 = 2f + (rCurrentNPC.GetAlpha(npcColor).ToVector3() - new Vector3(0.5f)).Length() * 9f;
22279 for (int num223 = 0; num223 < 4; num223++)
22280 {
22281 mySpriteBatch.Draw(value60, vector65 + rCurrentNPC.velocity.RotatedBy((float)num223 * ((float)Math.PI / 2f)) * num222 + Vector2.UnitX * 2f, rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(64, 64, 64, 0) * rCurrentNPC.Opacity, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
22282 }
22283 break;
22284 }
22285 }
22286 int num230 = 0;
22287 string key = "";
22288 switch (type)
22289 {
22290 case 422:
22291 num230 = NPC.ShieldStrengthTowerVortex;
22292 key = "Vortex";
22293 break;
22294 case 507:
22295 num230 = NPC.ShieldStrengthTowerNebula;
22296 key = "Nebula";
22297 break;
22298 case 517:
22299 num230 = NPC.ShieldStrengthTowerSolar;
22300 key = "Solar";
22301 break;
22302 case 493:
22303 num230 = NPC.ShieldStrengthTowerStardust;
22304 key = "Stardust";
22305 break;
22306 }
22307 float num231 = (float)num230 / (float)NPC.ShieldStrengthTowerMax;
22308 if (rCurrentNPC.IsABestiaryIconDummy)
22309 {
22310 break;
22311 }
22312 if (num230 > 0)
22313 {
22314 mySpriteBatch.End();
22316 float num232 = 0f;
22317 if (rCurrentNPC.ai[3] > 0f && rCurrentNPC.ai[3] <= 30f)
22318 {
22319 num232 = 1f - rCurrentNPC.ai[3] / 30f;
22320 }
22321 Terraria.Graphics.Effects.Filters.Scene[key].GetShader().UseIntensity(1f + num232).UseProgress(0f);
22322 DrawData value61 = new DrawData(Assets.Request<Texture2D>("Images/Misc/Perlin", (AssetRequestMode)1).Value, vector66 + new Vector2(300f, 300f), new Microsoft.Xna.Framework.Rectangle(0, 0, 600, 600), Microsoft.Xna.Framework.Color.White * (num231 * 0.8f + 0.2f), rCurrentNPC.rotation, new Vector2(300f, 300f), rCurrentNPC.scale * (1f + num232 * 0.05f), spriteEffects);
22323 GameShaders.Misc["ForceField"].UseColor(new Vector3(1f + num232 * 0.5f));
22324 GameShaders.Misc["ForceField"].Apply(value61);
22325 value61.Draw(mySpriteBatch);
22326 mySpriteBatch.End();
22328 }
22329 else if (rCurrentNPC.ai[3] > 0f)
22330 {
22331 mySpriteBatch.End();
22333 float num233 = rCurrentNPC.ai[3] / 120f;
22334 float num234 = Math.Min(rCurrentNPC.ai[3] / 30f, 1f);
22335 Terraria.Graphics.Effects.Filters.Scene[key].GetShader().UseIntensity(Math.Min(5f, 15f * num233) + 1f).UseProgress(num233);
22336 DrawData value62 = new DrawData(Assets.Request<Texture2D>("Images/Misc/Perlin", (AssetRequestMode)1).Value, vector66 + new Vector2(300f, 300f), new Microsoft.Xna.Framework.Rectangle(0, 0, 600, 600), new Microsoft.Xna.Framework.Color(new Vector4(1f - (float)Math.Sqrt(num234))), rCurrentNPC.rotation, new Vector2(300f, 300f), rCurrentNPC.scale * (1f + num234), spriteEffects);
22337 GameShaders.Misc["ForceField"].UseColor(new Vector3(2f));
22338 GameShaders.Misc["ForceField"].Apply(value62);
22339 value62.Draw(mySpriteBatch);
22340 mySpriteBatch.End();
22342 }
22343 else
22344 {
22345 Terraria.Graphics.Effects.Filters.Scene[key].GetShader().UseIntensity(0f).UseProgress(0f);
22346 }
22347 break;
22348 }
22349 case 402:
22350 {
22351 LoadNPC(403);
22352 LoadNPC(404);
22354 Vector2 vector63 = rCurrentNPC.Center - screenPos;
22355 vector63 -= new Vector2(value59.Width, value59.Height / npcFrameCount[rCurrentNPC.type]) * rCurrentNPC.scale / 2f;
22356 vector63 += halfSize * rCurrentNPC.scale + new Vector2(0f, num35 + num36 + rCurrentNPC.gfxOffY);
22357 int num214 = 0;
22358 float num215 = 2f / (float)rCurrentNPC.oldPos.Length * 0.7f;
22359 float num216 = 600f;
22360 float num217 = num216 - 30f;
22361 float num218 = Utils.Remap(rCurrentNPC.ai[2], 0f, num216, 0f, 1f);
22362 float num219 = 1f - Utils.Remap(num218, 0.5f, num217 / num216, 0f, 1f) * Utils.Remap(num218, num217 / num216, 1f, 1f, 0f);
22363 int num220 = rCurrentNPC.oldPos.Length - 1;
22364 while ((float)num220 >= 1f)
22365 {
22366 for (int num221 = 0; num221 < 2; num221++)
22367 {
22368 value59 = ((num214 != 0) ? TextureAssets.Npc[403].Value : TextureAssets.Npc[404].Value);
22370 float rotation10 = rCurrentNPC.oldRot[num220];
22371 if (num220 >= 1 && num221 == 1)
22372 {
22373 Vector2 vector64 = Vector2.Lerp(rCurrentNPC.oldPos[num220], rCurrentNPC.oldPos[num220 - 1], 0.5f) - rCurrentNPC.oldPos[num220];
22374 rotation10 = MathHelper.WrapAngle(rCurrentNPC.oldRot[num220 - 1] * 0.5f + rCurrentNPC.oldRot[num220] * 0.5f);
22376 }
22377 float scale7 = rCurrentNPC.scale;
22378 mySpriteBatch.Draw(value59, position21, null, rCurrentNPC.GetAlpha(npcColor) * (0.8f - num215 * (float)num220 / 2f) * num219, rotation10, halfSize, scale7, spriteEffects, 0f);
22379 value59 = ((num214 != 0) ? TextureAssets.GlowMask[133].Value : TextureAssets.GlowMask[134].Value);
22380 mySpriteBatch.Draw(value59, position21, null, new Microsoft.Xna.Framework.Color(255, 255, 255, 0) * (1f - num215 * (float)num220 / 2f) * num219, rotation10, halfSize, scale7, spriteEffects, 0f);
22381 num214++;
22382 }
22383 num220 -= 2;
22384 }
22385 value59 = TextureAssets.Npc[rCurrentNPC.type].Value;
22387 value59 = TextureAssets.GlowMask[135].Value;
22388 mySpriteBatch.Draw(value59, vector63, rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(255, 255, 255, 0) * num219, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
22389 DrawPrettyStarSparkle(Utils.Remap(rCurrentNPC.ai[2], 0f, num216, 0f, 1f), SpriteEffects.None, vector63, new Microsoft.Xna.Framework.Color(255, 255, 255, 0), Microsoft.Xna.Framework.Color.CornflowerBlue, num218, 0.5f, num217 / num216, num217 / num216, 1f, (float)Math.PI * 2f * num218, new Vector2(2f, 2f), new Vector2(2f, 2f));
22390 break;
22391 }
22392 case 519:
22393 {
22395 Vector2 vector67 = rCurrentNPC.Center - screenPos;
22396 vector67 -= new Vector2(value63.Width, value63.Height / npcFrameCount[rCurrentNPC.type]) * rCurrentNPC.scale / 2f;
22397 vector67 += halfSize * rCurrentNPC.scale + new Vector2(0f, num35 + num36 + rCurrentNPC.gfxOffY);
22398 value63 = TextureAssets.Npc[rCurrentNPC.type].Value;
22400 int num235 = 0;
22401 float num236 = 1f / (float)rCurrentNPC.oldPos.Length * 0.7f;
22402 int num237 = rCurrentNPC.oldPos.Length - 1;
22403 while ((float)num237 >= 0f)
22404 {
22405 float num238 = (float)(rCurrentNPC.oldPos.Length - num237) / (float)rCurrentNPC.oldPos.Length;
22407 pink *= 1f - num236 * (float)num237 / 1f;
22408 pink.A = (byte)((float)(int)pink.A * (1f - num238));
22409 mySpriteBatch.Draw(value63, vector67 + rCurrentNPC.oldPos[num237] - rCurrentNPC.position, null, pink, rCurrentNPC.oldRot[num237], halfSize, rCurrentNPC.scale * MathHelper.Lerp(0.3f, 1.1f, num238), spriteEffects, 0f);
22410 num235++;
22411 num237--;
22412 }
22413 break;
22414 }
22415 case 522:
22416 {
22418 Vector2 vector68 = rCurrentNPC.Center - screenPos;
22419 vector68 -= new Vector2(value70.Width, value70.Height / npcFrameCount[rCurrentNPC.type]) * rCurrentNPC.scale / 2f;
22420 vector68 += halfSize * rCurrentNPC.scale + new Vector2(0f, num35 + num36 + rCurrentNPC.gfxOffY);
22421 int num256 = 0;
22422 float num257 = 1f / (float)rCurrentNPC.oldPos.Length * 1.1f;
22423 int num258 = rCurrentNPC.oldPos.Length - 1;
22424 while ((float)num258 >= 0f)
22425 {
22426 float num259 = (float)(rCurrentNPC.oldPos.Length - num258) / (float)rCurrentNPC.oldPos.Length;
22428 white6 *= 1f - num257 * (float)num258 / 1f;
22429 white6.A = (byte)((float)(int)white6.A * (1f - num259));
22430 mySpriteBatch.Draw(value70, vector68 + rCurrentNPC.oldPos[num258] - rCurrentNPC.position, null, white6, rCurrentNPC.oldRot[num258], halfSize, rCurrentNPC.scale * MathHelper.Lerp(0.8f, 0.3f, num259), spriteEffects, 0f);
22431 num256++;
22432 num258--;
22433 }
22434 value70 = TextureAssets.Extra[57].Value;
22435 mySpriteBatch.Draw(value70, vector68, null, new Microsoft.Xna.Framework.Color(255, 255, 255, 0), 0f, value70.Size() / 2f, rCurrentNPC.scale, spriteEffects, 0f);
22436 break;
22437 }
22438 case 370:
22439 case 372:
22440 case 373:
22441 {
22444 float amount8 = 0f;
22445 bool flag12 = type == 370 && rCurrentNPC.ai[0] > 4f;
22446 bool num239 = type == 370 && rCurrentNPC.ai[0] > 9f;
22447 int num240 = 120;
22448 int num241 = 60;
22450 if (num239)
22451 {
22452 npcColor = buffColor(npcColor, 0.4f, 0.8f, 0.4f, 1f);
22453 }
22454 else if (flag12)
22455 {
22456 npcColor = buffColor(npcColor, 0.5f, 0.7f, 0.5f, 1f);
22457 }
22458 else if (type == 370 && rCurrentNPC.ai[0] == 4f && rCurrentNPC.ai[2] > (float)num240)
22459 {
22460 float num242 = rCurrentNPC.ai[2] - (float)num240;
22461 num242 /= (float)num241;
22462 npcColor = buffColor(npcColor, 1f - 0.5f * num242, 1f - 0.3f * num242, 1f - 0.5f * num242, 1f);
22463 }
22464 int num243 = 10;
22465 int num244 = 2;
22466 switch (type)
22467 {
22468 case 370:
22469 if (rCurrentNPC.ai[0] == -1f)
22470 {
22471 num243 = 0;
22472 }
22473 if (rCurrentNPC.ai[0] == 0f || rCurrentNPC.ai[0] == 5f || rCurrentNPC.ai[0] == 10f)
22474 {
22475 num243 = 7;
22476 }
22477 if (rCurrentNPC.ai[0] == 1f)
22478 {
22480 amount8 = 0.5f;
22481 }
22482 else
22483 {
22484 color43 = npcColor;
22485 }
22486 break;
22487 case 372:
22488 case 373:
22489 if (rCurrentNPC.ai[0] == 1f)
22490 {
22492 amount8 = 0.5f;
22493 }
22494 break;
22495 }
22496 for (int num245 = 1; num245 < num243; num245 += num244)
22497 {
22498 _ = ref rCurrentNPC.oldPos[num245];
22501 value66 = rCurrentNPC.GetAlpha(value66);
22502 value66 *= (float)(num243 - num245) / 15f;
22503 Vector2 position22 = rCurrentNPC.oldPos[num245] + new Vector2(rCurrentNPC.width, rCurrentNPC.height) / 2f - screenPos;
22504 position22 -= new Vector2(value64.Width, value64.Height / npcFrameCount[type]) * rCurrentNPC.scale / 2f;
22505 position22 += halfSize * rCurrentNPC.scale + new Vector2(0f, num35 + num36 + rCurrentNPC.gfxOffY);
22507 }
22508 int num246 = 0;
22509 float num247 = 0f;
22510 float num248 = 0f;
22511 if (type == 370)
22512 {
22513 if (rCurrentNPC.ai[0] == -1f)
22514 {
22515 num246 = 0;
22516 }
22517 if (rCurrentNPC.ai[0] == 3f || rCurrentNPC.ai[0] == 8f)
22518 {
22519 int num249 = 60;
22520 int num250 = 30;
22521 if (rCurrentNPC.ai[2] > (float)num249)
22522 {
22523 num246 = 6;
22524 num247 = 1f - (float)Math.Cos((rCurrentNPC.ai[2] - (float)num249) / (float)num250 * ((float)Math.PI * 2f));
22525 num247 /= 3f;
22526 num248 = 40f;
22527 }
22528 }
22529 if (rCurrentNPC.ai[0] == 4f && rCurrentNPC.ai[2] > (float)num240)
22530 {
22531 num246 = 6;
22532 num247 = 1f - (float)Math.Cos((rCurrentNPC.ai[2] - (float)num240) / (float)num241 * ((float)Math.PI * 2f));
22533 num247 /= 3f;
22534 num248 = 60f;
22535 }
22536 if (rCurrentNPC.ai[0] == 9f && rCurrentNPC.ai[2] > (float)num240)
22537 {
22538 num246 = 6;
22539 num247 = 1f - (float)Math.Cos((rCurrentNPC.ai[2] - (float)num240) / (float)num241 * ((float)Math.PI * 2f));
22540 num247 /= 3f;
22541 num248 = 60f;
22542 }
22543 if (rCurrentNPC.ai[0] == 12f)
22544 {
22545 num246 = 6;
22546 num247 = 1f - (float)Math.Cos(rCurrentNPC.ai[2] / 30f * ((float)Math.PI * 2f));
22547 num247 /= 3f;
22548 num248 = 20f;
22549 }
22550 }
22551 for (int num251 = 0; num251 < num246; num251++)
22552 {
22555 value67 = rCurrentNPC.GetAlpha(value67);
22556 value67 *= 1f - num247;
22557 Vector2 position23 = rCurrentNPC.Center + ((float)num251 / (float)num246 * ((float)Math.PI * 2f) + rCurrentNPC.rotation).ToRotationVector2() * num248 * num247 - screenPos;
22558 position23 -= new Vector2(value64.Width, value64.Height / npcFrameCount[type]) * rCurrentNPC.scale / 2f;
22559 position23 += halfSize * rCurrentNPC.scale + new Vector2(0f, num35 + num36 + rCurrentNPC.gfxOffY);
22561 }
22562 Vector2 position24 = rCurrentNPC.Center - screenPos;
22563 position24 -= new Vector2(value64.Width, value64.Height / npcFrameCount[type]) * rCurrentNPC.scale / 2f;
22564 position24 += halfSize * rCurrentNPC.scale + new Vector2(0f, num35 + num36 + rCurrentNPC.gfxOffY);
22566 if (type != 370 || !(rCurrentNPC.ai[0] >= 4f))
22567 {
22568 break;
22569 }
22573 amount8 = 1f;
22574 num247 = 0.5f;
22575 num248 = 10f;
22576 num244 = 1;
22577 if (rCurrentNPC.ai[0] == 4f)
22578 {
22579 float num252 = rCurrentNPC.ai[2] - (float)num240;
22580 num252 /= (float)num241;
22581 value65 *= num252;
22582 color44 *= num252;
22583 }
22584 if (rCurrentNPC.ai[0] == 12f)
22585 {
22586 float num253 = rCurrentNPC.ai[2];
22587 num253 /= 30f;
22588 if (num253 > 0.5f)
22589 {
22590 num253 = 1f - num253;
22591 }
22592 num253 *= 2f;
22593 num253 = 1f - num253;
22594 value65 *= num253;
22595 color44 *= num253;
22596 }
22597 for (int num254 = 1; num254 < num243; num254 += num244)
22598 {
22599 _ = ref rCurrentNPC.oldPos[num254];
22602 value68 *= (float)(num243 - num254) / 15f;
22603 Vector2 position25 = rCurrentNPC.oldPos[num254] + new Vector2(rCurrentNPC.width, rCurrentNPC.height) / 2f - screenPos;
22604 position25 -= new Vector2(value64.Width, value64.Height / npcFrameCount[type]) * rCurrentNPC.scale / 2f;
22605 position25 += halfSize * rCurrentNPC.scale + new Vector2(0f, num35 + num36 + rCurrentNPC.gfxOffY);
22607 }
22608 for (int num255 = 1; num255 < num246; num255++)
22609 {
22612 value69 = rCurrentNPC.GetAlpha(value69);
22613 value69 *= 1f - num247;
22614 Vector2 position26 = rCurrentNPC.Center + ((float)num255 / (float)num246 * ((float)Math.PI * 2f) + rCurrentNPC.rotation).ToRotationVector2() * num248 * num247 - screenPos;
22615 position26 -= new Vector2(value64.Width, value64.Height / npcFrameCount[type]) * rCurrentNPC.scale / 2f;
22616 position26 += halfSize * rCurrentNPC.scale + new Vector2(0f, num35 + num36 + rCurrentNPC.gfxOffY);
22618 }
22620 break;
22621 }
22622 case 439:
22623 case 440:
22624 {
22625 int num260 = rCurrentNPC.frame.Y / (TextureAssets.Npc[type].Height() / npcFrameCount[type]);
22629 rectangle11.Height /= 2;
22630 if (num260 >= 4)
22631 {
22632 rectangle11.Y += rectangle11.Height;
22633 }
22635 float amount9 = 0f;
22637 int num261 = 0;
22638 int num262 = 0;
22639 int num263 = 0;
22640 if (rCurrentNPC.ai[0] == -1f)
22641 {
22642 if (rCurrentNPC.ai[1] >= 320f && rCurrentNPC.ai[1] < 960f)
22643 {
22645 amount9 = 0.5f;
22646 num261 = 6;
22647 num262 = 2;
22648 num263 = 1;
22649 }
22650 }
22651 else if (rCurrentNPC.ai[0] == 1f)
22652 {
22654 amount9 = 0.5f;
22655 num261 = 4;
22656 num262 = 2;
22657 num263 = 1;
22658 }
22659 else
22660 {
22661 color45 = npcColor;
22662 }
22663 for (int num264 = num263; num264 < num261; num264 += num262)
22664 {
22665 _ = ref rCurrentNPC.oldPos[num264];
22668 value73 = rCurrentNPC.GetAlpha(value73);
22669 value73 *= (float)(num261 - num264) / (float)num261;
22670 value73.A = 100;
22671 Vector2 position27 = rCurrentNPC.oldPos[num264] + new Vector2(rCurrentNPC.width, rCurrentNPC.height) / 2f - screenPos;
22672 position27 -= rectangle11.Size() * rCurrentNPC.scale / 2f;
22673 position27 += halfSize * rCurrentNPC.scale + new Vector2(0f, num35 + num36 + rCurrentNPC.gfxOffY);
22675 }
22676 int num265 = 0;
22677 float num266 = 0f;
22678 float num267 = 0f;
22679 if (rCurrentNPC.ai[0] == 5f && rCurrentNPC.ai[1] >= 0f && rCurrentNPC.ai[1] < 30f)
22680 {
22681 num265 = 4;
22682 num266 = 1f - (float)Math.Cos((rCurrentNPC.ai[1] - 0f) / 30f * (float)Math.PI);
22683 num266 /= 2f;
22684 num267 = 70f;
22685 }
22686 for (int num268 = 0; num268 < num265; num268++)
22687 {
22690 value74 = rCurrentNPC.GetAlpha(value74);
22691 value74 *= 1f - num266;
22692 Vector2 position28 = rCurrentNPC.Center + ((float)num268 / (float)num265 * ((float)Math.PI * 2f) + rCurrentNPC.rotation).ToRotationVector2() * num267 * num266 - screenPos;
22693 position28 -= new Vector2(value71.Width, value71.Height / npcFrameCount[type]) * rCurrentNPC.scale / 2f;
22694 position28 += halfSize * rCurrentNPC.scale + new Vector2(0f, num35 + num36 + rCurrentNPC.gfxOffY);
22696 }
22697 Vector2 position29 = rCurrentNPC.Center - screenPos;
22698 position29 -= new Vector2(value71.Width, value71.Height / npcFrameCount[type]) * rCurrentNPC.scale / 2f;
22699 position29 += halfSize * rCurrentNPC.scale + new Vector2(0f, num35 + num36 + rCurrentNPC.gfxOffY);
22701 break;
22702 }
22703 case 392:
22704 case 393:
22705 case 394:
22706 case 395:
22707 {
22709 Vector2 vec = rCurrentNPC.Center - screenPos + Vector2.UnitY * rCurrentNPC.gfxOffY;
22710 vec = vec.Floor();
22711 float num269 = 0f;
22712 if (type == 393)
22713 {
22714 num269 = -8f;
22715 }
22717 if (type == 392)
22718 {
22719 mySpriteBatch.Draw(TextureAssets.GlowMask[48].Value, vec, rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(200, 200, 200, 0), rCurrentNPC.rotation, halfSize + Vector2.UnitY * num269, rCurrentNPC.scale, spriteEffects, 0f);
22720 }
22721 if (type == 395)
22722 {
22723 mySpriteBatch.Draw(TextureAssets.GlowMask[49].Value, vec, rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(200, 200, 200, 0), rCurrentNPC.rotation, halfSize + Vector2.UnitY * num269, rCurrentNPC.scale, spriteEffects, 0f);
22724 }
22725 if (type == 394)
22726 {
22727 mySpriteBatch.Draw(TextureAssets.GlowMask[50].Value, vec, rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(200, 200, 200, 0), rCurrentNPC.rotation, halfSize + Vector2.UnitY * num269, rCurrentNPC.scale, spriteEffects, 0f);
22728 }
22729 break;
22730 }
22731 case 83:
22732 case 84:
22733 case 179:
22734 mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35), rCurrentNPC.frame, Microsoft.Xna.Framework.Color.White, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
22735 break;
22736 case 87:
22737 case 88:
22738 case 89:
22739 case 90:
22740 case 91:
22741 case 92:
22742 {
22744 byte b3 = (byte)((tileColor.R + tileColor.G + tileColor.B) / 3);
22745 if (alpha13.R < b3)
22746 {
22747 alpha13.R = b3;
22748 }
22749 if (alpha13.G < b3)
22750 {
22751 alpha13.G = b3;
22752 }
22753 if (alpha13.B < b3)
22754 {
22755 alpha13.B = b3;
22756 }
22757 mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35), rCurrentNPC.frame, alpha13, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
22758 break;
22759 }
22760 default:
22761 {
22762 switch (type)
22763 {
22764 case 491:
22765 {
22768 Vector2 origin15 = frame3.OriginFlip(new Vector2(208f, 460f), spriteEffects);
22769 Vector2 vector34 = rCurrentNPC.Center - screenPos;
22770 Vector2 vector35 = new Vector2((!spriteEffects.HasFlag(SpriteEffects.FlipHorizontally)) ? 1 : (-1), 1f);
22773 int num89 = (int)rCurrentNPC.localAI[3] / 8;
22774 value38 = TextureAssets.Extra[40].Value;
22775 frame3 = value38.Frame(1, 4, 0, num89 % 4);
22776 origin15 = frame3.Size() * new Vector2(0.5f, 1f);
22777 mySpriteBatch.Draw(value38, vector34 + (new Vector2(102f, -384f) * vector35).RotatedBy(rCurrentNPC.rotation), frame3, alpha7, rCurrentNPC.rotation, origin15, rCurrentNPC.scale, spriteEffects, 0f);
22778 value38 = TextureAssets.Extra[41].Value;
22779 frame3 = value38.Frame(1, 8, 0, num89 % 8);
22780 origin15 = frame3.Size() * new Vector2(0.5f, 0f) + new Vector2(0f, 10f);
22781 for (int num90 = 0; num90 < 5; num90++)
22782 {
22783 mySpriteBatch.Draw(value38, vector34 + (new Vector2(-96 + 34 * num90, 40f) * vector35).RotatedBy(rCurrentNPC.rotation), frame3, alpha7, rCurrentNPC.rotation, origin15, rCurrentNPC.scale, spriteEffects, 0f);
22784 }
22785 value38 = TextureAssets.Extra[42].Value;
22786 frame3 = value38.Frame(1, 4, 0, num89 % 4);
22787 origin15 = frame3.Size() * new Vector2(0.5f, 0f);
22788 for (int num91 = 0; num91 < 2; num91++)
22789 {
22790 mySpriteBatch.Draw(value38, vector34 + (new Vector2(158 - 106 * num91, -302f) * vector35).RotatedBy(rCurrentNPC.rotation), frame3, alpha7, rCurrentNPC.rotation, origin15, rCurrentNPC.scale, spriteEffects, 0f);
22791 }
22792 value38 = TextureAssets.Extra[43].Value;
22793 frame3 = value38.Frame(1, 4, 0, num89 % 4);
22794 origin15 = frame3.Size() * new Vector2(0.5f, 0f);
22795 for (int num92 = 0; num92 < 2; num92++)
22796 {
22797 mySpriteBatch.Draw(value38, vector34 + (new Vector2(42 - 178 * num92, -444f) * vector35).RotatedBy(rCurrentNPC.rotation), frame3, alpha7, rCurrentNPC.rotation, origin15, rCurrentNPC.scale, spriteEffects, 0f);
22798 }
22799 value38 = TextureAssets.Extra[44].Value;
22800 frame3 = value38.Frame(1, 4, 0, num89 % 4);
22801 origin15 = frame3.Size() * new Vector2(0.5f, 0f);
22802 mySpriteBatch.Draw(value38, vector34 + (new Vector2(-134f, -302f) * vector35).RotatedBy(rCurrentNPC.rotation), frame3, alpha7, rCurrentNPC.rotation, origin15, rCurrentNPC.scale, spriteEffects, 0f);
22803 value38 = TextureAssets.Extra[45].Value;
22804 frame3 = value38.Frame(1, 4, 0, (2 + num89) % 4);
22805 origin15 = frame3.Size() * new Vector2(0.5f, 0f);
22806 mySpriteBatch.Draw(value38, vector34 + (new Vector2(-60f, -330f) * vector35).RotatedBy(rCurrentNPC.rotation), frame3, alpha7, rCurrentNPC.rotation, origin15, rCurrentNPC.scale, spriteEffects, 0f);
22807 LoadNPC(492);
22808 if (!TextureAssets.Npc[492].IsLoaded)
22809 {
22810 return;
22811 }
22812 value38 = TextureAssets.Npc[492].Value;
22813 frame3 = value38.Frame(1, 9);
22814 origin15 = frame3.Size() * new Vector2(0.5f, 0f) + new Vector2(0f, 10f);
22815 for (int num93 = 0; num93 < 4; num93++)
22816 {
22817 int num94 = (int)rCurrentNPC.ai[num93];
22818 if (num94 >= 0)
22819 {
22820 frame3.Y = npc[num94].frame.Y;
22821 mySpriteBatch.Draw(value38, vector34 + (new Vector2(-122 + 68 * num93, -20f) * vector35).RotatedBy(rCurrentNPC.rotation), frame3, alpha7, rCurrentNPC.rotation, origin15, rCurrentNPC.scale, spriteEffects, 0f);
22822 }
22823 }
22824 return;
22825 }
22826 case 398:
22827 {
22828 bool flag8 = false;
22832 float num74 = 340f;
22833 float num75 = 0.5f;
22834 Vector2 vector20 = new Vector2(220f, -60f);
22835 Vector2 vector21 = new Vector2(76f, 66f);
22837 Vector2 origin10 = new Vector2(value26.Width, 278f);
22838 Vector2 origin11 = new Vector2(0f, 278f);
22839 Vector2 vector22 = new Vector2(0f, 76f);
22840 Vector2 center2 = rCurrentNPC.Center;
22841 Microsoft.Xna.Framework.Point point = (rCurrentNPC.Center + new Vector2(0f, -150f)).ToTileCoordinates();
22842 Microsoft.Xna.Framework.Color alpha4 = rCurrentNPC.GetAlpha(Microsoft.Xna.Framework.Color.Lerp(Lighting.GetColor(point.X, point.Y), Microsoft.Xna.Framework.Color.White, 0.3f));
22843 for (int num76 = 0; num76 < 2; num76++)
22844 {
22845 bool flag9 = num76 == 0;
22846 Vector2 vector23 = new Vector2((!flag9) ? 1 : (-1), 1f);
22847 int num77 = -1;
22848 for (int num78 = 0; num78 < 200; num78++)
22849 {
22850 if (npc[num78].active && npc[num78].type == 397 && npc[num78].ai[2] == (float)num76 && npc[num78].ai[3] == (float)rCurrentNPC.whoAmI)
22851 {
22852 num77 = num78;
22853 break;
22854 }
22855 }
22856 if (num77 != -1)
22857 {
22859 Vector2 vector25 = (npc[num77].Center + vector22 - vector24) * num75;
22860 if (flag8)
22861 {
22862 dust[Dust.NewDust(vector24 + vector25, 0, 0, 6)].noGravity = true;
22863 }
22864 float num79 = (float)Math.Acos(vector25.Length() / num74) * (0f - vector23.X);
22865 SpriteEffects effects = ((!flag9) ? SpriteEffects.FlipHorizontally : SpriteEffects.None);
22867 if (!flag9)
22868 {
22869 origin12.X = (float)value25.Width - origin12.X;
22870 }
22871 mySpriteBatch.Draw(value25, vector24 - screenPos, null, alpha4, vector25.ToRotation() - num79 - (float)Math.PI / 2f, origin12, 1f, effects, 0f);
22872 if (flag8)
22873 {
22874 dust[Dust.NewDust(vector24, 0, 0, 6)].noGravity = true;
22875 }
22876 if (flag8)
22877 {
22878 dust[Dust.NewDust(center2, 0, 0, 6)].noGravity = true;
22879 }
22880 if (flag8)
22881 {
22882 dust[Dust.NewDust(vector24 + new Vector2(0f, num74).RotatedBy(vector25.ToRotation() - num79 - (float)Math.PI / 2f), 0, 0, 6)].noGravity = true;
22883 }
22884 }
22885 }
22886 mySpriteBatch.Draw(value26, center2 - screenPos, null, alpha4, 0f, origin10, 1f, SpriteEffects.None, 0f);
22887 mySpriteBatch.Draw(value26, center2 - screenPos, null, alpha4, 0f, origin11, 1f, SpriteEffects.FlipHorizontally, 0f);
22888 mySpriteBatch.Draw(value24, center2 - screenPos, null, alpha4, 0f, new Vector2(112f, 101f), 1f, SpriteEffects.None, 0f);
22889 mySpriteBatch.Draw(value23, center2 - screenPos, rCurrentNPC.frame, alpha4, 0f, rCurrentNPC.frame.Size() / 2f, 1f, SpriteEffects.None, 0f);
22890 return;
22891 }
22892 case 397:
22893 {
22895 float num95 = 0.5f;
22896 Vector2 vector36 = new Vector2(220f, -60f);
22897 Vector2 vector37 = new Vector2(0f, 76f);
22899 Vector2 vector38 = new Vector2(60f, 30f);
22900 float num96 = 340f;
22901 Vector2 center3 = npc[(int)rCurrentNPC.ai[3]].Center;
22902 Microsoft.Xna.Framework.Point point4 = rCurrentNPC.Center.ToTileCoordinates();
22904 bool flag10 = rCurrentNPC.ai[2] == 0f;
22905 Vector2 vector39 = new Vector2((!flag10) ? 1 : (-1), 1f);
22906 Vector2 origin16 = new Vector2(120f, 180f);
22907 if (!flag10)
22908 {
22909 origin16.X = (float)value39.Width - origin16.X;
22910 }
22913 Vector2 vector40 = new Vector2(26f, 42f);
22914 if (!flag10)
22915 {
22916 vector40.X = (float)value41.Width - vector40.X;
22917 }
22918 Vector2 vector41 = new Vector2(30f, 66f);
22919 Vector2 vector42 = new Vector2(1f * (0f - vector39.X), 3f);
22922 value44.Height /= 4;
22924 Vector2 vector44 = rCurrentNPC.Center + vector37;
22926 v *= 1f - num95;
22928 if (!flag10)
22929 {
22930 origin17.X = (float)value40.Width - origin17.X;
22931 }
22932 float num97 = (float)Math.Acos(v.Length() / num96) * (0f - vector39.X);
22933 mySpriteBatch.Draw(value40, vector44 - screenPos, null, alpha8, v.ToRotation() + num97 - (float)Math.PI / 2f, origin17, 1f, spriteEffects, 0f);
22934 if (rCurrentNPC.ai[0] == -2f)
22935 {
22936 int num98 = (int)rCurrentNPC.ai[1];
22937 num98 /= 8;
22938 value44.Y += value44.Height * num98;
22939 mySpriteBatch.Draw(value43, rCurrentNPC.Center - screenPos, value44, alpha8, 0f, vector40 - new Vector2(4f, 4f), 1f, spriteEffects, 0f);
22940 }
22941 else
22942 {
22943 mySpriteBatch.Draw(value41, rCurrentNPC.Center - screenPos, null, alpha8, 0f, vector40, 1f, spriteEffects, 0f);
22944 Vector2 vector45 = Utils.Vector2FromElipse(rCurrentNPC.localAI[0].ToRotationVector2(), vector41 * rCurrentNPC.localAI[1]);
22945 mySpriteBatch.Draw(value42, rCurrentNPC.Center - screenPos + vector45 + vector42, null, alpha8, 0f, new Vector2(value42.Width, value42.Height) / 2f, 1f, SpriteEffects.None, 0f);
22946 }
22947 mySpriteBatch.Draw(value39, rCurrentNPC.Center - screenPos, rCurrentNPC.frame, alpha8, 0f, origin16, 1f, spriteEffects, 0f);
22948 return;
22949 }
22950 case 396:
22951 {
22953 Vector2 origin13 = new Vector2(191f, 130f);
22956 Vector2 vector26 = new Vector2(19f, 34f);
22957 Vector2 vector27 = new Vector2(27f, 59f);
22958 Vector2 vector28 = new Vector2(0f, 0f);
22960 Vector2 vector29 = new Vector2(0f, 214f).RotatedBy(rCurrentNPC.rotation);
22962 rectangle9.Height /= 3;
22963 rectangle9.Y += rectangle9.Height * (int)(rCurrentNPC.localAI[2] / 7f);
22965 Vector2 vector30 = new Vector2(0f, 4f).RotatedBy(rCurrentNPC.rotation);
22967 rectangle10.Height /= 4;
22968 rectangle10.Y += rectangle10.Height * (int)(rCurrentNPC.localAI[3] / 5f);
22971 value35.Height /= 4;
22972 _ = npc[(int)rCurrentNPC.ai[3]].Center;
22973 Microsoft.Xna.Framework.Point point2 = rCurrentNPC.Center.ToTileCoordinates();
22975 if (rCurrentNPC.ai[0] < 0f)
22976 {
22977 int num84 = (int)rCurrentNPC.ai[1];
22978 num84 /= 8;
22979 value35.Y += value35.Height * num84;
22980 mySpriteBatch.Draw(value34, rCurrentNPC.Center - screenPos, value35, alpha5, rCurrentNPC.rotation, vector26 + new Vector2(4f, 4f), 1f, spriteEffects, 0f);
22981 }
22982 else
22983 {
22984 mySpriteBatch.Draw(value30, rCurrentNPC.Center - screenPos, null, alpha5, rCurrentNPC.rotation, vector26, 1f, spriteEffects, 0f);
22985 Vector2 vector31 = Utils.Vector2FromElipse(rCurrentNPC.localAI[0].ToRotationVector2(), vector27 * rCurrentNPC.localAI[1]);
22986 mySpriteBatch.Draw(value31, rCurrentNPC.Center - screenPos + vector31 + vector28, null, alpha5, rCurrentNPC.rotation, new Vector2(value31.Width, value31.Height) / 2f, 1f, SpriteEffects.None, 0f);
22987 }
22989 mySpriteBatch.Draw(value33, (rCurrentNPC.Center - screenPos + vector30).Floor(), rectangle10, alpha5, rCurrentNPC.rotation, rectangle10.Size() / 2f, 1f, spriteEffects, 0f);
22990 mySpriteBatch.Draw(value32, (rCurrentNPC.Center - screenPos + vector29).Floor(), rectangle9, alpha5, rCurrentNPC.rotation, rectangle9.Size() / 2f, 1f, spriteEffects, 0f);
22991 return;
22992 }
22993 case 400:
22994 {
22997 Vector2 origin14 = new Vector2(40f, 40f);
22998 Vector2 vector32 = new Vector2(30f, 30f);
22999 _ = rCurrentNPC.Center;
23000 Microsoft.Xna.Framework.Point point3 = rCurrentNPC.Center.ToTileCoordinates();
23003 Vector2 vector33 = Utils.Vector2FromElipse(rCurrentNPC.localAI[0].ToRotationVector2(), vector32 * rCurrentNPC.localAI[1]);
23004 mySpriteBatch.Draw(value37, rCurrentNPC.Center - screenPos + vector33, null, alpha6, rCurrentNPC.rotation, value37.Size() / 2f, rCurrentNPC.localAI[2], SpriteEffects.None, 0f);
23005 return;
23006 }
23007 case 416:
23008 {
23009 int num85 = -1;
23010 int num86 = (int)rCurrentNPC.ai[0];
23011 Vector2 position15 = rCurrentNPC.position;
23013 if (npc[num86].active && npc[num86].type == 415)
23014 {
23015 num85 = num86;
23016 }
23017 if (num85 != -1)
23018 {
23019 Vector2 position16 = rCurrentNPC.position;
23020 rCurrentNPC.Bottom = npc[num85].Bottom;
23021 position15 = rCurrentNPC.position;
23022 rCurrentNPC.position = position16;
23023 rCurrentNPC.gfxOffY = npc[num85].gfxOffY;
23024 spinningpoint3 = npc[num85].velocity;
23025 }
23027 mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2(position15.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, position15.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35 + rCurrentNPC.gfxOffY), frame2, rCurrentNPC.GetAlpha(npcColor), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23028 if (rCurrentNPC.color != default(Microsoft.Xna.Framework.Color))
23029 {
23030 mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2(position15.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, position15.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35 + rCurrentNPC.gfxOffY), frame2, rCurrentNPC.GetColor(npcColor), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23031 }
23032 mySpriteBatch.Draw(TextureAssets.GlowMask[156].Value, position15 + rCurrentNPC.Size * new Vector2(0.5f, 1f) - screenPos + new Vector2((float)(-TextureAssets.Npc[type].Width()) * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, (float)(-TextureAssets.Npc[type].Height()) * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + rCurrentNPC.gfxOffY), rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(255 - rCurrentNPC.alpha, 255 - rCurrentNPC.alpha, 255 - rCurrentNPC.alpha, 255 - rCurrentNPC.alpha), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23033 float num87 = 0.5f + (rCurrentNPC.GetAlpha(npcColor).ToVector3() - new Vector3(0.5f)).Length() * 0.5f;
23034 for (int num88 = 0; num88 < 4; num88++)
23035 {
23036 mySpriteBatch.Draw(TextureAssets.GlowMask[156].Value, position15 + rCurrentNPC.Size * new Vector2(0.5f, 1f) - screenPos + new Vector2((float)(-TextureAssets.Npc[type].Width()) * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, (float)(-TextureAssets.Npc[type].Height()) * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + rCurrentNPC.gfxOffY) + spinningpoint3.RotatedBy((float)num88 * ((float)Math.PI / 2f)) * num87, rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(64, 64, 64, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23037 }
23038 return;
23039 }
23040 case 399:
23041 {
23043 (rCurrentNPC.position - screenPos + Vector2.UnitY * rCurrentNPC.gfxOffY).Floor();
23044 float num80 = 5f;
23045 for (int num81 = 0; (float)num81 < num80; num81++)
23046 {
23047 float num82 = 1f - (GlobalTimeWrappedHourly + (float)num81) % num80 / num80;
23049 if (rCurrentNPC.ai[0] == 1f)
23050 {
23052 }
23053 if (rCurrentNPC.ai[0] == 2f)
23054 {
23056 }
23057 color22 *= 1f - num82;
23058 color22.A = 0;
23059 for (int num83 = 0; num83 < 2; num83++)
23060 {
23061 mySpriteBatch.Draw(TextureAssets.Extra[27].Value, rCurrentNPC.Center - screenPos + Vector2.UnitY * (rCurrentNPC.gfxOffY - 4f + 6f), null, color22, (float)Math.PI / 2f, new Vector2(10f, 48f), num82 * 4f, SpriteEffects.None, 0f);
23062 }
23063 }
23064 mySpriteBatch.Draw(value27, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35 + rCurrentNPC.gfxOffY), rCurrentNPC.frame, rCurrentNPC.GetAlpha(npcColor), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23065 value27 = TextureAssets.GlowMask[100].Value;
23066 mySpriteBatch.Draw(value27, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35 + rCurrentNPC.gfxOffY), rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(127 - rCurrentNPC.alpha / 2, 127 - rCurrentNPC.alpha / 2, 127 - rCurrentNPC.alpha / 2, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23067 value27 = TextureAssets.Extra[20].Value;
23068 Microsoft.Xna.Framework.Rectangle value28 = value27.Frame(1, 4, 0, (int)rCurrentNPC.ai[0] + 1);
23069 Vector2 position14 = new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)value27.Width * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35 + rCurrentNPC.gfxOffY + 18f + 6f);
23071 value27 = TextureAssets.GlowMask[101].Value;
23072 mySpriteBatch.Draw(value27, position14, value28, new Microsoft.Xna.Framework.Color(127 - rCurrentNPC.alpha / 2, 127 - rCurrentNPC.alpha / 2, 127 - rCurrentNPC.alpha / 2, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23073 return;
23074 }
23075 case 94:
23076 {
23077 for (int num73 = 1; num73 < 6; num73 += 2)
23078 {
23079 _ = ref rCurrentNPC.oldPos[num73];
23081 alpha3.R = (byte)(alpha3.R * (10 - num73) / 15);
23082 alpha3.G = (byte)(alpha3.G * (10 - num73) / 15);
23083 alpha3.B = (byte)(alpha3.B * (10 - num73) / 15);
23084 alpha3.A = (byte)(alpha3.A * (10 - num73) / 15);
23085 alpha3 = rCurrentNPC.GetShimmerColor(alpha3);
23086 mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2(rCurrentNPC.oldPos[num73].X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.oldPos[num73].Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36), rCurrentNPC.frame, alpha3, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23087 }
23088 break;
23089 }
23090 case 384:
23091 return;
23092 }
23093 if (type == 125 || type == 126 || type == 127 || type == 128 || type == 129 || type == 130 || type == 131 || (type == 139 && rCurrentNPC.ai[3] == 0f) || type == 140)
23094 {
23095 for (int num99 = 9; num99 >= 0; num99 -= 2)
23096 {
23097 _ = ref rCurrentNPC.oldPos[num99];
23099 alpha9.R = (byte)(alpha9.R * (10 - num99) / 20);
23100 alpha9.G = (byte)(alpha9.G * (10 - num99) / 20);
23101 alpha9.B = (byte)(alpha9.B * (10 - num99) / 20);
23102 alpha9.A = (byte)(alpha9.A * (10 - num99) / 20);
23103 mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2(rCurrentNPC.oldPos[num99].X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.oldPos[num99].Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36), rCurrentNPC.frame, alpha9, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23104 }
23105 }
23106 if (type == 417 && rCurrentNPC.ai[0] >= 6f && rCurrentNPC.ai[0] <= 6f)
23107 {
23108 for (int num100 = 5; num100 >= 0; num100--)
23109 {
23110 _ = ref rCurrentNPC.oldPos[num100];
23112 alpha10.R = (byte)(alpha10.R * (10 - num100) / 20);
23113 alpha10.G = (byte)(alpha10.G * (10 - num100) / 20);
23114 alpha10.B = (byte)(alpha10.B * (10 - num100) / 20);
23115 alpha10.A = (byte)(alpha10.A * (10 - num100) / 20);
23116 mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2(rCurrentNPC.oldPos[num100].X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.oldPos[num100].Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36), rCurrentNPC.frame, alpha10, rCurrentNPC.oldRot[num100], halfSize, MathHelper.Lerp(0.5f, 1f, (5f - (float)num100) / 6f), spriteEffects, 0f);
23117 }
23118 }
23119 if (type == 419 && rCurrentNPC.ai[2] <= -9f)
23120 {
23121 int num101 = TextureAssets.GlowMask[154].Height() / npcFrameCount[type];
23122 int num102 = rCurrentNPC.frame.Y / num101;
23123 for (int num103 = 6; num103 >= 0; num103--)
23124 {
23125 _ = ref rCurrentNPC.oldPos[num103];
23127 white3.R = (byte)(255 * (10 - num103) / 20);
23128 white3.G = (byte)(255 * (10 - num103) / 20);
23129 white3.B = (byte)(255 * (10 - num103) / 20);
23130 white3.A = 0;
23132 int num104 = (num102 - 3 - num103) % 3;
23133 if (num104 < 0)
23134 {
23135 num104 += 3;
23136 }
23137 num104 += 5;
23138 frame4.Y = num101 * num104;
23139 mySpriteBatch.Draw(TextureAssets.GlowMask[154].Value, new Vector2(rCurrentNPC.oldPos[num103].X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.oldPos[num103].Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36), frame4, white3, rCurrentNPC.oldRot[num103], halfSize, MathHelper.Lerp(0.75f, 1.2f, (10f - (float)num103) / 10f), spriteEffects, 0f);
23140 }
23141 }
23142 if (type == 418 && (rCurrentNPC.ai[0] == 2f || rCurrentNPC.ai[0] == 4f))
23143 {
23145 Vector2 origin18 = new Vector2(value45.Width / 2, value45.Height / 8 + 14);
23146 int num105 = (int)rCurrentNPC.ai[1] / 2;
23147 float num106 = -(float)Math.PI / 2f * (float)rCurrentNPC.spriteDirection;
23148 float num107 = rCurrentNPC.ai[1] / 45f;
23149 if (num107 > 1f)
23150 {
23151 num107 = 1f;
23152 }
23153 num105 %= 4;
23154 for (int num108 = 6; num108 >= 0; num108--)
23155 {
23156 _ = ref rCurrentNPC.oldPos[num108];
23159 value46.A = (byte)(64f * num107);
23160 value46.R = (byte)(value46.R * (10 - num108) / 20);
23161 value46.G = (byte)(value46.G * (10 - num108) / 20);
23162 value46.B = (byte)(value46.B * (10 - num108) / 20);
23163 value46.A = (byte)(value46.A * (10 - num108) / 20);
23164 value46 *= num107;
23165 int num109 = (num105 - num108) % 4;
23166 if (num109 < 0)
23167 {
23168 num109 += 4;
23169 }
23171 mySpriteBatch.Draw(value45, new Vector2(rCurrentNPC.oldPos[num108].X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.oldPos[num108].Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36), value47, value46, rCurrentNPC.oldRot[num108] + num106, origin18, MathHelper.Lerp(0.1f, 1.2f, (10f - (float)num108) / 10f), spriteEffects, 0f);
23172 }
23173 }
23174 if (type == 516)
23175 {
23176 int num110 = TextureAssets.Npc[type].Height() / npcFrameCount[type];
23177 int num111 = rCurrentNPC.frame.Y / num110;
23178 for (int num112 = 6; num112 >= 0; num112--)
23179 {
23180 _ = ref rCurrentNPC.oldPos[num112];
23182 white4.R = (byte)(255 * (10 - num112) / 20);
23183 white4.G = (byte)(255 * (10 - num112) / 20);
23184 white4.B = (byte)(255 * (10 - num112) / 20);
23185 white4.A = (byte)(255 * (10 - num112) / 20);
23188 int num113 = (num111 - 4 - num112) % 4;
23189 if (num113 < 0)
23190 {
23191 num113 += 4;
23192 }
23193 frame5.Y = num110 * num113;
23194 mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2(rCurrentNPC.oldPos[num112].X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.oldPos[num112].Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36), frame5, white4, rCurrentNPC.rotation, halfSize, MathHelper.Lerp(0.35f, 1.2f, (10f - (float)num112) / 10f), spriteEffects, 0f);
23195 }
23196 }
23197 if (rCurrentNPC.type == 390 && rCurrentNPC.IsABestiaryIconDummy)
23198 {
23199 LoadNPC(391);
23200 Texture2D value48 = TextureAssets.Npc[391].Value;
23201 Microsoft.Xna.Framework.Rectangle value49 = value48.Frame(1, npcFrameCount[391], 0, (int)rCurrentNPC.localAI[3]);
23202 Vector2 vector46 = new Vector2(-rCurrentNPC.width - 8, 10f);
23203 mySpriteBatch.Draw(value48, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35 + rCurrentNPC.gfxOffY) + vector46, value49, rCurrentNPC.GetAlpha(npcColor), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23204 }
23206 if (type == 182 || type == 289)
23207 {
23208 frame6.Height -= 2;
23209 }
23210 switch (type)
23211 {
23212 case 420:
23213 case 421:
23214 case 423:
23215 case 424:
23216 {
23217 float num117 = 9f + 3f * (float)Math.Cos((float)Math.PI * 2f * GlobalTimeWrappedHourly);
23218 Vector2 spinningpoint5 = Vector2.UnitX * num117;
23219 Microsoft.Xna.Framework.Color color24 = Microsoft.Xna.Framework.Color.Teal * (num117 / 12f) * 0.8f;
23220 color24.A /= 2;
23221 for (float num118 = 0f; num118 < (float)Math.PI * 2f; num118 += (float)Math.PI / 2f)
23222 {
23223 Vector2 vector49 = rCurrentNPC.position + spinningpoint5.RotatedBy(num118);
23224 mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2(vector49.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, vector49.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35 + rCurrentNPC.gfxOffY), frame6, color24, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23225 }
23226 break;
23227 }
23228 case 662:
23229 {
23230 float num114 = 4f + 2f * (float)Math.Cos((float)Math.PI * 2f * GlobalTimeWrappedHourly);
23231 Vector2 spinningpoint4 = Vector2.UnitX * num114;
23232 Microsoft.Xna.Framework.Color color23 = Microsoft.Xna.Framework.Color.Cyan * (num114 / 12f) * 0.4f;
23233 color23.A /= 4;
23234 for (float num115 = 0.9f; num115 >= 0f; num115 -= 0.125f)
23235 {
23236 Vector2 vector47 = rCurrentNPC.position - rCurrentNPC.velocity * 10f * num115;
23237 mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2(vector47.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, vector47.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35 + rCurrentNPC.gfxOffY), frame6, color23 * (1f - num115), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23238 }
23239 for (float num116 = 0f; num116 < (float)Math.PI * 2f; num116 += (float)Math.PI / 2f)
23240 {
23241 Vector2 vector48 = rCurrentNPC.position + spinningpoint4.RotatedBy(num116);
23242 mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2(vector48.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, vector48.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35 + rCurrentNPC.gfxOffY), frame6, color23, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23243 }
23244 break;
23245 }
23246 }
23247 if (rCurrentNPC.aiStyle == 7)
23248 {
23250 }
23251 if (type == 346 && (double)rCurrentNPC.life < (double)rCurrentNPC.lifeMax * 0.5)
23252 {
23253 mySpriteBatch.Draw(TextureAssets.SantaTank.Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35 + rCurrentNPC.gfxOffY), frame6, rCurrentNPC.GetAlpha(npcColor), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23254 }
23255 else if (type == 356)
23256 {
23257 frame6.Height--;
23258 mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35 + rCurrentNPC.gfxOffY), frame6, rCurrentNPC.GetAlpha(npcColor), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23259 }
23260 else if (type == 360)
23261 {
23262 float num119 = 0f;
23263 if (rCurrentNPC.ai[2] == 0f)
23264 {
23265 if (rCurrentNPC.rotation == 3.14f || rCurrentNPC.rotation == -3.14f)
23266 {
23267 num36 = 2f;
23268 }
23269 if (rCurrentNPC.direction < 0 && (rCurrentNPC.rotation == 1.57f || rCurrentNPC.rotation == 4.71f))
23270 {
23271 num119 = 1f;
23272 }
23273 if (rCurrentNPC.direction > 0 && (rCurrentNPC.rotation == 1.57f || rCurrentNPC.rotation == 4.71f))
23274 {
23275 num119 = -1f;
23276 }
23277 }
23278 mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale + num119, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35 + rCurrentNPC.gfxOffY), frame6, rCurrentNPC.GetAlpha(npcColor), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23279 }
23280 else if (type == 655)
23281 {
23282 float num120 = 0f;
23283 if (rCurrentNPC.ai[2] == 0f)
23284 {
23285 if (rCurrentNPC.rotation == 3.14f || rCurrentNPC.rotation == -3.14f)
23286 {
23287 num36 = 2f;
23288 }
23289 if (rCurrentNPC.direction < 0 && (rCurrentNPC.rotation == 1.57f || rCurrentNPC.rotation == 4.71f))
23290 {
23291 num120 = 1f;
23292 }
23293 if (rCurrentNPC.direction > 0 && (rCurrentNPC.rotation == 1.57f || rCurrentNPC.rotation == 4.71f))
23294 {
23295 num120 = -1f;
23296 }
23297 }
23298 mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale + num120, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35 + rCurrentNPC.gfxOffY), frame6, rCurrentNPC.GetAlpha(Microsoft.Xna.Framework.Color.Orange), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23299 }
23300 else if (type == 266 && rCurrentNPC.life < rCurrentNPC.lifeMax && (expertMode || getGoodWorld))
23301 {
23303 float num121 = 1f - (float)rCurrentNPC.life / (float)rCurrentNPC.lifeMax;
23304 if (expertMode)
23305 {
23306 num121 *= 2f;
23307 }
23308 num121 *= num121;
23309 if (getGoodWorld)
23310 {
23311 num121 = 1f;
23312 }
23313 num121 = MathHelper.Clamp(num121, 0f, 1f);
23314 alpha11.R = (byte)((float)(int)alpha11.R * num121);
23315 alpha11.G = (byte)((float)(int)alpha11.G * num121);
23316 alpha11.B = (byte)((float)(int)alpha11.B * num121);
23317 alpha11.A = (byte)((float)(int)alpha11.A * num121);
23318 for (int num122 = 0; num122 < 4; num122++)
23319 {
23320 Vector2 position17 = rCurrentNPC.position;
23321 float num123 = Math.Abs(rCurrentNPC.Center.X - Main.player[myPlayer].Center.X);
23322 float num124 = Math.Abs(rCurrentNPC.Center.Y - Main.player[myPlayer].Center.Y);
23323 if (num122 == 0 || num122 == 2)
23324 {
23325 position17.X = Main.player[myPlayer].Center.X + num123;
23326 }
23327 else
23328 {
23329 position17.X = Main.player[myPlayer].Center.X - num123;
23330 }
23331 position17.X -= rCurrentNPC.width / 2;
23332 if (num122 == 0 || num122 == 1)
23333 {
23334 position17.Y = Main.player[myPlayer].Center.Y + num124;
23335 }
23336 else
23337 {
23338 position17.Y = Main.player[myPlayer].Center.Y - num124;
23339 }
23340 position17.Y -= rCurrentNPC.height / 2;
23341 mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2(position17.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, position17.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35 + rCurrentNPC.gfxOffY), frame6, alpha11, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23342 }
23343 mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35 + rCurrentNPC.gfxOffY), frame6, rCurrentNPC.GetAlpha(npcColor), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23344 }
23345 else if (type == 421 && rCurrentNPC.ai[0] == 5f)
23346 {
23347 Player player = Main.player[rCurrentNPC.target];
23348 if (player.gravDir == -1f)
23349 {
23350 spriteEffects |= SpriteEffects.FlipVertically;
23351 }
23352 mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2(player.direction * 4, player.gfxOffY) + ((player.gravDir == 1f) ? player.Top : player.Bottom) - screenPos, frame6, rCurrentNPC.GetAlpha(npcColor), rCurrentNPC.rotation, frame6.Size() / 2f, rCurrentNPC.scale, spriteEffects, 0f);
23353 mySpriteBatch.Draw(TextureAssets.GlowMask[146].Value, new Vector2(player.direction * 4, player.gfxOffY) + ((player.gravDir == 1f) ? player.Top : player.Bottom) - screenPos, frame6, rCurrentNPC.GetAlpha(npcColor), rCurrentNPC.rotation, frame6.Size() / 2f, rCurrentNPC.scale, spriteEffects, 0f);
23354 }
23355 else
23356 {
23357 switch (type)
23358 {
23359 case 518:
23360 {
23361 Vector2 vector53 = new Vector2(-10f, 0f);
23362 mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35 + rCurrentNPC.gfxOffY), frame6, rCurrentNPC.GetAlpha(npcColor), rCurrentNPC.rotation, halfSize + vector53, rCurrentNPC.scale, spriteEffects, 0f);
23363 if (rCurrentNPC.color != default(Microsoft.Xna.Framework.Color))
23364 {
23365 mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35 + rCurrentNPC.gfxOffY), frame6, rCurrentNPC.GetColor(npcColor), rCurrentNPC.rotation, halfSize + vector53, rCurrentNPC.scale, spriteEffects, 0f);
23366 }
23367 break;
23368 }
23369 case 676:
23370 case 681:
23371 {
23372 if (!rCurrentNPC.IsABestiaryIconDummy)
23373 {
23374 mySpriteBatch.End();
23376 }
23377 DrawData value50 = new DrawData(TextureAssets.Npc[type].Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35 + rCurrentNPC.gfxOffY), frame6, rCurrentNPC.GetAlpha(npcColor), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects);
23378 GameShaders.Misc["RainbowTownSlime"].Apply(value50);
23379 value50.Draw(mySpriteBatch);
23380 pixelShader.CurrentTechnique.Passes[0].Apply();
23381 if (!rCurrentNPC.IsABestiaryIconDummy)
23382 {
23383 mySpriteBatch.End();
23385 }
23386 break;
23387 }
23388 case 685:
23389 {
23390 Vector2 scale4 = new Vector2(rCurrentNPC.scale);
23391 float num131 = rCurrentNPC.rotation;
23392 int num132 = 9;
23394 if (vector50 != Vector2.Zero && rCurrentNPC.velocity.Y == 0f)
23395 {
23396 Vector2 position18 = rCurrentNPC.position;
23398 float num133 = (float)Math.Sin(vector51.X / 30f * ((float)Math.PI * 2f));
23399 float num134 = (float)Math.Sin(vector51.Y / 30f * ((float)Math.PI * 2f));
23400 float num135 = Utils.Remap(vector51.Length(), 0f, 30f, 0f, 1f);
23401 scale4.X += num133 * num135 * 0.25f;
23402 scale4.Y += num134 * num135 * 0.25f;
23403 float num136 = (float)Math.Sin(Utils.Remap(vector51.Length(), 0f, 20f, 0f, 1f) * ((float)Math.PI * 2f));
23404 num131 += num136 * ((float)Math.PI / 4f) * 0.1f * (float)rCurrentNPC.spriteDirection;
23405 }
23406 Vector2 vector52 = new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - 2f - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35 + rCurrentNPC.gfxOffY);
23407 if (rCurrentNPC.velocity.Y == 0f)
23408 {
23409 vector52 = vector52.Floor();
23410 int num137 = 2;
23411 float num138 = vector52.X % 16f;
23412 if (num138 < (float)num137)
23413 {
23414 vector52.X -= num138;
23415 }
23416 if (num138 > (float)(16 - num137))
23417 {
23418 vector52.X += 16f - num138;
23419 }
23420 }
23422 break;
23423 }
23424 case 267:
23425 {
23426 Vector2 position19 = rCurrentNPC.Center + new Vector2(0f, num36 + num35 + rCurrentNPC.gfxOffY) - screenPos;
23428 if (rCurrentNPC.color != default(Microsoft.Xna.Framework.Color))
23429 {
23431 }
23432 break;
23433 }
23434 default:
23435 if (rCurrentNPC.aiStyle == 7 && rCurrentNPC.ai[0] == 25f)
23436 {
23437 int num125 = type;
23438 float num126 = Utils.Remap(rCurrentNPC.ai[1], 0f, 60f, 0f, 1f);
23439 mySpriteBatch.End();
23441 DrawData drawData = new DrawData(TextureAssets.Npc[num125].Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35 + rCurrentNPC.gfxOffY), frame6, Microsoft.Xna.Framework.Color.White * Utils.Remap(num126, 0f, 1f, 0f, 1f) * ((float)(int)rCurrentNPC.GetAlpha(npcColor).A / 255f), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects);
23444 float num127 = Utils.Remap(rCurrentNPC.ai[1], 45f, 90f, 0f, 1f);
23445 for (float num128 = 0f; num128 < 1f; num128 += 1f / 6f)
23446 {
23448 drawData2.color = hslToRgb(num128, 0.9f, 0.65f) * num127 * 0.5f;
23449 drawData2.position += ((GlobalTimeWrappedHourly + num128) * ((float)Math.PI * 2f)).ToRotationVector2() * 4f * num127;
23451 }
23452 drawData.Draw(mySpriteBatch);
23453 pixelShader.CurrentTechnique.Passes[0].Apply();
23455 float num129 = (float)Math.Sin(timeForVisualEffects * 6.2831854820251465 / 20.0);
23456 DrawPrettyStarSparkle(num126, SpriteEffects.None, drawData.position, drawColor, hslToRgb(GlobalTimeWrappedHourly % 1f, 1f, 0.65f, 127), Utils.Remap(rCurrentNPC.ai[1], 30f, 60f, 0f, 30f), 0f, 30f, 30f, 36f, 0f, new Vector2(1.5f, 2.5f) * (1f + num129 * 0.025f), new Vector2(2f, 2f));
23457 DrawPrettyStarSparkle(num126, SpriteEffects.None, drawData.position, drawColor, hslToRgb(GlobalTimeWrappedHourly % 1f, 1f, 0.65f, 127), Utils.Remap(rCurrentNPC.ai[1], 30f, 60f, 0f, 30f), 0f, 30f, 30f, 36f, (float)Math.PI / 4f, new Vector2(2.5f, 2.5f) * (1f + num129 * 0.025f), new Vector2(1f, 1f));
23458 mySpriteBatch.End();
23460 }
23461 else
23462 {
23463 int num130 = type;
23464 if (NPC.IsMechQueenUp && num130 == 134)
23465 {
23466 num130 = 136;
23467 LoadNPC(num130);
23468 }
23469 mySpriteBatch.Draw(TextureAssets.Npc[num130].Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35 + rCurrentNPC.gfxOffY), frame6, rCurrentNPC.GetAlpha(npcColor), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23470 if (rCurrentNPC.color != default(Microsoft.Xna.Framework.Color))
23471 {
23472 mySpriteBatch.Draw(TextureAssets.Npc[num130].Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35 + rCurrentNPC.gfxOffY), frame6, rCurrentNPC.GetColor(npcColor), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23473 }
23474 }
23475 break;
23476 }
23477 }
23478 if (rCurrentNPC.confused)
23479 {
23480 mySpriteBatch.Draw(TextureAssets.Confuse.Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35 - (float)TextureAssets.Confuse.Height() - 20f), new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Confuse.Width(), TextureAssets.Confuse.Height()), rCurrentNPC.GetShimmerColor(new Microsoft.Xna.Framework.Color(250, 250, 250, 70)), rCurrentNPC.velocity.X * -0.05f, new Vector2(TextureAssets.Confuse.Width() / 2, TextureAssets.Confuse.Height() / 2), essScale + 0.2f, SpriteEffects.None, 0f);
23481 }
23482 if (type == 247 || type == 248)
23483 {
23484 Vector2 vector54 = new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35 + rCurrentNPC.gfxOffY);
23486 if (rCurrentNPC.ai[0] == 1f)
23487 {
23488 for (int num139 = 0; num139 < 3; num139++)
23489 {
23490 int num140 = num139 * 5;
23491 int num141 = num140 + 15;
23492 float num142 = Utils.Remap(rCurrentNPC.ai[1], num140, num141, 0f, 1f);
23493 if (num142 != 0f)
23494 {
23495 float num143 = Utils.Remap(num142, 0f, 1f, 2f, 1.1f + 0.1f * (float)num139);
23496 float num144 = num142;
23497 mySpriteBatch.Draw(color: new Microsoft.Xna.Framework.Color(255, 255, 255, 0) * num144, texture: value51, position: vector54, sourceRectangle: frame6, rotation: rCurrentNPC.rotation, origin: halfSize, scale: rCurrentNPC.scale * num143, effects: spriteEffects, layerDepth: 0f);
23498 }
23499 }
23500 }
23501 if (rCurrentNPC.ai[0] == 2f)
23502 {
23503 Microsoft.Xna.Framework.Color color26 = new Microsoft.Xna.Framework.Color(255, 255, 255, 0) * Utils.Remap(rCurrentNPC.ai[1], 0f, 30f, 1f, 0f);
23504 for (int num145 = 0; num145 < 3; num145++)
23505 {
23506 float num146 = 1f;
23507 Vector2 position20 = vector54 + rCurrentNPC.velocity * num145 * -2f;
23508 float num147 = Utils.Remap(num145, 0f, 3f, 1f, 0f);
23510 }
23511 for (int num148 = 0; num148 < 3; num148++)
23512 {
23513 float num149 = 1.1f + 0.1f * (float)num148;
23515 }
23516 }
23517 }
23518 if (type >= 639 && type <= 645)
23519 {
23520 mySpriteBatch.Draw(TextureAssets.GlowMask[286].Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35 + rCurrentNPC.gfxOffY), frame6, rCurrentNPC.GetAlpha(Microsoft.Xna.Framework.Color.White), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23521 }
23522 if (type >= 646 && type <= 652)
23523 {
23524 mySpriteBatch.Draw(TextureAssets.GlowMask[287].Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35 + rCurrentNPC.gfxOffY), frame6, rCurrentNPC.GetAlpha(Microsoft.Xna.Framework.Color.White), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23525 }
23526 if (type >= 134 && type <= 136 && npcColor != Microsoft.Xna.Framework.Color.Black)
23527 {
23528 mySpriteBatch.Draw(TextureAssets.Dest[type - 134].Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35), rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(255, 255, 255, 0) * (1f - (float)rCurrentNPC.alpha / 255f), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23529 }
23530 else if (type == 125)
23531 {
23532 mySpriteBatch.Draw(TextureAssets.EyeLaser.Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35), rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(255, 255, 255, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23533 }
23534 else if (type == 139)
23535 {
23536 mySpriteBatch.Draw(TextureAssets.Probe.Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35), rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(255, 255, 255, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23537 }
23538 else if (type == 127)
23539 {
23540 if (NPC.IsMechQueenUp)
23541 {
23542 rCurrentNPC.whoAmI = rCurrentNPC.whoAmI;
23543 for (int num150 = 0; num150 < 200; num150++)
23544 {
23545 if (!npc[num150].active || (npc[num150].type != 125 && npc[num150].type != 126))
23546 {
23547 continue;
23548 }
23549 float scale5 = npc[num150].scale;
23550 float x = npc[num150].Center.X;
23551 float y2 = npc[num150].Center.Y;
23552 Vector2 mechQueenCenter = rCurrentNPC.GetMechQueenCenter();
23553 Vector2 vector55 = new Vector2((npc[num150].type == 125) ? (-18) : 20, -18f);
23554 vector55 = vector55.RotatedBy(rCurrentNPC.rotation);
23556 float num151 = x - vector56.X;
23557 float num152 = y2 - vector56.Y;
23558 float rotation9 = (float)Math.Atan2(num152, num151) - 1.57f;
23559 bool flag11 = true;
23560 float num153 = (float)Math.Sqrt(num151 * num151 + num152 * num152);
23561 if (num153 > 2000f)
23562 {
23563 flag11 = false;
23564 }
23565 float num154 = 40f * scale5;
23566 while (flag11)
23567 {
23568 num153 = (float)Math.Sqrt(num151 * num151 + num152 * num152);
23569 if (num153 < num154)
23570 {
23571 flag11 = false;
23572 continue;
23573 }
23574 num153 = (float)TextureAssets.Chain12.Height() * scale5 / num153;
23575 num151 *= num153;
23576 num152 *= num153;
23577 Microsoft.Xna.Framework.Color color27 = Lighting.GetColor((int)vector56.X / 16, (int)(vector56.Y / 16f));
23579 vector56.X += num151;
23580 vector56.Y += num152;
23581 num151 = x - vector56.X;
23582 num152 = y2 - vector56.Y;
23583 }
23584 }
23585 }
23586 else
23587 {
23588 mySpriteBatch.Draw(TextureAssets.BoneEyes.Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35), rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(200, 200, 200, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23589 }
23590 }
23591 else if (type == 131)
23592 {
23593 mySpriteBatch.Draw(TextureAssets.BoneLaser.Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35), rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(200, 200, 200, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23594 }
23595 else if (type == 120)
23596 {
23597 for (int num155 = 1; num155 < rCurrentNPC.oldPos.Length; num155++)
23598 {
23599 _ = ref rCurrentNPC.oldPos[num155];
23601 newColor3.R = (byte)(150 * (10 - num155) / 15);
23602 newColor3.G = (byte)(100 * (10 - num155) / 15);
23603 newColor3.B = (byte)(150 * (10 - num155) / 15);
23604 newColor3.A = (byte)(50 * (10 - num155) / 15);
23605 newColor3 = rCurrentNPC.GetShimmerColor(newColor3);
23606 mySpriteBatch.Draw(TextureAssets.Chaos.Value, new Vector2(rCurrentNPC.oldPos[num155].X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.oldPos[num155].Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36), rCurrentNPC.frame, newColor3, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23607 }
23608 }
23609 else if (type == 137 || type == 138)
23610 {
23611 for (int num156 = 1; num156 < rCurrentNPC.oldPos.Length; num156++)
23612 {
23613 _ = ref rCurrentNPC.oldPos[num156];
23615 newColor4.R = (byte)(150 * (10 - num156) / 15);
23616 newColor4.G = (byte)(100 * (10 - num156) / 15);
23617 newColor4.B = (byte)(150 * (10 - num156) / 15);
23618 newColor4.A = (byte)(50 * (10 - num156) / 15);
23619 newColor4 = rCurrentNPC.GetShimmerColor(newColor4);
23620 mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2(rCurrentNPC.oldPos[num156].X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.oldPos[num156].Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36), rCurrentNPC.frame, newColor4, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23621 }
23622 }
23623 else if (type == 327)
23624 {
23625 mySpriteBatch.Draw(TextureAssets.PumpkingFace.Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36), rCurrentNPC.frame, Microsoft.Xna.Framework.Color.White, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23626 for (int num157 = 1; num157 < 10; num157++)
23627 {
23628 Microsoft.Xna.Framework.Color color28 = new Microsoft.Xna.Framework.Color(110 - num157 * 10, 110 - num157 * 10, 110 - num157 * 10, 110 - num157 * 10);
23629 Vector2 vector57 = new Vector2((float)rand.Next(-10, 11) * 0.2f, (float)rand.Next(-10, 11) * 0.2f);
23630 mySpriteBatch.Draw(TextureAssets.PumpkingFace.Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36) + vector57, rCurrentNPC.frame, color28, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23631 }
23632 }
23633 else if (type == 325)
23634 {
23635 mySpriteBatch.Draw(TextureAssets.TreeFace.Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36), rCurrentNPC.frame, Microsoft.Xna.Framework.Color.White, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23636 for (int num158 = 1; num158 < 10; num158++)
23637 {
23638 Microsoft.Xna.Framework.Color color29 = new Microsoft.Xna.Framework.Color(110 - num158 * 10, 110 - num158 * 10, 110 - num158 * 10, 110 - num158 * 10);
23639 Vector2 vector58 = new Vector2((float)rand.Next(-10, 11) * 0.2f, (float)rand.Next(-10, 11) * 0.2f);
23640 mySpriteBatch.Draw(TextureAssets.TreeFace.Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36) + vector58, rCurrentNPC.frame, color29, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23641 }
23642 }
23643 else if (type == 345)
23644 {
23645 mySpriteBatch.Draw(TextureAssets.IceQueen.Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36), rCurrentNPC.frame, Microsoft.Xna.Framework.Color.White, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23646 for (int num159 = 1; num159 < 5; num159++)
23647 {
23648 mySpriteBatch.Draw(color: new Microsoft.Xna.Framework.Color(100 - num159 * 10, 100 - num159 * 10, 100 - num159 * 10, 100 - num159 * 10), texture: TextureAssets.IceQueen.Value, position: new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36) - rCurrentNPC.velocity * num159 * 0.2f, sourceRectangle: rCurrentNPC.frame, rotation: rCurrentNPC.rotation, origin: halfSize, scale: rCurrentNPC.scale, effects: spriteEffects, layerDepth: 0f);
23649 }
23650 }
23651 else if (type == 355)
23652 {
23653 mySpriteBatch.Draw(TextureAssets.Firefly.Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36), rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(255, 255, 255, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23654 }
23655 else if (type == 358)
23656 {
23657 mySpriteBatch.Draw(TextureAssets.Lightningbug.Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36), rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(255, 255, 255, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23658 }
23659 else if (type == 654)
23660 {
23661 mySpriteBatch.Draw(TextureAssets.GlowMask[290].Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36), rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(255, 255, 255, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23662 }
23663 else if (type == 653)
23664 {
23665 mySpriteBatch.Draw(TextureAssets.GlowMask[288].Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 3f + halfSize.Y * rCurrentNPC.scale + num36), rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(255, 255, 255, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23666 }
23667 else if (type == 82)
23668 {
23669 mySpriteBatch.Draw(TextureAssets.WraithEye.Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36), rCurrentNPC.frame, Microsoft.Xna.Framework.Color.White, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23670 for (int num160 = 1; num160 < 10; num160++)
23671 {
23672 mySpriteBatch.Draw(color: new Microsoft.Xna.Framework.Color(110 - num160 * 10, 110 - num160 * 10, 110 - num160 * 10, 110 - num160 * 10), texture: TextureAssets.WraithEye.Value, position: new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36) - rCurrentNPC.velocity * num160 * 0.5f, sourceRectangle: rCurrentNPC.frame, rotation: rCurrentNPC.rotation, origin: halfSize, scale: rCurrentNPC.scale, effects: spriteEffects, layerDepth: 0f);
23673 }
23674 }
23675 else if (type == 253)
23676 {
23677 mySpriteBatch.Draw(TextureAssets.ReaperEye.Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 3f + halfSize.Y * rCurrentNPC.scale + num36), rCurrentNPC.frame, Microsoft.Xna.Framework.Color.White, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23678 for (int num161 = 1; num161 < 20; num161++)
23679 {
23680 mySpriteBatch.Draw(color: new Microsoft.Xna.Framework.Color(210 - num161 * 20, 210 - num161 * 20, 210 - num161 * 20, 210 - num161 * 20), texture: TextureAssets.ReaperEye.Value, position: new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 3f + halfSize.Y * rCurrentNPC.scale + num36) - rCurrentNPC.velocity * num161 * 0.5f, sourceRectangle: rCurrentNPC.frame, rotation: rCurrentNPC.rotation, origin: halfSize, scale: rCurrentNPC.scale, effects: spriteEffects, layerDepth: 0f);
23681 }
23682 }
23683 else if (type == 245 && rCurrentNPC.alpha == 0 && !getGoodWorld)
23684 {
23685 mySpriteBatch.Draw(color: new Microsoft.Xna.Framework.Color(mouseTextColor, mouseTextColor, mouseTextColor, 0), texture: TextureAssets.Golem[3].Value, position: new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35 + rCurrentNPC.gfxOffY), sourceRectangle: frame6, rotation: rCurrentNPC.rotation, origin: halfSize, scale: rCurrentNPC.scale, effects: spriteEffects, layerDepth: 0f);
23686 }
23687 else if (type == 246 && !getGoodWorld)
23688 {
23690 if (rCurrentNPC.frame.Y < 222)
23691 {
23692 if (!getGoodWorld)
23693 {
23694 mySpriteBatch.Draw(TextureAssets.Golem[1].Value, new Vector2(rCurrentNPC.Center.X - screenPos.X - 20f, rCurrentNPC.Center.Y - screenPos.Y - 27f), new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Golem[1].Width(), TextureAssets.Golem[1].Height() / 2), color34, 0f, default(Vector2), 1f, SpriteEffects.None, 0f);
23695 }
23697 value52.Y = 0;
23698 mySpriteBatch.Draw(TextureAssets.Extra[107].Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35 + rCurrentNPC.gfxOffY), value52, color34, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23699 }
23700 else if (!getGoodWorld && rCurrentNPC.frame.Y < 444)
23701 {
23702 mySpriteBatch.Draw(TextureAssets.Golem[2].Value, new Vector2(rCurrentNPC.Center.X - screenPos.X + 26f, rCurrentNPC.Center.Y - screenPos.Y - 28f), new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Golem[2].Width(), TextureAssets.Golem[2].Height() / 4), color34, 0f, default(Vector2), 1f, SpriteEffects.None, 0f);
23703 }
23704 else if (!getGoodWorld)
23705 {
23706 mySpriteBatch.Draw(TextureAssets.Golem[2].Value, new Vector2(rCurrentNPC.Center.X - screenPos.X - 38f, rCurrentNPC.Center.Y - screenPos.Y - 28f), new Microsoft.Xna.Framework.Rectangle(0, TextureAssets.Golem[2].Height() / 2, TextureAssets.Golem[2].Width(), TextureAssets.Golem[2].Height() / 4), color34, 0f, default(Vector2), 1f, SpriteEffects.None, 0f);
23707 }
23708 }
23709 else if (type == 249 && !getGoodWorld)
23710 {
23712 if (!getGoodWorld)
23713 {
23714 mySpriteBatch.Draw(TextureAssets.Golem[1].Value, new Vector2(rCurrentNPC.Center.X - screenPos.X - 20f, rCurrentNPC.Center.Y - screenPos.Y - 47f), new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Golem[1].Width(), TextureAssets.Golem[1].Height() / 2), color35, 0f, default(Vector2), 1f, SpriteEffects.None, 0f);
23715 }
23716 int num162 = (int)rCurrentNPC.frameCounter / 4;
23717 Texture2D value53 = TextureAssets.Extra[106].Value;
23720 value54.Y += value54.Height * 2 * num162 + frame6.Y;
23721 mySpriteBatch.Draw(value53, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35 + rCurrentNPC.gfxOffY), value54, color35, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23722 value53 = TextureAssets.Extra[107].Value;
23723 value54 = frame6;
23724 mySpriteBatch.Draw(value53, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35 + rCurrentNPC.gfxOffY), value54, color35, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23725 }
23726 else if (type == 383)
23727 {
23728 mySpriteBatch.Draw(TextureAssets.GlowMask[11].Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35 + rCurrentNPC.gfxOffY), frame6, new Microsoft.Xna.Framework.Color(255, 255, 255, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23729 if (rCurrentNPC.ai[2] != 0f && npc[(int)rCurrentNPC.ai[2] - 1].active && npc[(int)rCurrentNPC.ai[2] - 1].type == 384)
23730 {
23731 _ = rCurrentNPC.ai[2];
23732 mySpriteBatch.Draw(TextureAssets.Npc[384].Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35 + rCurrentNPC.gfxOffY), null, new Microsoft.Xna.Framework.Color(100, 100, 100, 0), rCurrentNPC.rotation, new Vector2(TextureAssets.Npc[384].Width(), TextureAssets.Npc[384].Height()) / 2f, rCurrentNPC.scale, spriteEffects, 0f);
23733 }
23734 }
23735 else if (type == 381)
23736 {
23739 int num163 = TextureAssets.Npc[type].Height() / npcFrameCount[type];
23740 int num164 = rCurrentNPC.frame.Y / num163;
23742 switch (num164)
23743 {
23744 case 0:
23745 zero3 += new Vector2(8f, 32f);
23746 break;
23747 case 1:
23748 zero3 += new Vector2(6f, 72f);
23749 break;
23750 case 2:
23751 zero3 += new Vector2(8f, 126f);
23752 break;
23753 case 3:
23754 zero3 += new Vector2(6f, 174f);
23755 break;
23756 case 4:
23757 zero3 += new Vector2(6f, 224f);
23758 break;
23759 case 5:
23760 zero3 += new Vector2(8f, 272f);
23761 break;
23762 case 6:
23763 zero3 += new Vector2(10f, 318f);
23764 break;
23765 case 7:
23766 zero3 += new Vector2(14f, 366f);
23767 break;
23768 case 8:
23769 zero3 += new Vector2(10f, 414f);
23770 break;
23771 }
23772 zero3.Y -= num163 * num164;
23773 zero3 -= halfSize;
23774 int num165 = 2;
23775 if (rCurrentNPC.ai[2] > 0f)
23776 {
23777 num165 = (int)rCurrentNPC.ai[2] - 1;
23778 }
23779 if (rCurrentNPC.velocity.Y != 0f)
23780 {
23781 num165 = 3;
23782 }
23783 value55.Y += 44 * num165;
23784 switch (num165)
23785 {
23786 case 0:
23787 origin19 = new Vector2(10f, 18f);
23788 break;
23789 case 1:
23790 origin19 = new Vector2(8f, 20f);
23791 break;
23792 case 2:
23793 origin19 = new Vector2(8f, 20f);
23794 break;
23795 case 3:
23796 origin19 = new Vector2(8f, 20f);
23797 break;
23798 case 4:
23799 origin19 = new Vector2(6f, 18f);
23800 break;
23801 }
23802 if (spriteEffects.HasFlag(SpriteEffects.FlipHorizontally))
23803 {
23804 zero3.X *= -1f;
23805 origin19.X = (float)value55.Width - origin19.X;
23806 }
23807 zero3 += rCurrentNPC.Center;
23808 zero3 -= screenPos;
23809 zero3.Y += rCurrentNPC.gfxOffY;
23811 mySpriteBatch.Draw(TextureAssets.GlowMask[24].Value, zero3, value55, new Microsoft.Xna.Framework.Color(255, 255, 255, 0), rCurrentNPC.rotation, origin19, rCurrentNPC.scale, spriteEffects, 0f);
23812 }
23813 else if (type == 382)
23814 {
23817 int num166 = TextureAssets.Npc[type].Height() / npcFrameCount[type];
23818 int num167 = rCurrentNPC.frame.Y / num166;
23820 switch (num167)
23821 {
23822 case 0:
23823 zero4 += new Vector2(8f, 30f);
23824 break;
23825 case 1:
23826 zero4 += new Vector2(6f, 68f);
23827 break;
23828 case 2:
23829 zero4 += new Vector2(8f, 120f);
23830 break;
23831 case 3:
23832 zero4 += new Vector2(6f, 166f);
23833 break;
23834 case 4:
23835 zero4 += new Vector2(6f, 214f);
23836 break;
23837 case 5:
23838 zero4 += new Vector2(8f, 260f);
23839 break;
23840 case 6:
23841 zero4 += new Vector2(14f, 304f);
23842 break;
23843 case 7:
23844 zero4 += new Vector2(14f, 350f);
23845 break;
23846 case 8:
23847 zero4 += new Vector2(10f, 396f);
23848 break;
23849 }
23850 zero4.Y -= num166 * num167;
23851 zero4 -= halfSize;
23852 int num168 = 2;
23853 if (rCurrentNPC.ai[2] > 0f)
23854 {
23855 num168 = (int)rCurrentNPC.ai[2] - 1;
23856 }
23857 if (rCurrentNPC.velocity.Y != 0f)
23858 {
23859 num168 = 3;
23860 }
23861 value56.Y += 44 * num168;
23862 switch (num168)
23863 {
23864 case 0:
23865 origin20 = new Vector2(10f, 18f);
23866 break;
23867 case 1:
23868 origin20 = new Vector2(8f, 20f);
23869 break;
23870 case 2:
23871 origin20 = new Vector2(8f, 20f);
23872 break;
23873 case 3:
23874 origin20 = new Vector2(8f, 20f);
23875 break;
23876 case 4:
23877 origin20 = new Vector2(6f, 18f);
23878 break;
23879 }
23880 if (spriteEffects.HasFlag(SpriteEffects.FlipHorizontally))
23881 {
23882 zero4.X *= -1f;
23883 origin20.X = (float)value56.Width - origin20.X;
23884 }
23885 zero4 += rCurrentNPC.Center;
23886 zero4 -= screenPos;
23887 zero4.Y += rCurrentNPC.gfxOffY;
23889 }
23890 else if (type == 520)
23891 {
23892 mySpriteBatch.Draw(TextureAssets.GlowMask[164].Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35 + rCurrentNPC.gfxOffY), frame6, new Microsoft.Xna.Framework.Color(255, 255, 255, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23894 Vector2 origin21 = new Vector2(4f, 4f);
23895 int num169 = TextureAssets.Npc[type].Height() / npcFrameCount[type];
23896 _ = rCurrentNPC.frame.Y / num169;
23897 if (spriteEffects.HasFlag(SpriteEffects.FlipHorizontally))
23898 {
23899 zero5.X *= -1f;
23900 origin21.X = (float)TextureAssets.Extra[56].Width() - origin21.X;
23901 }
23902 zero5 += rCurrentNPC.Top + new Vector2(0f, 20f);
23903 zero5 -= screenPos;
23904 zero5.Y += rCurrentNPC.gfxOffY;
23905 float num170 = rCurrentNPC.localAI[3];
23906 if (spriteEffects.HasFlag(SpriteEffects.FlipHorizontally))
23907 {
23908 num170 += (float)Math.PI;
23909 }
23911 mySpriteBatch.Draw(TextureAssets.GlowMask[165].Value, zero5, null, new Microsoft.Xna.Framework.Color(255, 255, 255, 0), num170, origin21, rCurrentNPC.scale, spriteEffects, 0f);
23912 }
23913 else if (type == 386)
23914 {
23915 mySpriteBatch.Draw(TextureAssets.GlowMask[31].Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35 + rCurrentNPC.gfxOffY), frame6, new Microsoft.Xna.Framework.Color(255, 255, 255, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23916 }
23917 else if (type == 387)
23918 {
23919 Microsoft.Xna.Framework.Color color36 = new Microsoft.Xna.Framework.Color(1f, 1f, 1f, 1f) * 0.75f;
23920 if (rCurrentNPC.ai[0] > 0f)
23921 {
23922 float amount7 = (rCurrentNPC.ai[0] + 1f) / 60f;
23924 color36.A = (byte)MathHelper.Lerp((int)color36.A, 0f, amount7);
23925 }
23926 color36 *= (255f - (float)rCurrentNPC.alpha) / 255f;
23927 mySpriteBatch.Draw(TextureAssets.GlowMask[32].Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35 + rCurrentNPC.gfxOffY), frame6, color36, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23928 }
23929 else if (type == 388)
23930 {
23931 mySpriteBatch.Draw(TextureAssets.GlowMask[33].Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35 + rCurrentNPC.gfxOffY), frame6, new Microsoft.Xna.Framework.Color(255, 255, 255, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23932 }
23933 else if (type == 389)
23934 {
23935 mySpriteBatch.Draw(TextureAssets.GlowMask[34].Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35 + rCurrentNPC.gfxOffY), frame6, new Microsoft.Xna.Framework.Color(255, 255, 255, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23936 }
23937 else if (type == 4 && rCurrentNPC.ai[1] >= 4f && rCurrentNPC.ai[0] == 3f)
23938 {
23939 for (int num171 = 1; num171 < rCurrentNPC.oldPos.Length; num171++)
23940 {
23941 _ = ref rCurrentNPC.oldPos[num171];
23943 color37.R = (byte)(0.5 * (double)(int)color37.R * (double)(10 - num171) / 20.0);
23944 color37.G = (byte)(0.5 * (double)(int)color37.G * (double)(10 - num171) / 20.0);
23945 color37.B = (byte)(0.5 * (double)(int)color37.B * (double)(10 - num171) / 20.0);
23946 color37.A = (byte)(0.5 * (double)(int)color37.A * (double)(10 - num171) / 20.0);
23947 mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2(rCurrentNPC.oldPos[num171].X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.oldPos[num171].Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36), rCurrentNPC.frame, color37, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23948 }
23949 }
23950 else if (type == 437)
23951 {
23953 white5.A = 200;
23954 mySpriteBatch.Draw(TextureAssets.GlowMask[109].Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35 + rCurrentNPC.gfxOffY), frame6, white5, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23955 mySpriteBatch.Draw(TextureAssets.GlowMask[108].Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + num35 + rCurrentNPC.gfxOffY), null, white5, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23956 }
23957 else if (type == 471 && rCurrentNPC.ai[3] < 0f)
23958 {
23959 for (int num172 = 1; num172 < rCurrentNPC.oldPos.Length; num172++)
23960 {
23961 _ = ref rCurrentNPC.oldPos[num172];
23963 color38.R = (byte)(0.5 * (double)(int)color38.R * (double)(10 - num172) / 20.0);
23964 color38.G = (byte)(0.5 * (double)(int)color38.G * (double)(10 - num172) / 20.0);
23965 color38.B = (byte)(0.5 * (double)(int)color38.B * (double)(10 - num172) / 20.0);
23966 color38.A = (byte)(0.5 * (double)(int)color38.A * (double)(10 - num172) / 20.0);
23967 mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2(rCurrentNPC.oldPos[num172].X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.oldPos[num172].Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36), rCurrentNPC.frame, color38, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23968 }
23969 }
23970 else if (type == 477 && rCurrentNPC.velocity.Length() > 9f)
23971 {
23972 for (int num173 = 1; num173 < rCurrentNPC.oldPos.Length; num173++)
23973 {
23974 _ = ref rCurrentNPC.oldPos[num173];
23976 color39.R = (byte)(0.5 * (double)(int)color39.R * (double)(10 - num173) / 20.0);
23977 color39.G = (byte)(0.5 * (double)(int)color39.G * (double)(10 - num173) / 20.0);
23978 color39.B = (byte)(0.5 * (double)(int)color39.B * (double)(10 - num173) / 20.0);
23979 color39.A = (byte)(0.5 * (double)(int)color39.A * (double)(10 - num173) / 20.0);
23981 int num174 = TextureAssets.Npc[type].Height() / npcFrameCount[type];
23982 frame7.Y -= num174 * num173;
23983 while (frame7.Y < 0)
23984 {
23985 frame7.Y += num174 * npcFrameCount[type];
23986 }
23987 mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2(rCurrentNPC.oldPos[num173].X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.oldPos[num173].Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36), frame7, color39, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
23988 }
23989 }
23990 if (type == 479 && (double)rCurrentNPC.velocity.Length() > 6.5)
23991 {
23992 for (int num175 = 1; num175 < rCurrentNPC.oldPos.Length; num175++)
23993 {
23994 _ = ref rCurrentNPC.oldPos[num175];
23996 color40.R = (byte)(0.5 * (double)(int)color40.R * (double)(10 - num175) / 20.0);
23997 color40.G = (byte)(0.5 * (double)(int)color40.G * (double)(10 - num175) / 20.0);
23998 color40.B = (byte)(0.5 * (double)(int)color40.B * (double)(10 - num175) / 20.0);
23999 color40.A = (byte)(0.5 * (double)(int)color40.A * (double)(10 - num175) / 20.0);
24001 int num176 = TextureAssets.Npc[type].Height() / npcFrameCount[type];
24002 frame8.Y -= num176 * num175;
24003 while (frame8.Y < 0)
24004 {
24005 frame8.Y += num176 * npcFrameCount[type];
24006 }
24007 mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2(rCurrentNPC.oldPos[num175].X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.oldPos[num175].Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36), frame8, color40, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
24008 }
24009 }
24010 else if (type == 472)
24011 {
24012 mySpriteBatch.Draw(TextureAssets.GlowMask[110].Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.position.Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36), rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(255 - rCurrentNPC.alpha, 255 - rCurrentNPC.alpha, 255 - rCurrentNPC.alpha, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
24013 }
24014 else if (rCurrentNPC.aiStyle == 87)
24015 {
24016 if ((int)rCurrentNPC.ai[0] == 4 || rCurrentNPC.ai[0] == 5f || rCurrentNPC.ai[0] == 6f)
24017 {
24018 for (int num177 = 1; num177 < rCurrentNPC.oldPos.Length; num177++)
24019 {
24020 _ = ref rCurrentNPC.oldPos[num177];
24022 newColor5.R = (byte)(0.5 * (double)(int)newColor5.R * (double)(10 - num177) / 20.0);
24023 newColor5.G = (byte)(0.5 * (double)(int)newColor5.G * (double)(10 - num177) / 20.0);
24024 newColor5.B = (byte)(0.5 * (double)(int)newColor5.B * (double)(10 - num177) / 20.0);
24025 newColor5.A = (byte)(0.5 * (double)(int)newColor5.A * (double)(10 - num177) / 20.0);
24026 newColor5 = rCurrentNPC.GetShimmerColor(newColor5);
24027 mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2(rCurrentNPC.oldPos[num177].X - screenPos.X + (float)(rCurrentNPC.width / 2) - (float)TextureAssets.Npc[type].Width() * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, rCurrentNPC.oldPos[num177].Y - screenPos.Y + (float)rCurrentNPC.height - (float)TextureAssets.Npc[type].Height() * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36), rCurrentNPC.frame, newColor5, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
24028 }
24029 }
24030 }
24031 else
24032 {
24033 switch (type)
24034 {
24035 case 50:
24036 {
24038 Vector2 center4 = rCurrentNPC.Center;
24039 float num199 = 0f;
24040 switch (rCurrentNPC.frame.Y / (TextureAssets.Npc[type].Height() / npcFrameCount[type]))
24041 {
24042 case 0:
24043 num199 = 2f;
24044 break;
24045 case 1:
24046 num199 = -6f;
24047 break;
24048 case 2:
24049 num199 = 2f;
24050 break;
24051 case 3:
24052 num199 = 10f;
24053 break;
24054 case 4:
24055 num199 = 2f;
24056 break;
24057 case 5:
24058 num199 = 0f;
24059 break;
24060 }
24061 center4.Y += rCurrentNPC.gfxOffY - (70f - num199) * rCurrentNPC.scale;
24062 mySpriteBatch.Draw(value57, center4 - screenPos, null, npcColor, 0f, value57.Size() / 2f, 1f, spriteEffects, 0f);
24063 break;
24064 }
24065 case 411:
24066 mySpriteBatch.Draw(TextureAssets.GlowMask[136].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float)(-TextureAssets.Npc[type].Width()) * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, (float)(-TextureAssets.Npc[type].Height()) * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + rCurrentNPC.gfxOffY), rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
24067 break;
24068 case 409:
24069 mySpriteBatch.Draw(TextureAssets.GlowMask[138].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float)(-TextureAssets.Npc[type].Width()) * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, (float)(-TextureAssets.Npc[type].Height()) * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + rCurrentNPC.gfxOffY), rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(255 - rCurrentNPC.alpha, 255 - rCurrentNPC.alpha, 255 - rCurrentNPC.alpha, 255 - rCurrentNPC.alpha), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
24070 break;
24071 case 410:
24072 mySpriteBatch.Draw(TextureAssets.GlowMask[137].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float)(-TextureAssets.Npc[type].Width()) * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, (float)(-TextureAssets.Npc[type].Height()) * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + rCurrentNPC.gfxOffY), rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(255 - rCurrentNPC.alpha, 255 - rCurrentNPC.alpha, 255 - rCurrentNPC.alpha, 255 - rCurrentNPC.alpha), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
24073 break;
24074 case 407:
24075 mySpriteBatch.Draw(TextureAssets.GlowMask[139].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float)(-TextureAssets.Npc[type].Width()) * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, (float)(-TextureAssets.Npc[type].Height()) * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + rCurrentNPC.gfxOffY), rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(255 - rCurrentNPC.alpha, 255 - rCurrentNPC.alpha, 255 - rCurrentNPC.alpha, 255 - rCurrentNPC.alpha), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
24076 break;
24077 case 405:
24078 mySpriteBatch.Draw(TextureAssets.GlowMask[141].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float)(-TextureAssets.Npc[type].Width()) * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, (float)(-TextureAssets.Npc[type].Height()) * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + rCurrentNPC.gfxOffY), rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
24079 break;
24080 case 406:
24081 mySpriteBatch.Draw(TextureAssets.GlowMask[142].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float)(-TextureAssets.Npc[type].Width()) * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, (float)(-TextureAssets.Npc[type].Height()) * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + rCurrentNPC.gfxOffY), rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
24082 break;
24083 case 424:
24084 mySpriteBatch.Draw(TextureAssets.GlowMask[144].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float)(-TextureAssets.Npc[type].Width()) * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, (float)(-TextureAssets.Npc[type].Height()) * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + rCurrentNPC.gfxOffY), rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
24085 break;
24086 case 423:
24087 mySpriteBatch.Draw(TextureAssets.GlowMask[145].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float)(-TextureAssets.Npc[type].Width()) * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, (float)(-TextureAssets.Npc[type].Height()) * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + rCurrentNPC.gfxOffY), rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
24088 break;
24089 case 421:
24090 mySpriteBatch.Draw(TextureAssets.GlowMask[146].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float)(-TextureAssets.Npc[type].Width()) * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, (float)(-TextureAssets.Npc[type].Height()) * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + rCurrentNPC.gfxOffY), rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
24091 break;
24092 case 420:
24093 mySpriteBatch.Draw(TextureAssets.GlowMask[147].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float)(-TextureAssets.Npc[type].Width()) * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, (float)(-TextureAssets.Npc[type].Height()) * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + rCurrentNPC.gfxOffY), rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
24094 break;
24095 case 425:
24096 {
24097 Vector2 vector60 = rCurrentNPC.Bottom - screenPos + new Vector2((float)(-TextureAssets.Npc[type].Width()) * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, (float)(-TextureAssets.Npc[type].Height()) * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + rCurrentNPC.gfxOffY);
24098 mySpriteBatch.Draw(TextureAssets.GlowMask[150].Value, vector60, rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
24099 Vector2 drawpos = vector60 + new Vector2(27 * -rCurrentNPC.spriteDirection, 0f);
24100 float num200 = rCurrentNPC.ai[3];
24101 DrawPrettyStarSparkle(Utils.Remap(num200, 0f, 15f, 0f, 1f), SpriteEffects.None, drawpos, new Microsoft.Xna.Framework.Color(255, 255, 255, 0), Microsoft.Xna.Framework.Color.Green, num200, 0f, 30f, 30f, 36f, 0f, new Vector2(3f, 1.5f), new Vector2(2f, 2f));
24102 break;
24103 }
24104 case 429:
24105 mySpriteBatch.Draw(TextureAssets.GlowMask[151].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float)(-TextureAssets.Npc[type].Width()) * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, (float)(-TextureAssets.Npc[type].Height()) * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + rCurrentNPC.gfxOffY), rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
24106 break;
24107 case 418:
24108 {
24109 mySpriteBatch.Draw(TextureAssets.GlowMask[161].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float)(-TextureAssets.Npc[type].Width()) * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, (float)(-TextureAssets.Npc[type].Height()) * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + rCurrentNPC.gfxOffY), rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(255 - rCurrentNPC.alpha, 255 - rCurrentNPC.alpha, 255 - rCurrentNPC.alpha, 255 - rCurrentNPC.alpha), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
24110 float num197 = 0.25f + (rCurrentNPC.GetAlpha(npcColor).ToVector3() - new Vector3(0.5f)).Length() * 0.25f;
24111 for (int num198 = 0; num198 < 4; num198++)
24112 {
24113 mySpriteBatch.Draw(TextureAssets.GlowMask[161].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float)(-TextureAssets.Npc[type].Width()) * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, (float)(-TextureAssets.Npc[type].Height()) * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + rCurrentNPC.gfxOffY) + rCurrentNPC.velocity.RotatedBy((float)num198 * ((float)Math.PI / 2f)) * num197, rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(64, 64, 64, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
24114 }
24115 break;
24116 }
24117 case 412:
24118 case 413:
24119 case 414:
24120 {
24122 int num194 = 157 + type - 412;
24123 if (type == 414 && rCurrentNPC.localAI[2] != 0f)
24124 {
24125 int num195 = (int)rCurrentNPC.localAI[2];
24126 if (rCurrentNPC.localAI[2] < 0f)
24127 {
24128 num195 = 128 + (int)rCurrentNPC.localAI[2];
24129 }
24130 int num196 = 255 - num195;
24132 }
24133 mySpriteBatch.Draw(TextureAssets.GlowMask[num194].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float)(-TextureAssets.Npc[type].Width()) * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, (float)(-TextureAssets.Npc[type].Height()) * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + rCurrentNPC.gfxOffY), rCurrentNPC.frame, color41, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
24134 break;
24135 }
24136 default:
24137 switch (type)
24138 {
24139 case 415:
24140 {
24141 mySpriteBatch.Draw(TextureAssets.GlowMask[155].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float)(-TextureAssets.Npc[type].Width()) * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, (float)(-TextureAssets.Npc[type].Height()) * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + rCurrentNPC.gfxOffY), rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(255 - rCurrentNPC.alpha, 255 - rCurrentNPC.alpha, 255 - rCurrentNPC.alpha, 255 - rCurrentNPC.alpha), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
24142 float num178 = 0.5f + (rCurrentNPC.GetAlpha(npcColor).ToVector3() - new Vector3(0.5f)).Length() * 0.5f;
24143 for (int num179 = 0; num179 < 4; num179++)
24144 {
24145 mySpriteBatch.Draw(TextureAssets.GlowMask[155].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float)(-TextureAssets.Npc[type].Width()) * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, (float)(-TextureAssets.Npc[type].Height()) * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + rCurrentNPC.gfxOffY) + rCurrentNPC.velocity.RotatedBy((float)num179 * ((float)Math.PI / 2f)) * num178, rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(64, 64, 64, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
24146 }
24147 break;
24148 }
24149 case 419:
24150 mySpriteBatch.Draw(TextureAssets.GlowMask[154].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float)(-TextureAssets.Npc[type].Width()) * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, (float)(-TextureAssets.Npc[type].Height()) * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + rCurrentNPC.gfxOffY), rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(255 - rCurrentNPC.alpha, 255 - rCurrentNPC.alpha, 255 - rCurrentNPC.alpha, 255 - rCurrentNPC.alpha), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
24151 if (rCurrentNPC.ai[2] >= -6f)
24152 {
24153 float num182 = 0.5f + (rCurrentNPC.GetAlpha(npcColor).ToVector3() - new Vector3(0.5f)).Length() * 0.5f;
24154 for (int num183 = 0; num183 < 4; num183++)
24155 {
24156 mySpriteBatch.Draw(TextureAssets.GlowMask[154].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float)(-TextureAssets.Npc[type].Width()) * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, (float)(-TextureAssets.Npc[type].Height()) * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + rCurrentNPC.gfxOffY) + rCurrentNPC.velocity.RotatedBy((float)num183 * ((float)Math.PI / 2f)) * num182, rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(64, 64, 64, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
24157 }
24158 }
24159 else
24160 {
24161 float num184 = 4f;
24162 for (int num185 = 0; num185 < 4; num185++)
24163 {
24164 mySpriteBatch.Draw(TextureAssets.GlowMask[154].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float)(-TextureAssets.Npc[type].Width()) * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, (float)(-TextureAssets.Npc[type].Height()) * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + rCurrentNPC.gfxOffY) + Vector2.UnitX.RotatedBy((float)num185 * ((float)Math.PI / 2f)) * num184, rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(64, 64, 64, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
24165 }
24166 }
24167 break;
24168 case 417:
24169 {
24170 mySpriteBatch.Draw(TextureAssets.GlowMask[160].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float)(-TextureAssets.Npc[type].Width()) * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, (float)(-TextureAssets.Npc[type].Height()) * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + rCurrentNPC.gfxOffY), rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(255 - rCurrentNPC.alpha, 255 - rCurrentNPC.alpha, 255 - rCurrentNPC.alpha, 255 - rCurrentNPC.alpha), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
24171 float num192 = 0.25f + (rCurrentNPC.GetAlpha(npcColor).ToVector3() - new Vector3(0.5f)).Length() * 0.25f;
24172 for (int num193 = 0; num193 < 4; num193++)
24173 {
24174 mySpriteBatch.Draw(TextureAssets.GlowMask[160].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float)(-TextureAssets.Npc[type].Width()) * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, (float)(-TextureAssets.Npc[type].Height()) * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + rCurrentNPC.gfxOffY) + rCurrentNPC.velocity.RotatedBy((float)num193 * ((float)Math.PI / 2f)) * num192, rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(64, 64, 64, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
24175 }
24176 break;
24177 }
24178 case 516:
24179 {
24180 mySpriteBatch.Draw(TextureAssets.Npc[type].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float)(-TextureAssets.Npc[type].Width()) * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, (float)(-TextureAssets.Npc[type].Height()) * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + rCurrentNPC.gfxOffY), rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(255 - rCurrentNPC.alpha, 255 - rCurrentNPC.alpha, 255 - rCurrentNPC.alpha, 255 - rCurrentNPC.alpha), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
24181 float num186 = 0.5f + (rCurrentNPC.GetAlpha(npcColor).ToVector3() - new Vector3(0.5f)).Length() * 0.5f;
24182 for (int num187 = 0; num187 < 4; num187++)
24183 {
24184 mySpriteBatch.Draw(TextureAssets.Npc[type].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float)(-TextureAssets.Npc[type].Width()) * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, (float)(-TextureAssets.Npc[type].Height()) * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + rCurrentNPC.gfxOffY) + rCurrentNPC.velocity.RotatedBy((float)num187 * ((float)Math.PI / 2f)) * num186, rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(64, 64, 64, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
24185 }
24186 break;
24187 }
24188 case 518:
24189 {
24190 Vector2 vector59 = new Vector2(-10f, 0f);
24191 mySpriteBatch.Draw(TextureAssets.GlowMask[163].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float)(-TextureAssets.Npc[type].Width()) * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, (float)(-TextureAssets.Npc[type].Height()) * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + rCurrentNPC.gfxOffY), rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(255 - rCurrentNPC.alpha, 255 - rCurrentNPC.alpha, 255 - rCurrentNPC.alpha, 255 - rCurrentNPC.alpha), rCurrentNPC.rotation, halfSize + vector59, rCurrentNPC.scale, spriteEffects, 0f);
24192 float num190 = 0.5f + (rCurrentNPC.GetAlpha(npcColor).ToVector3() - new Vector3(0.5f)).Length() * 0.5f;
24193 for (int num191 = 0; num191 < 4; num191++)
24194 {
24195 mySpriteBatch.Draw(TextureAssets.GlowMask[163].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float)(-TextureAssets.Npc[type].Width()) * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, (float)(-TextureAssets.Npc[type].Height()) * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + rCurrentNPC.gfxOffY) + rCurrentNPC.velocity.RotatedBy((float)num191 * ((float)Math.PI / 2f)) * num190, rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(64, 64, 64, 0), rCurrentNPC.rotation, halfSize + vector59, rCurrentNPC.scale, spriteEffects, 0f);
24196 }
24197 break;
24198 }
24199 case 344:
24200 mySpriteBatch.Draw(TextureAssets.GlowMask[253].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float)(-TextureAssets.Npc[type].Width()) * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, (float)(-TextureAssets.Npc[type].Height()) * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + rCurrentNPC.gfxOffY), rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(200, 200, 200, 100) * 0.5f, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
24201 break;
24202 case 346:
24203 {
24204 float num180 = 4f;
24205 for (int num181 = 0; num181 < 4; num181++)
24206 {
24207 mySpriteBatch.Draw(TextureAssets.GlowMask[254].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float)(-TextureAssets.Npc[type].Width()) * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, (float)(-TextureAssets.Npc[type].Height()) * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + rCurrentNPC.gfxOffY) + Vector2.UnitX.RotatedBy((float)num181 * ((float)Math.PI / 2f)) * num180, rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(64, 64, 64, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
24208 }
24209 mySpriteBatch.Draw(TextureAssets.GlowMask[254].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float)(-TextureAssets.Npc[type].Width()) * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, (float)(-TextureAssets.Npc[type].Height()) * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + rCurrentNPC.gfxOffY), rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(200, 200, 200, 100), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
24210 break;
24211 }
24212 case 315:
24213 {
24214 float num188 = 2f;
24215 for (int num189 = 0; num189 < 4; num189++)
24216 {
24217 mySpriteBatch.Draw(TextureAssets.GlowMask[255].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float)(-TextureAssets.Npc[type].Width()) * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, (float)(-TextureAssets.Npc[type].Height()) * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + rCurrentNPC.gfxOffY) + Vector2.UnitX.RotatedBy((float)num189 * ((float)Math.PI / 2f)) * num188, rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(64, 64, 64, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
24218 }
24219 mySpriteBatch.Draw(TextureAssets.GlowMask[255].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float)(-TextureAssets.Npc[type].Width()) * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, (float)(-TextureAssets.Npc[type].Height()) * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + rCurrentNPC.gfxOffY), rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(200, 200, 200, 200), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
24220 break;
24221 }
24222 case 525:
24223 mySpriteBatch.Draw(TextureAssets.GlowMask[169].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float)(-TextureAssets.Npc[type].Width()) * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, (float)(-TextureAssets.Npc[type].Height()) * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + rCurrentNPC.gfxOffY), rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(200, 200, 200, 100), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
24224 break;
24225 case 526:
24226 mySpriteBatch.Draw(TextureAssets.GlowMask[170].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float)(-TextureAssets.Npc[type].Width()) * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, (float)(-TextureAssets.Npc[type].Height()) * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + rCurrentNPC.gfxOffY), rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(200, 200, 200, 100), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
24227 break;
24228 case 527:
24229 mySpriteBatch.Draw(TextureAssets.GlowMask[171].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float)(-TextureAssets.Npc[type].Width()) * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, (float)(-TextureAssets.Npc[type].Height()) * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + rCurrentNPC.gfxOffY), rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(200, 200, 200, 100), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
24230 break;
24231 case 533:
24232 mySpriteBatch.Draw(TextureAssets.GlowMask[172].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float)(-TextureAssets.Npc[type].Width()) * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, (float)(-TextureAssets.Npc[type].Height()) * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + rCurrentNPC.gfxOffY), rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(255, 255, 255, 100), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
24233 break;
24234 case 160:
24235 {
24236 Texture2D texture2D2 = null;
24237 texture2D2 = ((rCurrentNPC.townNpcVariationIndex != 1) ? TextureAssets.GlowMask[166].Value : TextureAssets.GlowMask[352].Value);
24238 mySpriteBatch.Draw(texture2D2, rCurrentNPC.Bottom - screenPos + new Vector2((float)(-TextureAssets.Npc[type].Width()) * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, (float)(-TextureAssets.Npc[type].Height()) * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + rCurrentNPC.gfxOffY), rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
24239 break;
24240 }
24241 case 209:
24242 {
24243 Texture2D texture2D = null;
24244 texture2D = ((rCurrentNPC.townNpcVariationIndex != 1) ? TextureAssets.GlowMask[167].Value : ((rCurrentNPC.altTexture != 1) ? TextureAssets.GlowMask[350].Value : TextureAssets.GlowMask[351].Value));
24245 mySpriteBatch.Draw(texture2D, rCurrentNPC.Bottom - screenPos + new Vector2((float)(-TextureAssets.Npc[type].Width()) * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, (float)(-TextureAssets.Npc[type].Height()) * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + rCurrentNPC.gfxOffY), rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
24246 break;
24247 }
24248 }
24249 break;
24250 }
24251 }
24252 if (rCurrentNPC.aiStyle == 7)
24253 {
24255 }
24256 break;
24257 }
24258 case 488:
24259 break;
24260 }
24261 break;
24262 }
24263 goto case 426;
24264 case 426:
24265 case 427:
24266 case 428:
24267 case 521:
24268 case 523:
24269 case 541:
24270 case 542:
24271 case 543:
24272 case 544:
24273 case 545:
24274 case 581:
24275 {
24278 float amount10 = 0f;
24279 float amount11 = 0f;
24280 int num270 = 0;
24281 int num271 = 0;
24282 int num272 = 1;
24283 int num273 = 15;
24284 int num274 = 0;
24285 float scale8 = rCurrentNPC.scale;
24286 float value77 = rCurrentNPC.scale;
24287 int num275 = 0;
24288 float num276 = 0f;
24289 float num277 = 0f;
24290 float num278 = 0f;
24293 switch (type)
24294 {
24295 case 558:
24296 case 559:
24297 case 560:
24298 case 574:
24299 case 575:
24300 if (rCurrentNPC.ai[0] != 2f)
24301 {
24302 num270 = 0;
24303 break;
24304 }
24305 num270 = 6;
24306 num271 = 2;
24307 num273 = num270 * 3;
24308 num274 = 1;
24309 break;
24310 case 566:
24311 case 567:
24312 case 578:
24313 num270 = 0;
24314 num36 = -2f;
24315 break;
24316 case 552:
24317 case 553:
24318 case 554:
24319 case 555:
24320 case 556:
24321 case 557:
24322 case 561:
24323 case 562:
24324 case 563:
24325 case 568:
24326 case 569:
24327 case 570:
24328 case 571:
24329 case 572:
24330 case 573:
24331 num270 = 0;
24332 if (type == 561 || type == 562 || type == 563)
24333 {
24334 num36 = -8f;
24335 }
24336 if (type == 555 || type == 556 || type == 557)
24337 {
24338 num36 = -5f;
24339 }
24340 if (type == 572 || type == 573)
24341 {
24342 num36 = -4f;
24343 }
24344 if (type == 570 || type == 571)
24345 {
24346 spriteEffects ^= SpriteEffects.FlipHorizontally;
24347 num36 = -2f;
24348 }
24349 if (type == 568 || type == 569)
24350 {
24351 spriteEffects ^= SpriteEffects.FlipHorizontally;
24352 num36 = -3f;
24353 num275 = 4;
24354 num277 = 4f;
24355 num276 = (float)Math.Cos(GlobalTimeWrappedHourly % 1.5f / 1.5f * ((float)Math.PI * 2f)) / 6f + 0.75f;
24357 color46.A = 127;
24358 amount10 = 0.5f;
24359 }
24360 if (rCurrentNPC.localAI[3] < 60f)
24361 {
24362 float num291 = rCurrentNPC.localAI[3] / 60f;
24363 num275 = 3;
24364 num276 = 1f - num291 * num291;
24365 num277 = 8f;
24366 color46 = new Microsoft.Xna.Framework.Color(127, 0, 255, 0);
24367 amount11 = 1f;
24369 }
24370 break;
24371 case 541:
24372 num275 = 4;
24373 num277 = 6f;
24374 num276 = (float)Math.Cos(GlobalTimeWrappedHourly % 2.4f / 2.4f * ((float)Math.PI * 2f)) / 2f + 0.5f;
24376 amount10 = 0.5f;
24377 break;
24378 case 661:
24379 num275 = 6;
24380 num277 = 6f;
24381 num276 = (float)Math.Cos(GlobalTimeWrappedHourly % 2.4f / 2.4f * ((float)Math.PI * 2f)) / 2f + 0.5f;
24382 num276 = MathHelper.Max(num276, Utils.GetLerpValue(0f, 60f, rCurrentNPC.ai[2], clamped: true));
24383 amount10 = 0.5f;
24384 break;
24385 case 426:
24386 num275 = 4;
24387 num277 = 4f;
24388 num276 = (float)Math.Cos(GlobalTimeWrappedHourly % 1.2f / 1.2f * ((float)Math.PI * 2f)) / 2f + 0.5f;
24390 amount10 = 0.5f;
24391 num270 = 6;
24392 num271 = 2;
24393 num273 = num270;
24394 break;
24395 case 427:
24396 num270 = 8;
24397 num271 = 2;
24398 num273 = num270 * 3;
24399 break;
24400 case 546:
24401 num270 = 8;
24402 num271 = 2;
24403 num273 = num270 * 3;
24404 break;
24405 case 542:
24406 case 543:
24407 case 544:
24408 case 545:
24409 num270 = 6;
24410 num271 = 3;
24411 num273 = num270 * 2;
24412 break;
24413 case 581:
24414 num270 = 6;
24415 num271 = 2;
24416 num273 = num270 * 3;
24417 break;
24418 case 521:
24419 num270 = 10;
24420 num271 = 2;
24421 num273 = num270;
24422 num274 = 1;
24423 value77 = 0.3f;
24424 break;
24425 case 523:
24426 num275 = 3;
24427 num277 = 10f * rCurrentNPC.scale;
24428 amount10 = 0.5f;
24429 amount11 = 0.8f;
24431 color46.A = 128;
24432 num278 = rCurrentNPC.localAI[0];
24433 num276 = rCurrentNPC.localAI[1];
24434 break;
24435 case 620:
24436 num36 = -9f;
24437 origin23 = rCurrentNPC.frame.Size() * new Vector2(0.5f, 0.5f) + new Vector2(-4 * rCurrentNPC.spriteDirection, 0f);
24438 num275 = 4;
24439 num277 = 6f;
24440 num276 = (float)Math.Cos(GlobalTimeWrappedHourly % 2.4f / 2.4f * ((float)Math.PI * 2f)) / 2f + 0.5f;
24442 amount10 = 0.5f;
24443 num270 = 6;
24444 num271 = 2;
24445 num273 = num270 * 3;
24446 num274 = 1;
24447 break;
24448 case 618:
24449 {
24450 float num279 = 90f;
24451 float num280 = 180f;
24452 if (rCurrentNPC.ai[0] == 1f && rCurrentNPC.ai[1] < num279)
24453 {
24454 int num281 = 3;
24455 float num282 = num279 / (float)num281;
24456 float num283 = rCurrentNPC.ai[1] % num282 / num282;
24457 num275 = 6;
24458 num277 = 15f;
24459 num276 = num283 * 0.8f + 0.2f;
24460 }
24461 if (rCurrentNPC.ai[0] == 3f && rCurrentNPC.ai[1] < num280)
24462 {
24463 int num284 = 1;
24464 float num285 = num280 / (float)num284;
24465 float num286 = rCurrentNPC.ai[1] % num285 / num285;
24466 num275 = 4;
24467 num277 = 25f;
24468 num276 = num286;
24469 Vector2 vector69 = rCurrentNPC.scale * new Vector2(1f, 0.5f + num286 * 0.75f);
24472 Vector2 origin24 = rectangle12.Size() * new Vector2(0.5f, 0.5f);
24473 for (int num287 = 0; num287 < num275; num287++)
24474 {
24476 white8 *= Utils.GetLerpValue(0f, 0.5f, num276) * Utils.GetLerpValue(1f, 0.5f, num276) * 0.25f;
24477 white8.A = 0;
24478 white8.G = 0;
24479 white8.B = 0;
24480 float num288 = (float)num287 / (float)num275 * ((float)Math.PI * 2f) + rCurrentNPC.rotation + num278;
24481 Vector2 position30 = rCurrentNPC.Center + num288.ToRotationVector2() * num277 * num276 - screenPos;
24482 position30 -= new Vector2(value76.Width, value76.Height / npcFrameCount[type]) * rCurrentNPC.scale / 2f;
24483 position30 += halfSize * rCurrentNPC.scale + new Vector2(0f, num35 + num36 + rCurrentNPC.gfxOffY);
24485 }
24486 for (int num289 = 0; num289 < num275; num289++)
24487 {
24489 white9 *= Utils.GetLerpValue(0f, 0.5f, num276) * Utils.GetLerpValue(1f, 0.5f, num276) * 0.25f;
24490 white9.A = 0;
24491 float num290 = (float)num289 / (float)num275 * ((float)Math.PI * 2f) + rCurrentNPC.rotation + num278;
24492 Vector2 position31 = rCurrentNPC.Center + num290.ToRotationVector2() * num277 * num276 - screenPos;
24493 position31 -= new Vector2(value76.Width, value76.Height / npcFrameCount[type]) * rCurrentNPC.scale / 2f;
24494 position31 += halfSize * rCurrentNPC.scale + new Vector2(0f, num35 + num36 + rCurrentNPC.gfxOffY);
24496 }
24497 }
24498 break;
24499 }
24500 }
24501 for (int num292 = num272; num292 < num270; num292 += num271)
24502 {
24503 _ = ref rCurrentNPC.oldPos[num292];
24506 value79 = rCurrentNPC.GetAlpha(value79);
24507 value79 *= (float)(num270 - num292) / (float)num273;
24508 _ = rCurrentNPC.rotation;
24509 if (num274 == 1)
24510 {
24511 _ = rCurrentNPC.oldRot[num292];
24512 }
24513 float scale9 = MathHelper.Lerp(scale8, value77, 1f - (float)(num270 - num292) / (float)num273);
24514 Vector2 position32 = rCurrentNPC.oldPos[num292] + new Vector2(rCurrentNPC.width, rCurrentNPC.height) / 2f - screenPos;
24515 position32 -= new Vector2(value76.Width, value76.Height / npcFrameCount[type]) * rCurrentNPC.scale / 2f;
24516 position32 += halfSize * rCurrentNPC.scale + new Vector2(0f, num35 + num36 + rCurrentNPC.gfxOffY);
24518 }
24519 for (int num293 = 0; num293 < num275; num293++)
24520 {
24523 value80 = rCurrentNPC.GetAlpha(value80);
24525 value80 *= 1f - num276;
24526 Vector2 position33 = rCurrentNPC.Center + ((float)num293 / (float)num275 * ((float)Math.PI * 2f) + rCurrentNPC.rotation + num278).ToRotationVector2() * num277 * num276 - screenPos;
24527 position33 -= new Vector2(value76.Width, value76.Height / npcFrameCount[type]) * rCurrentNPC.scale / 2f;
24528 position33 += halfSize * rCurrentNPC.scale + new Vector2(0f, num35 + num36 + rCurrentNPC.gfxOffY);
24530 }
24531 Vector2 vector70 = rCurrentNPC.Center - screenPos;
24532 vector70 -= new Vector2(value76.Width, value76.Height / npcFrameCount[type]) * rCurrentNPC.scale / 2f;
24533 vector70 += halfSize * rCurrentNPC.scale + new Vector2(0f, num35 + num36 + rCurrentNPC.gfxOffY);
24535 switch (type)
24536 {
24537 case 427:
24538 mySpriteBatch.Draw(TextureAssets.GlowMask[152].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float)(-TextureAssets.Npc[type].Width()) * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, (float)(-TextureAssets.Npc[type].Height()) * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + rCurrentNPC.gfxOffY), rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(255 - rCurrentNPC.alpha, 255 - rCurrentNPC.alpha, 255 - rCurrentNPC.alpha, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
24539 break;
24540 case 426:
24541 mySpriteBatch.Draw(TextureAssets.GlowMask[153].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float)(-TextureAssets.Npc[type].Width()) * rCurrentNPC.scale / 2f + halfSize.X * rCurrentNPC.scale, (float)(-TextureAssets.Npc[type].Height()) * rCurrentNPC.scale / (float)npcFrameCount[type] + 4f + halfSize.Y * rCurrentNPC.scale + num36 + rCurrentNPC.gfxOffY), rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
24542 break;
24543 }
24544 if (type == 541)
24545 {
24547 for (int num294 = 0; num294 < num275; num294++)
24548 {
24550 newColor6 = rCurrentNPC.GetAlpha(newColor6);
24551 newColor6 *= 1f - num276;
24552 Vector2 position34 = rCurrentNPC.Center + ((float)num294 / (float)num275 * ((float)Math.PI * 2f) + rCurrentNPC.rotation + num278).ToRotationVector2() * (4f * num276 + 2f) - screenPos;
24553 position34 -= new Vector2(value76.Width, value76.Height / npcFrameCount[type]) * rCurrentNPC.scale / 2f;
24554 position34 += halfSize * rCurrentNPC.scale + new Vector2(0f, num35 + num36 + rCurrentNPC.gfxOffY);
24556 }
24558 }
24559 if (type == 661)
24560 {
24561 num278 = MathHelper.Lerp(0f, 3f, Utils.GetLerpValue(0f, 60f, rCurrentNPC.ai[2], clamped: true));
24562 for (int num295 = 0; num295 < num275; num295++)
24563 {
24564 Microsoft.Xna.Framework.Color newColor7 = new Microsoft.Xna.Framework.Color(127 - rCurrentNPC.alpha, 127 - rCurrentNPC.alpha, 127 - rCurrentNPC.alpha, 0).MultiplyRGBA(hslToRgb((GlobalTimeWrappedHourly + (float)num295 / (float)num275) % 1f, 1f, 0.5f));
24565 newColor7 = rCurrentNPC.GetAlpha(newColor7);
24566 newColor7 *= 1f - num276 * 0.5f;
24567 newColor7.A = 0;
24568 float num296 = 2f + rCurrentNPC.ai[2];
24569 Vector2 position35 = rCurrentNPC.Center + ((float)num295 / (float)num275 * ((float)Math.PI * 2f) + rCurrentNPC.rotation + num278).ToRotationVector2() * (num296 * num276 + 2f) - screenPos;
24570 position35 -= new Vector2(value76.Width, value76.Height / npcFrameCount[type]) * rCurrentNPC.scale / 2f;
24571 position35 += halfSize * rCurrentNPC.scale + new Vector2(0f, num35 + num36 + rCurrentNPC.gfxOffY);
24573 }
24574 mySpriteBatch.Draw(value76, vector70, rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(255, 255, 255, 0) * 0.1f, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
24575 }
24576 if ((type == 568 || type == 569) && rCurrentNPC.localAI[3] >= 60f)
24577 {
24578 Microsoft.Xna.Framework.Color color49 = new Microsoft.Xna.Framework.Color(127 - rCurrentNPC.alpha, 127 - rCurrentNPC.alpha, 127 - rCurrentNPC.alpha, 0).MultiplyRGBA(color46);
24579 for (int num297 = 0; num297 < num275; num297++)
24580 {
24582 newColor8 = rCurrentNPC.GetAlpha(newColor8);
24583 newColor8 *= 1f - num276;
24584 Vector2 position36 = rCurrentNPC.Center + ((float)num297 / (float)num275 * ((float)Math.PI * 2f) + rCurrentNPC.rotation + num278).ToRotationVector2() * (4f * num276 + 2f) - screenPos;
24585 position36 -= new Vector2(value76.Width, value76.Height / npcFrameCount[type]) * rCurrentNPC.scale / 2f;
24586 position36 += halfSize * rCurrentNPC.scale + new Vector2(0f, num35 + num36 + rCurrentNPC.gfxOffY);
24588 }
24590 float num298 = rCurrentNPC.localAI[0];
24591 if (num298 > 0f)
24592 {
24593 byte a = (byte)((Math.Cos(num298 * ((float)Math.PI * 2f) / 60f) * 0.5 + 0.5) * 32.0 + 0.0);
24594 Microsoft.Xna.Framework.Color color50 = new Microsoft.Xna.Framework.Color(180, 90, 255, a) * 0.75f;
24595 float num299 = 1f;
24596 if (num298 < 60f)
24597 {
24598 float lerpValue3 = Utils.GetLerpValue(0f, 60f, num298);
24600 num299 = MathHelper.Lerp(1f, 0.5f, 1f - lerpValue3 * lerpValue3);
24601 }
24603 Vector2 origin25 = value81.Size() / 2f;
24605 float num300 = num298 * 0.0041887905f;
24606 float num301 = (float)Math.PI / 2f;
24607 scale10.Y *= 1f;
24608 scale10.X *= 1f;
24609 for (float num302 = 0f; num302 < 16f; num302 += 1f)
24610 {
24611 float num303 = num300 + (float)Math.PI * 2f * (num302 / 16f);
24612 Vector2 position37 = rCurrentNPC.Center - screenPos + num303.ToRotationVector2() * 400f * num299;
24613 mySpriteBatch.Draw(value81, position37, null, color50, num303 + (float)Math.PI / 2f + num301, origin25, scale10, SpriteEffects.None, 0f);
24614 }
24615 }
24616 }
24617 if (type == 546)
24618 {
24619 mySpriteBatch.Draw(TextureAssets.Extra[76].Value, vector70, rCurrentNPC.frame, new Microsoft.Xna.Framework.Color(255, 255, 255, 200), MathHelper.Clamp(rCurrentNPC.velocity.X * 0.1f, -(float)Math.PI / 8f, (float)Math.PI / 8f), halfSize, rCurrentNPC.scale, spriteEffects, 0f);
24620 }
24621 if ((type == 566 || type == 567) && rCurrentNPC.localAI[3] >= 115f)
24622 {
24623 int frameY = (int)(GlobalTimeWrappedHourly % 0.5f / 0.5f * 4f);
24625 Microsoft.Xna.Framework.Rectangle rectangle13 = value82.Frame(1, 4, 0, frameY);
24626 Vector2 vector71 = new Vector2(rCurrentNPC.spriteDirection * 8, -26f) * rCurrentNPC.scale;
24627 int num304 = rCurrentNPC.frame.Y / rCurrentNPC.frame.Height;
24628 int num305 = 0;
24629 switch (num304)
24630 {
24631 case 0:
24632 num305 = 6;
24633 break;
24634 case 1:
24635 num305 = 4;
24636 break;
24637 case 2:
24638 num305 = 2;
24639 break;
24640 case 3:
24641 num305 = 6;
24642 break;
24643 case 4:
24644 num305 = 8;
24645 break;
24646 case 5:
24647 num305 = 6;
24648 break;
24649 case 6:
24650 num305 = 4;
24651 break;
24652 case 7:
24653 num305 = 6;
24654 break;
24655 case 8:
24656 num305 = 2;
24657 break;
24658 }
24660 vector71.Y += num305;
24661 mySpriteBatch.Draw(value82, vector70 + vector71 * rCurrentNPC.scale, rectangle13, color51, MathHelper.Clamp(rCurrentNPC.velocity.X * 0.1f, -(float)Math.PI / 8f, (float)Math.PI / 8f), rectangle13.Size() / 2f, rCurrentNPC.scale * 0.7f, spriteEffects ^ SpriteEffects.FlipHorizontally, 0f);
24662 }
24663 if (type == 618)
24664 {
24665 mySpriteBatch.Draw(TextureAssets.Extra[129].Value, vector70, rCurrentNPC.frame, rCurrentNPC.GetAlpha(color47), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0f);
24666 }
24667 break;
24668 }
24669 }
24670 }
static readonly BlendState AlphaBlend
Definition BlendState.cs:36
static readonly SamplerState PointWrap
static readonly SamplerState PointClamp
static float Lerp(float value1, float value2, float amount)
Definition MathHelper.cs:53
static float WrapAngle(float angle)
Definition MathHelper.cs:87
static float Max(float value1, float value2)
Definition MathHelper.cs:41
static float Clamp(float value, float min, float max)
Definition MathHelper.cs:46
static double Acos(double d)
static double Cos(double d)
static byte Min(byte val1, byte val2)
Definition Math.cs:912
static double Atan2(double y, double x)
static double Sqrt(double d)
static double Pow(double x, double y)
static double Abs(double value)
static double Sin(double a)
const double PI
Definition Math.cs:16
static Asset< Texture2D > AntLion
static Asset< Texture2D > Chain5
static Asset< Texture2D > ReaperEye
static Asset< Texture2D >[] Npc
static Asset< Texture2D > Ninja
static Asset< Texture2D > Chain4
static Asset< Texture2D > SpikeBase
static Asset< Texture2D > DukeFishron
static Asset< Texture2D >[] Projectile
static Asset< Texture2D > TreeFace
static Asset< Texture2D >[] GlowMask
static Asset< Texture2D > Chain24
static Asset< Texture2D > IceQueen
static Asset< Texture2D > Firefly
static Asset< Texture2D > Chain10
static Asset< Texture2D > PumpkingFace
static Asset< Texture2D > Chain11
static Asset< Texture2D > BoneArm2
static Asset< Texture2D > BoneEyes
static Asset< Texture2D >[] Extra
static Asset< Texture2D > Chain12
static Asset< Texture2D > Confuse
static Asset< Texture2D > BoneArm
static Asset< Texture2D > SantaTank
static Asset< Texture2D > EyeLaser
static Asset< Texture2D > WraithEye
static Asset< Texture2D > Chaos
static Asset< Texture2D > Lightningbug
static Asset< Texture2D > Chain25
static Asset< Texture2D > Chain
static Asset< Texture2D > Chain14
static Asset< Texture2D > PumpkingArm
static Asset< Texture2D >[] Golem
static Asset< Texture2D > BoneLaser
static Asset< Texture2D > PumpkingCloak
static Asset< Texture2D >[] Dest
static Asset< Texture2D > Chain21
static Asset< Texture2D > Probe
static FilterManager Scene
Definition Filters.cs:5
static Dictionary< string, MiscShaderData > Misc
static ArmorShaderDataSet Armor
Definition GameShaders.cs:7
static void DrawNPCDirect_Deerclops(SpriteBatch mySpriteBatch, NPC rCurrentNPC, ref Vector2 screenPos, int typeCache, ref Microsoft.Xna.Framework.Color npcColor, ref Vector2 halfSize, SpriteEffects npcSpriteEffect)
Definition Main.cs:24672
void LoadProjectile(int i)
Definition Main.cs:56041
static int[] npcFrameCount
Definition Main.cs:2002
static void DrawNPC_SlimeItem(NPC rCurrentNPC, int typeCache, Microsoft.Xna.Framework.Color npcColor, float addedRotation)
Definition Main.cs:25171
void LoadNPC(int i)
Definition Main.cs:56032
static void DrawPrettyStarSparkle(float opacity, SpriteEffects dir, Vector2 drawpos, Microsoft.Xna.Framework.Color drawColor, Microsoft.Xna.Framework.Color shineColor, float flareCounter, float fadeInStart, float fadeInEnd, float fadeOutStart, float fadeOutEnd, float rotation, Vector2 scale, Vector2 fatness)
Definition Main.cs:32485
static float essScale
Definition Main.cs:620
static SpriteBatch spriteBatch
Definition Main.cs:974
static Effect pixelShader
Definition Main.cs:2764
static int myPlayer
Definition Main.cs:1801
static Microsoft.Xna.Framework.Color tileColor
Definition Main.cs:1270
static Vector2[] OffsetsPlayerHeadgear
Definition Main.cs:520
static bool expertMode
Definition Main.cs:2737
static Microsoft.Xna.Framework.Color buffColor(Microsoft.Xna.Framework.Color newColor, float R, float G, float B, float A)
Definition Main.cs:34690
static double timeForVisualEffects
Definition Main.cs:1286
static void DrawNPCDirect_HallowBoss(SpriteBatch mySpriteBatch, NPC rCurrentNPC, ref Vector2 screenPos, int typeCache, ref Microsoft.Xna.Framework.Color npcColor, ref Vector2 halfSize, SpriteEffects npcSpriteEffect)
Definition Main.cs:24825
static Vector2 screenPosition
Definition Main.cs:1715
static Matrix Transform
Definition Main.cs:2771
void DrawNPCDirect_QueenSlimeWings(NPC rCurrentNPC, SpriteBatch mySpriteBatch, Vector2 screenPos, Vector2 drawCenter, Microsoft.Xna.Framework.Color originColor)
Definition Main.cs:20963
static byte mouseTextColor
Definition Main.cs:1751
static bool getGoodWorld
Definition Main.cs:341
void DrawElderEye(SpriteBatch spriteBatch, Vector2 worldPosition, float opacity, float scale, int frameNumber, Microsoft.Xna.Framework.Color passedColor)
Definition Main.cs:20800
static SamplerState DefaultSamplerState
Definition Main.cs:2814
static UnifiedRandom rand
Definition Main.cs:1387
static RasterizerState Rasterizer
Definition Main.cs:552
static NPC[] npc
Definition Main.cs:1685
static void DrawNPCDirect_Faeling(SpriteBatch mySpriteBatch, NPC rCurrentNPC, ref Vector2 screenPos, int typeCache, ref Microsoft.Xna.Framework.Color npcColor, ref Vector2 halfSize, SpriteEffects npcSpriteEffect)
Definition Main.cs:24767
static void GetItemDrawFrame(int item, out Texture2D itemTexture, out Microsoft.Xna.Framework.Rectangle itemFrame)
Definition Main.cs:25221
static Microsoft.Xna.Framework.Color hslToRgb(Vector3 hslVector)
Definition Main.cs:44913
void DrawNPCExtras(NPC n, bool beforeDraw, float addHeight, float addY, Microsoft.Xna.Framework.Color npcColor, Vector2 halfSize, SpriteEffects npcSpriteEffect, Vector2 screenPosition)
Definition Main.cs:25235
static float NPCAddHeight(NPC theNPC)
Definition Main.cs:20492
static IAssetRepository Assets
Definition Main.cs:209
static Player[] player
Definition Main.cs:1803
static float GlobalTimeWrappedHourly
Definition Main.cs:405
static Dust[] dust
Definition Main.cs:1677
static Color CornflowerBlue
Definition Color.cs:112
static Color Transparent
Definition Color.cs:76
static Color Lerp(Color value1, Color value2, float amount)
Definition Color.cs:491
static Vector2 Lerp(Vector2 value1, Vector2 value2, float amount)
Definition Vector2.cs:227

References System.Math.Abs(), System.Math.Acos(), Terraria.GameInput.LockOnHelper.AimedTarget, Microsoft.Xna.Framework.Graphics.BlendState.AlphaBlend, Terraria.GameContent.TextureAssets.AntLion, Terraria.Graphics.Shaders.GameShaders.Armor, Terraria.Main.Assets, System.Math.Atan2(), Microsoft.Xna.Framework.Color.Black, Microsoft.Xna.Framework.Color.Blue, Terraria.GameContent.TextureAssets.BoneArm, Terraria.GameContent.TextureAssets.BoneArm2, Terraria.GameContent.TextureAssets.BoneEyes, Terraria.GameContent.TextureAssets.BoneLaser, Terraria.Lighting.Brightness(), Terraria.Main.buffColor(), Terraria.GameContent.TextureAssets.Chain, Terraria.GameContent.TextureAssets.Chain10, Terraria.GameContent.TextureAssets.Chain11, Terraria.GameContent.TextureAssets.Chain12, Terraria.GameContent.TextureAssets.Chain14, Terraria.GameContent.TextureAssets.Chain21, Terraria.GameContent.TextureAssets.Chain24, Terraria.GameContent.TextureAssets.Chain25, Terraria.GameContent.TextureAssets.Chain4, Terraria.GameContent.TextureAssets.Chain5, Terraria.GameContent.TextureAssets.Chaos, Microsoft.Xna.Framework.MathHelper.Clamp(), Terraria.ID.ContentSamples.CommonlyUsedContentSamples.ColorOnlyShaderIndex, Terraria.GameContent.TextureAssets.Confuse, Microsoft.Xna.Framework.Color.CornflowerBlue, System.Math.Cos(), Microsoft.Xna.Framework.Graphics.RasterizerState.CullNone, Microsoft.Xna.Framework.Graphics.DepthStencilState.Default, Terraria.Main.DefaultSamplerState, Terraria.GameContent.TextureAssets.Dest, Terraria.Main.DrawElderEye(), Terraria.Main.DrawNPC_SlimeItem(), Terraria.Main.DrawNPCDirect_Deerclops(), Terraria.Main.DrawNPCDirect_Faeling(), Terraria.Main.DrawNPCDirect_HallowBoss(), Terraria.Main.DrawNPCDirect_QueenSlimeWings(), Terraria.Main.DrawNPCExtras(), Terraria.Main.DrawPrettyStarSparkle(), Terraria.GameContent.TextureAssets.DukeFishron, Terraria.Main.dust, Terraria.Main.essScale, Terraria.Main.expertMode, Terraria.GameContent.TextureAssets.Extra, Terraria.GameContent.TextureAssets.EyeLaser, Terraria.GameContent.TextureAssets.Firefly, Terraria.Lighting.GetColor(), Terraria.Main.getGoodWorld, Terraria.Main.GetItemDrawFrame(), Terraria.Utils.GetLerpValue(), Terraria.Main.GlobalTimeWrappedHourly, Terraria.GameContent.TextureAssets.GlowMask, Microsoft.Xna.Framework.Color.Gold, Terraria.GameContent.TextureAssets.Golem, Terraria.NPC.golemBoss, Microsoft.Xna.Framework.Color.Green, Microsoft.Xna.Framework.Color.HotPink, Terraria.Main.hslToRgb(), System.Text.RegularExpressions.i, Terraria.GameContent.TextureAssets.IceQueen, Terraria.NPC.IsMechQueenUp, System.key, Microsoft.Xna.Framework.Vector2.Length(), Microsoft.Xna.Framework.Color.Lerp(), Microsoft.Xna.Framework.MathHelper.Lerp(), Microsoft.Xna.Framework.Vector2.Lerp(), Terraria.GameContent.TextureAssets.Lightningbug, Microsoft.Xna.Framework.Color.LimeGreen, Terraria.Main.LoadNPC(), Terraria.Main.LoadProjectile(), Microsoft.Xna.Framework.MathHelper.Max(), System.Math.Min(), Terraria.Graphics.Shaders.GameShaders.Misc, Terraria.Main.mouseTextColor, Terraria.Main.myPlayer, Terraria.Dust.NewDust(), Terraria.GameContent.TextureAssets.Ninja, Microsoft.Xna.Framework.Graphics.DepthStencilState.None, Terraria.GameContent.TextureAssets.Npc, Terraria.Main.npc, Terraria.Main.NPCAddHeight(), Terraria.Main.npcFrameCount, Terraria.Main.OffsetsPlayerHeadgear, Microsoft.Xna.Framework.Color.Orange, Microsoft.Xna.Framework.Color.OrangeRed, System.Math.PI, Microsoft.Xna.Framework.Color.Pink, Terraria.Main.pixelShader, Terraria.Main.player, Microsoft.Xna.Framework.Graphics.SamplerState.PointClamp, Microsoft.Xna.Framework.Graphics.SamplerState.PointWrap, System.Math.Pow(), Terraria.GameContent.TextureAssets.Probe, Terraria.GameContent.TextureAssets.Projectile, Terraria.GameContent.TextureAssets.PumpkingArm, Terraria.GameContent.TextureAssets.PumpkingCloak, Terraria.GameContent.TextureAssets.PumpkingFace, Terraria.Main.rand, Terraria.Main.Rasterizer, Terraria.GameContent.TextureAssets.ReaperEye, Microsoft.Xna.Framework.Color.Red, Terraria.Utils.Remap(), Terraria.GameContent.TextureAssets.SantaTank, Terraria.Graphics.Effects.Filters.Scene, Terraria.Main.screenPosition, Terraria.NPC.ShieldStrengthTowerMax, Terraria.NPC.ShieldStrengthTowerNebula, Terraria.NPC.ShieldStrengthTowerSolar, Terraria.NPC.ShieldStrengthTowerStardust, Terraria.NPC.ShieldStrengthTowerVortex, System.Math.Sin(), Terraria.GameContent.TextureAssets.SpikeBase, Terraria.Main.spriteBatch, System.Math.Sqrt(), Terraria.Main.tileColor, Terraria.Main.timeForVisualEffects, Terraria.Main.Transform, Microsoft.Xna.Framework.Color.Transparent, Terraria.GameContent.TextureAssets.TreeFace, Microsoft.Xna.Framework.Color.Turquoise, System.type, Microsoft.Xna.Framework.Vector2.UnitX, Microsoft.Xna.Framework.Vector2.UnitY, System.value, Microsoft.Xna.Framework.Graphics.Vector2, Terraria.Utils.Vector2FromElipse(), Microsoft.Xna.Framework.Graphics.Vector3, Microsoft.Xna.Framework.Color.White, Microsoft.Xna.Framework.Rectangle.Width, Terraria.GameContent.TextureAssets.WraithEye, Microsoft.Xna.Framework.MathHelper.WrapAngle(), Microsoft.Xna.Framework.Point.X, Microsoft.Xna.Framework.Vector2.X, Microsoft.Xna.Framework.Point.Y, Microsoft.Xna.Framework.Color.Yellow, and Microsoft.Xna.Framework.Vector2.Zero.

Referenced by Terraria.Main.DrawNPC().