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

◆ PostUpdate()

override void Terraria.ModLoader.Default.Patreon.OrianSetEffectPlayer.PostUpdate ( )
inlinevirtual

This is called at the very end of the Player.Update method. Final general update tasks can be placed here.

Reimplemented from Terraria.ModLoader.ModPlayer.

Definition at line 17 of file OrianSetEffectPlayer.cs.

18 {
19 //IL_0021: Unknown result type (might be due to invalid IL or missing references)
20 //IL_0026: Unknown result type (might be due to invalid IL or missing references)
21 //IL_00f5: Unknown result type (might be due to invalid IL or missing references)
22 //IL_00f6: Unknown result type (might be due to invalid IL or missing references)
23 //IL_00fb: Unknown result type (might be due to invalid IL or missing references)
24 //IL_00ff: Unknown result type (might be due to invalid IL or missing references)
25 //IL_0105: Unknown result type (might be due to invalid IL or missing references)
26 //IL_010c: Unknown result type (might be due to invalid IL or missing references)
27 //IL_0116: Unknown result type (might be due to invalid IL or missing references)
28 //IL_008c: Unknown result type (might be due to invalid IL or missing references)
29 if (!IsActive)
30 {
31 return;
32 }
33 Player player = base.Player;
34 Vector2 playerCenter = player.Center;
35 Main.npc.Any((NPC x) => x != Main.npc[Main.maxNPCs] && x.active && !x.friendly && !NPCID.Sets.TownCritter[x.type] && x.type != 488 && x.WithinRange(player.position, 300f));
36 float maxIntensity = 0f;
37 for (int i = 0; i < Main.maxNPCs; i++)
38 {
39 NPC npc = Main.npc[i];
40 if (npc.active && npc.damage > 0 && !npc.friendly && !NPCID.Sets.TownCritter[npc.type] && npc.type != 488)
41 {
42 float distanceSquared = npc.DistanceSQ(playerCenter);
43 float intensity = 1f - MathF.Min(1f, distanceSquared / 262144f);
46 }
47 }
48 if (maxIntensity > 0f)
49 {
50 float pulse = MathF.Sin((float)Main.GameUpdateCount / 17f) * 0.25f + 0.75f;
51 Color deepSkyBlue = Color.DeepSkyBlue;
52 Lighting.AddLight(playerCenter, ((Color)(ref deepSkyBlue)).ToVector3() * maxIntensity * pulse * 1.5f);
53 }
54 }
static bool[] TownCritter
If true for a given NPC type (F:Terraria.NPC.type), then that NPC is a critter that can spawn in town...
Definition NPCID.cs:409
Player Player
The Player instance that this ModPlayer instance is attached to.
Definition ModPlayer.cs:29

References Terraria.Entity.active, Terraria.Lighting.AddLight(), Terraria.Entity.Center, Terraria.NPC.damage, Terraria.Entity.DistanceSQ(), Terraria.NPC.friendly, Terraria.Main.GameUpdateCount, Terraria.ModLoader.Default.Patreon.OrianSetEffectPlayer.IsActive, Terraria.Main.maxNPCs, Terraria.Main.npc, Terraria.Entity.position, Terraria.ID.NPCID.Sets.TownCritter, Terraria.NPC.type, and Terraria.Entity.WithinRange().

+ Here is the call graph for this function: