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

◆ PickNPCEmote()

void Terraria.GameContent.UI.EmoteBubble.PickNPCEmote ( WorldUIAnchor other = null)
inline

Definition at line 468 of file EmoteBubble.cs.

469 {
470 //IL_0015: Unknown result type (might be due to invalid IL or missing references)
471 Player plr = Main.player[Player.FindClosest(((NPC)anchor.entity).Center, 0, 0)];
472 List<int> list = new List<int>();
473 bool flag = false;
474 for (int i = 0; i < 200; i++)
475 {
476 if (Main.npc[i].active && Main.npc[i].boss)
477 {
478 flag = true;
479 }
480 }
481 if (!flag)
482 {
483 if (Main.rand.Next(3) == 0)
484 {
485 ProbeTownNPCs(list);
486 }
487 if (Main.rand.Next(3) == 0)
488 {
489 ProbeEmotions(list);
490 }
491 if (Main.rand.Next(3) == 0)
492 {
493 ProbeBiomes(list, plr);
494 }
495 if (Main.rand.Next(2) == 0)
496 {
497 ProbeCritters(list);
498 }
499 if (Main.rand.Next(2) == 0)
500 {
501 ProbeItems(list, plr);
502 }
503 if (Main.rand.Next(5) == 0)
504 {
505 ProbeBosses(list);
506 }
507 if (Main.rand.Next(2) == 0)
508 {
509 ProbeDebuffs(list, plr);
510 }
511 if (Main.rand.Next(2) == 0)
512 {
513 ProbeEvents(list);
514 }
515 if (Main.rand.Next(2) == 0)
516 {
517 ProbeWeather(list, plr);
518 }
519 ProbeExceptions(list, plr, other);
520 }
521 else
522 {
523 ProbeCombat(list);
524 }
525 if (other == null)
526 {
527 other = new WorldUIAnchor();
528 }
530 if (modPickedEmote == -1)
531 {
532 emote = -1;
533 }
534 else if (modPickedEmote.HasValue)
535 {
536 emote = modPickedEmote.Value;
537 }
538 else if (list.Count > 0)
539 {
540 emote = list[Main.rand.Next(list.Count)];
541 }
542 }
void ProbeEvents(List< int > list)
void ProbeExceptions(List< int > list, Player plr, WorldUIAnchor other)
void ProbeWeather(List< int > list, Player plr)
void ProbeDebuffs(List< int > list, Player plr)
void ProbeItems(List< int > list, Player plr)
void ProbeCritters(List< int > list)
void ProbeTownNPCs(List< int > list)
void ProbeEmotions(List< int > list)
void ProbeCombat(List< int > list)
void ProbeBiomes(List< int > list, Player plr)
void ProbeBosses(List< int > list)
int emote
This is the internal ID of this EmoteBubble.
static ? int PickEmote(NPC npc, Player closestPlayer, List< int > emoteList, WorldUIAnchor anchor)
Definition NPCLoader.cs:870
This serves as the central class from which NPC-related functions are carried out....
Definition NPCLoader.cs:26

References Terraria.GameContent.UI.EmoteBubble.anchor, Terraria.GameContent.UI.EmoteBubble.emote, Terraria.GameContent.UI.WorldUIAnchor.entity, Terraria.Player.FindClosest(), Terraria.Main.npc, Terraria.ModLoader.NPCLoader.PickEmote(), Terraria.Main.player, Terraria.GameContent.UI.EmoteBubble.ProbeBiomes(), Terraria.GameContent.UI.EmoteBubble.ProbeBosses(), Terraria.GameContent.UI.EmoteBubble.ProbeCombat(), Terraria.GameContent.UI.EmoteBubble.ProbeCritters(), Terraria.GameContent.UI.EmoteBubble.ProbeDebuffs(), Terraria.GameContent.UI.EmoteBubble.ProbeEmotions(), Terraria.GameContent.UI.EmoteBubble.ProbeEvents(), Terraria.GameContent.UI.EmoteBubble.ProbeExceptions(), Terraria.GameContent.UI.EmoteBubble.ProbeItems(), Terraria.GameContent.UI.EmoteBubble.ProbeTownNPCs(), Terraria.GameContent.UI.EmoteBubble.ProbeWeather(), and Terraria.Main.rand.

+ Here is the call graph for this function: