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

◆ UpdateNPC_TeleportVisuals()

void Terraria.NPC.UpdateNPC_TeleportVisuals ( )
inlineprivate

Definition at line 109215 of file NPC.cs.

109216 {
109217 //IL_003e: Unknown result type (might be due to invalid IL or missing references)
109218 //IL_004a: Unknown result type (might be due to invalid IL or missing references)
109219 //IL_0055: Unknown result type (might be due to invalid IL or missing references)
109220 //IL_005b: Unknown result type (might be due to invalid IL or missing references)
109221 //IL_0066: Unknown result type (might be due to invalid IL or missing references)
109222 //IL_0082: Unknown result type (might be due to invalid IL or missing references)
109223 //IL_0088: Unknown result type (might be due to invalid IL or missing references)
109224 //IL_00c1: Unknown result type (might be due to invalid IL or missing references)
109225 //IL_00cb: Unknown result type (might be due to invalid IL or missing references)
109226 //IL_00d0: Unknown result type (might be due to invalid IL or missing references)
109227 //IL_011c: Unknown result type (might be due to invalid IL or missing references)
109228 //IL_013f: Unknown result type (might be due to invalid IL or missing references)
109229 //IL_0145: Unknown result type (might be due to invalid IL or missing references)
109230 //IL_0158: Unknown result type (might be due to invalid IL or missing references)
109231 //IL_015d: Unknown result type (might be due to invalid IL or missing references)
109232 //IL_01cd: Unknown result type (might be due to invalid IL or missing references)
109233 //IL_01f0: Unknown result type (might be due to invalid IL or missing references)
109234 //IL_01f6: Unknown result type (might be due to invalid IL or missing references)
109235 //IL_0224: Unknown result type (might be due to invalid IL or missing references)
109236 //IL_0229: Unknown result type (might be due to invalid IL or missing references)
109237 if (!(teleportTime > 0f))
109238 {
109239 return;
109240 }
109241 if (teleportStyle == 0)
109242 {
109243 if ((float)Main.rand.Next(100) <= 100f * teleportTime * 2f)
109244 {
109245 int num = Dust.NewDust(new Vector2((float)getRect().X, (float)getRect().Y), getRect().Width, getRect().Height, 159);
109246 Main.dust[num].scale = teleportTime * 1.5f;
109247 Main.dust[num].noGravity = true;
109248 Dust obj = Main.dust[num];
109249 obj.velocity *= 1.1f;
109250 }
109251 }
109252 else if (teleportStyle == 4)
109253 {
109254 teleportTime -= 0.02f;
109255 if ((float)Main.rand.Next(100) <= 100f * teleportTime)
109256 {
109257 Dust obj2 = Main.dust[Dust.NewDust(position, width, height, 263)];
109259 obj2.noLight = true;
109260 obj2.noGravity = true;
109261 obj2.scale = 1.2f;
109262 obj2.fadeIn = 0.4f;
109263 }
109264 }
109265 else if (teleportStyle == 12)
109266 {
109267 teleportTime -= 0.02f;
109268 if ((float)Main.rand.Next(100) <= 100f * teleportTime)
109269 {
109270 Dust obj3 = Main.dust[Dust.NewDust(position, width, height, 263)];
109271 obj3.color = Main.hslToRgb((float)(Main.timeForVisualEffects / 60.0) % 1f, 1f, 0.75f, 0);
109272 obj3.noLight = true;
109273 obj3.noGravity = true;
109274 obj3.scale = 1.2f;
109275 obj3.fadeIn = 0.4f;
109276 }
109277 }
109278 else if (teleportStyle == 13)
109279 {
109280 teleportTime = 0f;
109281 }
109282 teleportTime = Math.Max(0f, teleportTime - 0.005f);
109283 }
Vector2 position
The position of this Entity in world coordinates.
Definition Entity.cs:28
int width
The width of this Entity's hitbox, in pixels.
Definition Entity.cs:46
int height
The height of this Entity's hitbox, in pixels.
Definition Entity.cs:51
static Color GetPortalColor(int colorIndex)
Rectangle getRect()
Definition NPC.cs:106798
int lastPortalColorIndex
Definition NPC.cs:1215
int teleportStyle
Definition NPC.cs:458
float teleportTime
Definition NPC.cs:460

References Terraria.Main.dust, Terraria.GameContent.PortalHelper.GetPortalColor(), Terraria.Main.hslToRgb(), Terraria.Dust.NewDust(), Terraria.Main.rand, and Terraria.Main.timeForVisualEffects.

+ Here is the call graph for this function: