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

◆ GetShimmered()

void Terraria.NPC.GetShimmered ( )
inlineprivate

Definition at line 108508 of file NPC.cs.

108509 {
108510 //IL_0029: Unknown result type (might be due to invalid IL or missing references)
108511 //IL_0036: Unknown result type (might be due to invalid IL or missing references)
108512 //IL_0013: Unknown result type (might be due to invalid IL or missing references)
108513 //IL_019e: Unknown result type (might be due to invalid IL or missing references)
108514 //IL_01a8: Unknown result type (might be due to invalid IL or missing references)
108515 //IL_01ad: Unknown result type (might be due to invalid IL or missing references)
108516 //IL_00d6: Unknown result type (might be due to invalid IL or missing references)
108517 //IL_00e3: Unknown result type (might be due to invalid IL or missing references)
108518 //IL_00c1: Unknown result type (might be due to invalid IL or missing references)
108519 //IL_0201: Unknown result type (might be due to invalid IL or missing references)
108520 //IL_020e: Unknown result type (might be due to invalid IL or missing references)
108521 //IL_01eb: Unknown result type (might be due to invalid IL or missing references)
108522 if (SpawnedFromStatue)
108523 {
108524 if (Main.netMode == 0)
108525 {
108526 Item.ShimmerEffect(base.Center);
108527 }
108528 else
108529 {
108530 NetMessage.SendData(146, -1, -1, null, 0, (int)base.Center.X, (int)base.Center.Y);
108531 }
108532 noSpawnCycle = true;
108533 active = false;
108534 if (Main.netMode == 2)
108535 {
108536 netSkip = -1;
108537 life = 0;
108538 NetMessage.SendData(23, -1, -1, null, whoAmI);
108539 }
108540 }
108541 else if (NPCID.Sets.ShimmerTransformToNPC[type] >= 0)
108542 {
108544 if (Main.netMode == 0)
108545 {
108546 Item.ShimmerEffect(base.Center);
108547 }
108548 else
108549 {
108550 NetMessage.SendData(146, -1, -1, null, 0, (int)base.Center.X, (int)base.Center.Y);
108551 }
108552 }
108553 else if (NPCID.Sets.ShimmerTransformToItem[type] >= 0)
108554 {
108555 int num = Item.NewItem(GetItemSource_Misc(8), (int)position.X, (int)position.Y, width, height, NPCID.Sets.ShimmerTransformToItem[type]);
108556 Main.item[num].stack = 1;
108557 Main.item[num].shimmerTime = 1f;
108558 Main.item[num].shimmered = true;
108559 Main.item[num].shimmerWet = true;
108560 Main.item[num].wet = true;
108561 Item obj = Main.item[num];
108562 obj.velocity *= 0.1f;
108563 Main.item[num].playerIndexTheItemIsReservedFor = Main.myPlayer;
108564 NetMessage.SendData(145, -1, -1, null, num, 1f);
108565 if (Main.netMode == 0)
108566 {
108567 Item.ShimmerEffect(base.Center);
108568 }
108569 else
108570 {
108571 NetMessage.SendData(146, -1, -1, null, 0, (int)base.Center.X, (int)base.Center.Y);
108572 }
108573 noSpawnCycle = true;
108574 active = false;
108575 if (Main.netMode == 2)
108576 {
108577 netSkip = -1;
108578 life = 0;
108579 NetMessage.SendData(23, -1, -1, null, whoAmI);
108580 }
108581 }
108583 {
108584 ai[0] = 25f;
108585 ai[1] = 0f;
108586 ai[2] = 0f;
108587 ai[3] = 0f;
108588 netUpdate = true;
108589 shimmerTransparency = 0.89f;
108590 int num2 = FindBuffIndex(353);
108591 if (num2 != -1)
108592 {
108593 DelBuff(num2);
108594 }
108595 }
108596 }
int whoAmI
The index of this Entity within its specific array. These arrays track the entities in the world....
Definition Entity.cs:16
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
bool active
If true, the Entity actually exists within the game world. Within the specific entity array,...
Definition Entity.cs:21
int height
The height of this Entity's hitbox, in pixels.
Definition Entity.cs:51
static int[] ShimmerTransformToNPC
Associates an NPC type (F:Terraria.NPC.type) with the NPC type it will turn into when submerged in sh...
Definition NPCID.cs:490
static int[] ShimmerTransformToItem
If not -1 for a given NPC type (F:Terraria.NPC.type), then that NPC will transform into the retrieved...
Definition NPCID.cs:476
static bool[] ShimmerTownTransform
If true for a given NPC type (F:Terraria.NPC.type), then that NPC is a town NPC with an alternate shi...
Definition NPCID.cs:482
int FindBuffIndex(int type)
Definition NPC.cs:106664
static bool noSpawnCycle
Definition NPC.cs:635
float[] ai
An array with 4 slots used for any sort of data storage, which is occasionally synced from the server...
Definition NPC.cs:997
bool SpawnedFromStatue
Definition NPC.cs:484
int type
The NPC ID of this NPC. The NPC ID is a unique number assigned to each NPC loaded into the game....
Definition NPC.cs:990
void DelBuff(int buffIndex)
Removes the buff at the provided index and shuffles the remaining buff indexes down to fill the gap....
Definition NPC.cs:106775
float shimmerTransparency
Definition NPC.cs:643
IEntitySource GetItemSource_Misc(int itemSourceId)
Definition NPC.cs:107548
void Transform(int newType)
Definition NPC.cs:91590
int life
The current life of the NPC. Automatically set to the value of F:Terraria.NPC.lifeMax at the end of S...
Definition NPC.cs:1072
bool netUpdate
Definition NPC.cs:1130
int netSkip
Definition NPC.cs:594

References Terraria.Main.item, Terraria.Main.myPlayer, Terraria.Main.netMode, Terraria.Item.NewItem(), Terraria.NetMessage.SendData(), Terraria.Item.ShimmerEffect(), Terraria.ID.NPCID.Sets.ShimmerTownTransform, Terraria.ID.NPCID.Sets.ShimmerTransformToItem, and Terraria.ID.NPCID.Sets.ShimmerTransformToNPC.

Referenced by Terraria.NPC.VanillaAI_Inner().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: