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

◆ GetBossHeadTextureIndex()

int Terraria.NPC.GetBossHeadTextureIndex ( )
inline

Definition at line 2519 of file NPC.cs.

2520 {
2522 switch (type)
2523 {
2524 case 4:
2525 if (ai[0] >= 2f)
2526 {
2527 result = 1;
2528 }
2529 break;
2530 case 266:
2531 if (ai[0] < 0f)
2532 {
2533 result = -1;
2534 }
2535 break;
2536 case 262:
2537 if (life <= lifeMax / 2)
2538 {
2539 result = 12;
2540 }
2541 break;
2542 case 125:
2543 if (ai[0] >= 3f)
2544 {
2545 result = 16;
2546 }
2547 break;
2548 case 126:
2549 if (ai[0] >= 3f)
2550 {
2551 result = 21;
2552 }
2553 break;
2554 case 439:
2555 if (ai[0] == 5f && alpha == 255)
2556 {
2557 result = -1;
2558 }
2559 break;
2560 case 440:
2561 if (ai[0] != 5f || alpha == 255)
2562 {
2563 result = -1;
2564 }
2565 break;
2566 }
2568 return result;
2569 }
static int[] BossHeadTextures
Associates an NPC type (F:Terraria.NPC.type) with the index in F:Terraria.GameContent....
Definition NPCID.cs:562
static void BossHeadSlot(NPC npc, ref int index)
This serves as the central class from which NPC-related functions are carried out....
Definition NPCLoader.cs:26
int lifeMax
The maximum life of this NPC.
Definition NPC.cs:1077
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
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
int alpha
0 is opaque, and 255 is transparent. Note that this is the opposite of how alpha is typically express...
Definition NPC.cs:1092
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

References Terraria.NPC.ai, Terraria.NPC.alpha, Terraria.ModLoader.NPCLoader.BossHeadSlot(), Terraria.ID.NPCID.Sets.BossHeadTextures, Terraria.NPC.life, Terraria.NPC.lifeMax, and Terraria.NPC.type.

+ Here is the call graph for this function: