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

◆ CheckForNPCsToReactToEmoteBubble()

static void Terraria.GameContent.UI.EmoteBubble.CheckForNPCsToReactToEmoteBubble ( int emoteID,
Player player )
inlinestatic

Definition at line 150 of file EmoteBubble.cs.

151 {
152 for (int i = 0; i < 200; i++)
153 {
154 NPC nPC = Main.npc[i];
155 if (nPC != null && nPC.active && nPC.aiStyle == 7 && nPC.townNPC && !(nPC.ai[0] >= 2f) && ((player.CanBeTalkedTo && player.Distance(nPC.Center) < 200f) || !Collision.CanHitLine(nPC.Top, 0, 0, player.Top, 0, 0)))
156 {
157 int direction = (nPC.position.X < player.position.X).ToDirectionInt();
158 nPC.ai[0] = 19f;
159 nPC.ai[1] = 220f;
160 nPC.ai[2] = player.whoAmI;
161 nPC.direction = direction;
162 nPC.netUpdate = true;
163 }
164 }
165 }

References Terraria.Player.CanBeTalkedTo, Terraria.Collision.CanHitLine(), Terraria.Entity.Distance(), Terraria.Main.npc, Terraria.Entity.position, Terraria.Entity.Top, Terraria.Entity.whoAmI, and Microsoft.Xna.Framework.Vector2.X.

Referenced by Terraria.MessageBuffer.GetData(), Terraria.GameContent.UI.EmoteBubble.MakeLocalPlayerEmote(), Terraria.Chat.Commands.EmojiCommand.ProcessOutgoingMessage(), and Terraria.Chat.Commands.RockPaperScissorsCommand.ProcessOutgoingMessage().