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

◆ Collision_LavaCollision()

bool Terraria.NPC.Collision_LavaCollision ( )
inlineprivate

Definition at line 110540 of file NPC.cs.

110541 {
110542 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
110543 bool flag = Collision.LavaCollision(position, width, height);
110544 if (type == 441)
110545 {
110546 flag = false;
110547 }
110548 if (flag)
110549 {
110550 lavaWet = true;
110551 if (!lavaImmune && !dontTakeDamage && Main.netMode != 1 && immune[255] == 0)
110552 {
110553 immune[255] = 30;
110554 if (Main.remixWorld && !friendly)
110555 {
110556 AddBuff(24, 180);
110557 }
110558 else
110559 {
110560 AddBuff(24, 420);
110561 StrikeNPCNoInteraction(50, 0f, 0);
110562 if (Main.netMode == 2)
110563 {
110564 NetMessage.SendData(28, -1, -1, null, whoAmI, 50f);
110565 }
110566 }
110567 }
110568 }
110569 return flag;
110570 }
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
int height
The height of this Entity's hitbox, in pixels.
Definition Entity.cs:51
int[] immune
This determines if an NPC can be hit by a item or projectile owned by a particular player (it is an a...
Definition NPC.cs:981
bool dontTakeDamage
Definition NPC.cs:1160
bool friendly
Indicates that an NPC is friendly to players. If true, a player won't damage the NPC and the NPC won'...
Definition NPC.cs:1197
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
bool lavaImmune
Definition NPC.cs:1151
int StrikeNPCNoInteraction(int Damage, float knockBack, int hitDirection)
Definition NPC.cs:91674
void AddBuff(int type, int time, bool quiet=false)
Gives this NPC the provided buff. This accounts for if the NPC is immune to the buff....
Definition NPC.cs:106688

References Terraria.Collision.LavaCollision(), Terraria.Main.netMode, Terraria.Main.remixWorld, and Terraria.NetMessage.SendData().

+ Here is the call graph for this function: