Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
EmoteBubble.cs
Go to the documentation of this file.
1using System;
6using Terraria.ID;
7
9
10public class EmoteBubble
11{
12 private static int[] CountNPCs = new int[NPCID.Count];
13
15
16 private static List<int> toClean = new List<int>();
17
18 public static int NextID;
19
20 public int ID;
21
23
24 public int lifeTime;
25
26 public int lifeTimeStart;
27
28 public int emote;
29
30 public int metadata;
31
32 private const int frameSpeed = 8;
33
34 public int frameCounter;
35
36 public int frame;
37
38 public const int EMOTE_SHEET_HORIZONTAL_FRAMES = 8;
39
40 public const int EMOTE_SHEET_EMOTES_PER_ROW = 4;
41
42 public static readonly int EMOTE_SHEET_VERTICAL_FRAMES = 2 + (EmoteID.Count - 1) / 4;
43
44 public static void UpdateAll()
45 {
46 lock (byID)
47 {
48 toClean.Clear();
50 {
51 item.Value.Update();
52 if (item.Value.lifeTime <= 0)
53 {
54 toClean.Add(item.Key);
55 }
56 }
57 foreach (int item2 in toClean)
58 {
59 byID.Remove(item2);
60 }
61 toClean.Clear();
62 }
63 }
64
65 public static void DrawAll(SpriteBatch sb)
66 {
67 lock (byID)
68 {
70 {
71 item.Value.Draw(sb);
72 }
73 }
74 }
75
77 {
78 if (anch.type == WorldUIAnchor.AnchorType.Entity)
79 {
80 int item = 0;
81 if (anch.entity is NPC)
82 {
83 item = 0;
84 }
85 else if (anch.entity is Player)
86 {
87 item = 1;
88 }
89 else if (anch.entity is Projectile)
90 {
91 item = 2;
92 }
93 return Tuple.Create(item, anch.entity.whoAmI);
94 }
95 return Tuple.Create(0, 0);
96 }
97
99 {
100 return type switch
101 {
102 0 => new WorldUIAnchor(Main.npc[meta]),
103 1 => new WorldUIAnchor(Main.player[meta]),
104 2 => new WorldUIAnchor(Main.projectile[meta]),
105 _ => throw new Exception("How did you end up getting this?"),
106 };
107 }
108
109 public static int AssignNewID()
110 {
111 return NextID++;
112 }
113
114 public static int NewBubble(int emoticon, WorldUIAnchor bubbleAnchor, int time)
115 {
116 if (Main.netMode == 1)
117 {
118 return -1;
119 }
121 emoteBubble.ID = AssignNewID();
123 if (Main.netMode == 2)
124 {
126 NetMessage.SendData(91, -1, -1, null, emoteBubble.ID, tuple.Item1, tuple.Item2, time, emoticon);
127 }
129 return emoteBubble.ID;
130 }
131
132 public static int NewBubbleNPC(WorldUIAnchor bubbleAnchor, int time, WorldUIAnchor other = null)
133 {
134 if (Main.netMode == 1)
135 {
136 return -1;
137 }
139 emoteBubble.ID = AssignNewID();
141 emoteBubble.PickNPCEmote(other);
142 if (Main.netMode == 2)
143 {
145 NetMessage.SendData(91, -1, -1, null, emoteBubble.ID, tuple.Item1, tuple.Item2, time, emoteBubble.emote, emoteBubble.metadata);
146 }
147 return emoteBubble.ID;
148 }
149
150 public static void CheckForNPCsToReactToEmoteBubble(int emoteID, Player player)
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 }
166
167 public EmoteBubble(int emotion, WorldUIAnchor bubbleAnchor, int time = 180)
168 {
170 emote = emotion;
171 lifeTime = time;
172 lifeTimeStart = time;
173 }
174
175 private void Update()
176 {
177 if (--lifeTime > 0 && ++frameCounter >= 8)
178 {
179 frameCounter = 0;
180 if (++frame >= 2)
181 {
182 frame = 0;
183 }
184 }
185 }
186
187 private void Draw(SpriteBatch sb)
188 {
190 SpriteEffects effect = SpriteEffects.None;
191 Vector2 position = GetPosition(out effect);
192 position = position.Floor();
193 bool flag = lifeTime < 6 || lifeTimeStart - lifeTime < 6;
194 Rectangle value2 = value.Frame(8, EMOTE_SHEET_VERTICAL_FRAMES, (!flag) ? 1 : 0);
195 Vector2 origin = new Vector2(value2.Width / 2, value2.Height);
196 if (Main.player[Main.myPlayer].gravDir == -1f)
197 {
198 origin.Y = 0f;
199 effect |= SpriteEffects.FlipVertically;
200 position = Main.ReverseGravitySupport(position);
201 }
202 sb.Draw(value, position, value2, Color.White, 0f, origin, 1f, effect, 0f);
203 if (flag)
204 {
205 return;
206 }
207 if (emote >= 0)
208 {
209 if ((emote == 87 || emote == 89) && effect.HasFlag(SpriteEffects.FlipHorizontally))
210 {
211 effect &= ~SpriteEffects.FlipHorizontally;
212 position.X += 4f;
213 }
214 sb.Draw(value, position, value.Frame(8, EMOTE_SHEET_VERTICAL_FRAMES, emote * 2 % 8 + frame, 1 + emote / 4), Color.White, 0f, origin, 1f, effect, 0f);
215 }
216 else if (emote == -1)
217 {
219 float num = 1f;
220 if ((float)value.Width / 22f > 1f)
221 {
222 num = 22f / (float)value.Width;
223 }
224 if ((float)value.Height / 16f > 1f / num)
225 {
226 num = 16f / (float)value.Height;
227 }
228 sb.Draw(value, position + new Vector2(effect.HasFlag(SpriteEffects.FlipHorizontally) ? 1 : (-1), -value2.Height + 3), null, Color.White, 0f, new Vector2(value.Width / 2, 0f), num, effect, 0f);
229 }
230 }
231
233 {
234 switch (anchor.type)
235 {
236 case WorldUIAnchor.AnchorType.Entity:
237 effect = ((anchor.entity.direction != -1) ? SpriteEffects.FlipHorizontally : SpriteEffects.None);
239 case WorldUIAnchor.AnchorType.Pos:
240 effect = SpriteEffects.None;
241 return anchor.pos - Main.screenPosition;
242 case WorldUIAnchor.AnchorType.Tile:
243 effect = SpriteEffects.None;
244 return anchor.pos - Main.screenPosition + new Vector2(0f, (0f - anchor.size.Y) / 2f);
245 default:
246 effect = SpriteEffects.None;
247 return new Vector2(Main.screenWidth, Main.screenHeight) / 2f;
248 }
249 }
250
251 public static void OnBubbleChange(int bubbleID)
252 {
254 if (emoteBubble.anchor.type != 0 || !(emoteBubble.anchor.entity is Player player))
255 {
256 return;
257 }
258 foreach (EmoteBubble value in byID.Values)
259 {
260 if (value.anchor.type == WorldUIAnchor.AnchorType.Entity && value.anchor.entity == player && value.ID != bubbleID)
261 {
262 value.lifeTime = 6;
263 }
264 }
265 }
266
267 public static void MakeLocalPlayerEmote(int emoteId)
268 {
269 if (Main.netMode == 0)
270 {
273 }
274 else
275 {
276 NetMessage.SendData(120, -1, -1, null, Main.myPlayer, emoteId);
277 }
278 }
279
280 public void PickNPCEmote(WorldUIAnchor other = null)
281 {
282 Player plr = Main.player[Player.FindClosest(((NPC)anchor.entity).Center, 0, 0)];
283 List<int> list = new List<int>();
284 bool flag = false;
285 for (int i = 0; i < 200; i++)
286 {
287 if (Main.npc[i].active && Main.npc[i].boss)
288 {
289 flag = true;
290 }
291 }
292 if (!flag)
293 {
294 if (Main.rand.Next(3) == 0)
295 {
297 }
298 if (Main.rand.Next(3) == 0)
299 {
301 }
302 if (Main.rand.Next(3) == 0)
303 {
305 }
306 if (Main.rand.Next(2) == 0)
307 {
309 }
310 if (Main.rand.Next(2) == 0)
311 {
313 }
314 if (Main.rand.Next(5) == 0)
315 {
317 }
318 if (Main.rand.Next(2) == 0)
319 {
321 }
322 if (Main.rand.Next(2) == 0)
323 {
325 }
326 if (Main.rand.Next(2) == 0)
327 {
329 }
331 }
332 else
333 {
335 }
336 if (list.Count > 0)
337 {
338 emote = list[Main.rand.Next(list.Count)];
339 }
340 }
341
343 {
344 list.Add(16);
345 list.Add(1);
346 list.Add(2);
347 list.Add(91);
348 list.Add(93);
349 list.Add(84);
350 list.Add(84);
351 }
352
354 {
355 if (Main.cloudBGActive > 0f)
356 {
357 list.Add(96);
358 }
359 if (Main.cloudAlpha > 0f)
360 {
361 if (!Main.dayTime)
362 {
363 list.Add(5);
364 }
365 list.Add(4);
366 if (plr.ZoneSnow)
367 {
368 list.Add(98);
369 }
370 if (plr.position.X < 4000f || (plr.position.X > (float)(Main.maxTilesX * 16 - 4000) && (double)plr.position.Y < Main.worldSurface / 16.0))
371 {
372 list.Add(97);
373 }
374 }
375 else
376 {
377 list.Add(95);
378 }
379 if (plr.ZoneHallow)
380 {
381 list.Add(6);
382 }
383 }
384
386 {
387 if (BirthdayParty.PartyIsUp && Main.rand.Next(3) == 0)
388 {
389 list.Add(Utils.SelectRandom<int>(Main.rand, 127, 128, 129, 126));
390 }
391 if (Main.bloodMoon || (!Main.dayTime && Main.rand.Next(4) == 0))
392 {
393 list.Add(18);
394 }
395 if (Main.eclipse || (Main.hardMode && Main.rand.Next(4) == 0))
396 {
397 list.Add(19);
398 }
400 {
401 list.Add(99);
402 }
404 {
405 list.Add(20);
406 }
408 {
409 list.Add(21);
410 }
412 {
413 list.Add(133);
414 }
415 }
416
418 {
419 if (plr.Center.Y > (float)(Main.maxTilesY * 16 - 3200) || plr.onFire || ((NPC)anchor.entity).onFire || plr.onFire2)
420 {
421 list.Add(9);
422 }
423 if (Main.rand.Next(2) == 0)
424 {
425 list.Add(11);
426 }
427 if (plr.poisoned || ((NPC)anchor.entity).poisoned || plr.ZoneJungle)
428 {
429 list.Add(8);
430 }
431 if (plr.inventory[plr.selectedItem].type == 215 || Main.rand.Next(3) == 0)
432 {
433 list.Add(10);
434 }
435 }
436
438 {
439 list.Add(7);
440 list.Add(73);
441 list.Add(74);
442 list.Add(75);
443 list.Add(78);
444 list.Add(90);
445 if (plr.statLife < plr.statLifeMax2 / 2)
446 {
447 list.Add(84);
448 }
449 }
450
452 {
453 for (int i = 0; i < NPCID.Count; i++)
454 {
455 CountNPCs[i] = 0;
456 }
457 for (int j = 0; j < 200; j++)
458 {
459 if (Main.npc[j].active)
460 {
461 CountNPCs[Main.npc[j].type]++;
462 }
463 }
464 int type = ((NPC)anchor.entity).type;
465 for (int k = 0; k < NPCID.Count; k++)
466 {
467 if (NPCID.Sets.FaceEmote[k] > 0 && CountNPCs[k] > 0 && k != type)
468 {
469 list.Add(NPCID.Sets.FaceEmote[k]);
470 }
471 }
472 }
473
475 {
476 if ((double)(plr.position.Y / 16f) < Main.worldSurface * 0.45)
477 {
478 list.Add(22);
479 }
480 else if ((double)(plr.position.Y / 16f) > Main.rockLayer + (double)(Main.maxTilesY / 2) - 100.0)
481 {
482 list.Add(31);
483 }
484 else if ((double)(plr.position.Y / 16f) > Main.rockLayer)
485 {
486 list.Add(30);
487 }
488 else if (plr.ZoneHallow)
489 {
490 list.Add(27);
491 }
492 else if (plr.ZoneCorrupt)
493 {
494 list.Add(26);
495 }
496 else if (plr.ZoneCrimson)
497 {
498 list.Add(25);
499 }
500 else if (plr.ZoneJungle)
501 {
502 list.Add(24);
503 }
504 else if (plr.ZoneSnow)
505 {
506 list.Add(32);
507 }
508 else if ((double)(plr.position.Y / 16f) < Main.worldSurface && (plr.position.X < 4000f || plr.position.X > (float)(16 * (Main.maxTilesX - 250))))
509 {
510 list.Add(29);
511 }
512 else if (plr.ZoneDesert)
513 {
514 list.Add(28);
515 }
516 else
517 {
518 list.Add(23);
519 }
520 }
521
523 {
525 float num = 1f;
526 float num2 = 1f;
527 if ((double)center.Y < Main.rockLayer * 16.0)
528 {
529 num2 = 0.2f;
530 }
531 else
532 {
533 num = 0.2f;
534 }
535 if (Main.rand.NextFloat() <= num)
536 {
537 if (Main.dayTime)
538 {
539 list.Add(13);
540 list.Add(12);
541 list.Add(68);
542 list.Add(62);
543 list.Add(63);
544 list.Add(69);
545 list.Add(70);
546 }
547 if (!Main.dayTime || (Main.dayTime && (Main.time < 5400.0 || Main.time > 48600.0)))
548 {
549 list.Add(61);
550 }
551 if (NPC.downedGoblins)
552 {
553 list.Add(64);
554 }
555 if (NPC.downedFrost)
556 {
557 list.Add(66);
558 }
559 if (NPC.downedPirates)
560 {
561 list.Add(65);
562 }
564 {
565 list.Add(71);
566 }
567 if (WorldGen.crimson)
568 {
569 list.Add(67);
570 }
571 }
572 if (Main.rand.NextFloat() <= num2)
573 {
574 list.Add(72);
575 list.Add(69);
576 }
577 }
578
580 {
581 list.Add(0);
582 list.Add(1);
583 list.Add(2);
584 list.Add(3);
585 list.Add(15);
586 list.Add(16);
587 list.Add(17);
588 list.Add(87);
589 list.Add(91);
590 list.Add(136);
591 list.Add(134);
592 list.Add(135);
593 list.Add(137);
594 list.Add(138);
595 list.Add(139);
596 if (Main.bloodMoon && !Main.dayTime)
597 {
598 int item = Utils.SelectRandom<int>(Main.rand, 16, 1, 138);
599 list.Add(item);
600 list.Add(item);
601 list.Add(item);
602 }
603 }
604
606 {
607 int num = 0;
609 {
610 num = 1;
611 }
612 if (NPC.downedBoss2)
613 {
614 num = 2;
615 }
617 {
618 num = 3;
619 }
620 if (Main.hardMode)
621 {
622 num = 4;
623 }
625 {
626 num = 5;
627 }
629 {
630 num = 6;
631 }
633 {
634 num = 7;
635 }
637 {
638 num = 8;
639 }
640 int maxValue = 10;
642 {
643 maxValue = 1;
644 }
645 if ((num >= 1 && num <= 2) || (num >= 1 && Main.rand.Next(maxValue) == 0))
646 {
647 list.Add(39);
648 if (WorldGen.crimson)
649 {
650 list.Add(41);
651 }
652 else
653 {
654 list.Add(40);
655 }
656 list.Add(51);
657 }
658 if ((num >= 2 && num <= 3) || (num >= 2 && Main.rand.Next(maxValue) == 0))
659 {
660 list.Add(43);
661 list.Add(42);
662 }
663 if ((num >= 4 && num <= 5) || (num >= 4 && Main.rand.Next(maxValue) == 0))
664 {
665 list.Add(44);
666 list.Add(47);
667 list.Add(45);
668 list.Add(46);
669 }
670 if ((num >= 5 && num <= 6) || (num >= 5 && Main.rand.Next(maxValue) == 0))
671 {
672 if (!NPC.downedMechBoss1)
673 {
674 list.Add(47);
675 }
676 if (!NPC.downedMechBoss2)
677 {
678 list.Add(45);
679 }
680 if (!NPC.downedMechBoss3)
681 {
682 list.Add(46);
683 }
684 list.Add(48);
685 }
686 if (num == 6 || (num >= 6 && Main.rand.Next(maxValue) == 0))
687 {
688 list.Add(48);
689 list.Add(49);
690 list.Add(50);
691 }
692 if (num == 7 || (num >= 7 && Main.rand.Next(maxValue) == 0))
693 {
694 list.Add(49);
695 list.Add(50);
696 list.Add(52);
697 }
698 if (num == 8 || (num >= 8 && Main.rand.Next(maxValue) == 0))
699 {
700 list.Add(52);
701 list.Add(53);
702 }
704 {
705 list.Add(59);
706 }
708 {
709 list.Add(60);
710 }
712 {
713 list.Add(57);
714 }
716 {
717 list.Add(58);
718 }
720 {
721 list.Add(56);
722 }
724 {
725 list.Add(55);
726 }
728 {
729 list.Add(54);
730 }
732 {
733 list.Add(143);
734 }
736 {
737 list.Add(144);
738 }
740 {
741 list.Add(150);
742 }
743 }
744
746 {
748 if (nPC.type == 17)
749 {
750 list.Add(80);
751 list.Add(85);
752 list.Add(85);
753 list.Add(85);
754 list.Add(85);
755 }
756 else if (nPC.type == 18)
757 {
758 list.Add(73);
759 list.Add(73);
760 list.Add(84);
761 list.Add(75);
762 }
763 else if (nPC.type == 19)
764 {
765 if (other != null && ((NPC)other.entity).type == 22)
766 {
767 list.Add(1);
768 list.Add(1);
769 list.Add(93);
770 list.Add(92);
771 }
772 else if (other != null && ((NPC)other.entity).type == 22)
773 {
774 list.Add(1);
775 list.Add(1);
776 list.Add(93);
777 list.Add(92);
778 }
779 else
780 {
781 list.Add(82);
782 list.Add(82);
783 list.Add(85);
784 list.Add(85);
785 list.Add(77);
786 list.Add(93);
787 }
788 }
789 else if (nPC.type == 20)
790 {
791 if (list.Contains(121))
792 {
793 list.Add(121);
794 list.Add(121);
795 }
796 list.Add(14);
797 list.Add(14);
798 }
799 else if (nPC.type == 22)
800 {
801 if (!Main.bloodMoon)
802 {
803 if (other != null && ((NPC)other.entity).type == 19)
804 {
805 list.Add(1);
806 list.Add(1);
807 list.Add(93);
808 list.Add(92);
809 }
810 else
811 {
812 list.Add(79);
813 }
814 }
815 if (!Main.dayTime)
816 {
817 list.Add(16);
818 list.Add(16);
819 list.Add(16);
820 }
821 }
822 else if (nPC.type == 37)
823 {
824 list.Add(43);
825 list.Add(43);
826 list.Add(43);
827 list.Add(72);
828 list.Add(72);
829 }
830 else if (nPC.type == 38)
831 {
832 if (Main.bloodMoon)
833 {
834 list.Add(77);
835 list.Add(77);
836 list.Add(77);
837 list.Add(81);
838 }
839 else
840 {
841 list.Add(77);
842 list.Add(77);
843 list.Add(81);
844 list.Add(81);
845 list.Add(81);
846 list.Add(90);
847 list.Add(90);
848 }
849 }
850 else if (nPC.type == 54)
851 {
852 if (Main.bloodMoon)
853 {
854 list.Add(43);
855 list.Add(72);
856 list.Add(1);
857 }
858 else
859 {
860 if (list.Contains(111))
861 {
862 list.Add(111);
863 }
864 list.Add(17);
865 }
866 }
867 else if (nPC.type == 107)
868 {
869 if (other != null && ((NPC)other.entity).type == 124)
870 {
871 list.Remove(111);
872 list.Add(0);
873 list.Add(0);
874 list.Add(0);
875 list.Add(17);
876 list.Add(17);
877 list.Add(86);
878 list.Add(88);
879 list.Add(88);
880 }
881 else
882 {
883 if (list.Contains(111))
884 {
885 list.Add(111);
886 list.Add(111);
887 list.Add(111);
888 }
889 list.Add(91);
890 list.Add(92);
891 list.Add(91);
892 list.Add(92);
893 }
894 }
895 else if (nPC.type == 108)
896 {
897 list.Add(100);
898 list.Add(89);
899 list.Add(11);
900 }
901 if (nPC.type == 124)
902 {
903 if (other != null && ((NPC)other.entity).type == 107)
904 {
905 list.Remove(111);
906 list.Add(0);
907 list.Add(0);
908 list.Add(0);
909 list.Add(17);
910 list.Add(17);
911 list.Add(88);
912 list.Add(88);
913 return;
914 }
915 if (list.Contains(109))
916 {
917 list.Add(109);
918 list.Add(109);
919 list.Add(109);
920 }
921 if (list.Contains(108))
922 {
923 list.Remove(108);
924 if (Main.hardMode)
925 {
926 list.Add(108);
927 list.Add(108);
928 }
929 else
930 {
931 list.Add(106);
932 list.Add(106);
933 }
934 }
935 list.Add(43);
936 list.Add(2);
937 }
938 else if (nPC.type == 142)
939 {
940 list.Add(32);
941 list.Add(66);
942 list.Add(17);
943 list.Add(15);
944 list.Add(15);
945 }
946 else if (nPC.type == 160)
947 {
948 list.Add(10);
949 list.Add(89);
950 list.Add(94);
951 list.Add(8);
952 }
953 else if (nPC.type == 178)
954 {
955 list.Add(83);
956 list.Add(83);
957 }
958 else if (nPC.type == 207)
959 {
960 list.Add(28);
961 list.Add(95);
962 list.Add(93);
963 }
964 else if (nPC.type == 208)
965 {
966 list.Add(94);
967 list.Add(17);
968 list.Add(3);
969 list.Add(77);
970 }
971 else if (nPC.type == 209)
972 {
973 list.Add(48);
974 list.Add(83);
975 list.Add(5);
976 list.Add(5);
977 }
978 else if (nPC.type == 227)
979 {
980 list.Add(63);
981 list.Add(68);
982 }
983 else if (nPC.type == 228)
984 {
985 list.Add(24);
986 list.Add(24);
987 list.Add(95);
988 list.Add(8);
989 }
990 else if (nPC.type == 229)
991 {
992 list.Add(93);
993 list.Add(9);
994 list.Add(65);
995 list.Add(120);
996 list.Add(59);
997 }
998 else if (nPC.type == 353)
999 {
1000 if (list.Contains(104))
1001 {
1002 list.Add(104);
1003 list.Add(104);
1004 }
1005 if (list.Contains(111))
1006 {
1007 list.Add(111);
1008 list.Add(111);
1009 }
1010 list.Add(67);
1011 }
1012 else if (nPC.type == 368)
1013 {
1014 list.Add(85);
1015 list.Add(7);
1016 list.Add(79);
1017 }
1018 else if (nPC.type == 369)
1019 {
1020 if (!Main.bloodMoon)
1021 {
1022 list.Add(70);
1023 list.Add(70);
1024 list.Add(76);
1025 list.Add(76);
1026 list.Add(79);
1027 list.Add(79);
1028 if ((double)nPC.position.Y < Main.worldSurface)
1029 {
1030 list.Add(29);
1031 }
1032 }
1033 }
1034 else if (nPC.type == 453)
1035 {
1036 list.Add(72);
1037 list.Add(69);
1038 list.Add(87);
1039 list.Add(3);
1040 }
1041 else if (nPC.type == 441)
1042 {
1043 list.Add(100);
1044 list.Add(100);
1045 list.Add(1);
1046 list.Add(1);
1047 list.Add(1);
1048 list.Add(87);
1049 }
1050 }
1051}
void Draw(Texture2D texture, Vector2 position, Color color)
void Add(TKey key, TValue value)
static bool CanHitLine(Vector2 Position1, int Width1, int Height1, Vector2 Position2, int Width2, int Height2)
Definition Collision.cs:551
Vector2 Center
Definition Entity.cs:43
Vector2 Top
Definition Entity.cs:79
float Distance(Vector2 Other)
Definition Entity.cs:187
Vector2 position
Definition Entity.cs:14
virtual Vector2 VisualPosition
Definition Entity.cs:40
static Asset< Texture2D >[] Extra
static Asset< Texture2D >[] NpcHead
void ProbeEvents(List< int > list)
static int NewBubbleNPC(WorldUIAnchor bubbleAnchor, int time, WorldUIAnchor other=null)
void ProbeExceptions(List< int > list, Player plr, WorldUIAnchor other)
static void MakeLocalPlayerEmote(int emoteId)
static void CheckForNPCsToReactToEmoteBubble(int emoteID, Player player)
void ProbeWeather(List< int > list, Player plr)
static Dictionary< int, EmoteBubble > byID
void PickNPCEmote(WorldUIAnchor other=null)
EmoteBubble(int emotion, WorldUIAnchor bubbleAnchor, int time=180)
void ProbeDebuffs(List< int > list, Player plr)
Vector2 GetPosition(out SpriteEffects effect)
static WorldUIAnchor DeserializeNetAnchor(int type, int meta)
void ProbeItems(List< int > list, Player plr)
void ProbeCritters(List< int > list)
static Tuple< int, int > SerializeNetAnchor(WorldUIAnchor anch)
void ProbeTownNPCs(List< int > list)
void ProbeEmotions(List< int > list)
static int NewBubble(int emoticon, WorldUIAnchor bubbleAnchor, int time)
static void DrawAll(SpriteBatch sb)
static void OnBubbleChange(int bubbleID)
void ProbeCombat(List< int > list)
void ProbeBiomes(List< int > list, Player plr)
void ProbeBosses(List< int > list)
static readonly int EMOTE_SHEET_VERTICAL_FRAMES
static int[] FaceEmote
Definition NPCID.cs:4208
static readonly short Count
Definition NPCID.cs:11744
static double time
Definition Main.cs:1284
static int maxTilesY
Definition Main.cs:1116
static float cloudAlpha
Definition Main.cs:1302
static double worldSurface
Definition Main.cs:1272
static int myPlayer
Definition Main.cs:1801
static Vector2 ReverseGravitySupport(Vector2 pos, float height=0f)
Definition Main.cs:3005
static int netMode
Definition Main.cs:2095
static double rockLayer
Definition Main.cs:1274
static bool expertMode
Definition Main.cs:2737
static bool dayTime
Definition Main.cs:1282
static bool bloodMoon
Definition Main.cs:1296
static int screenHeight
Definition Main.cs:1721
static Vector2 screenPosition
Definition Main.cs:1715
static int maxTilesX
Definition Main.cs:1114
static bool eclipse
Definition Main.cs:1312
static Projectile[] projectile
Definition Main.cs:1691
static UnifiedRandom rand
Definition Main.cs:1387
static NPC[] npc
Definition Main.cs:1685
static int screenWidth
Definition Main.cs:1719
static float cloudBGActive
Definition Main.cs:628
static bool snowMoon
Definition Main.cs:1300
static bool pumpkinMoon
Definition Main.cs:1298
static Player LocalPlayer
Definition Main.cs:2829
static bool hardMode
Definition Main.cs:1022
static Player[] player
Definition Main.cs:1803
static bool downedChristmasSantank
Definition NPC.cs:379
static bool downedFrost
Definition NPC.cs:357
static bool downedMechBoss2
Definition NPC.cs:425
static bool downedBoss2
Definition NPC.cs:347
static bool downedMechBossAny
Definition NPC.cs:421
static bool downedEmpressOfLight
Definition NPC.cs:393
static bool downedHalloweenKing
Definition NPC.cs:373
static bool downedBoss1
Definition NPC.cs:345
static bool downedMechBoss3
Definition NPC.cs:427
static bool downedPirates
Definition NPC.cs:359
static bool downedMoonlord
Definition NPC.cs:383
static bool downedQueenBee
Definition NPC.cs:351
static bool downedHalloweenTree
Definition NPC.cs:371
static bool downedChristmasTree
Definition NPC.cs:377
static bool downedGoblins
Definition NPC.cs:355
static bool downedGolemBoss
Definition NPC.cs:365
static bool downedMartians
Definition NPC.cs:367
static bool downedChristmasIceQueen
Definition NPC.cs:375
static bool downedAncientCultist
Definition NPC.cs:381
static bool downedBoss3
Definition NPC.cs:349
static bool downedPlantBoss
Definition NPC.cs:363
static bool downedMechBoss1
Definition NPC.cs:423
static bool downedDeerclops
Definition NPC.cs:397
static bool downedQueenSlime
Definition NPC.cs:395
static void SendData(int msgType, int remoteClient=-1, int ignoreClient=-1, NetworkText text=null, int number=0, float number2=0f, float number3=0f, float number4=0f, int number5=0, int number6=0, int number7=0)
Definition NetMessage.cs:88
bool CanBeTalkedTo
Definition Player.cs:3364
static byte FindClosest(Vector2 Position, int Width, int Height)
Definition Player.cs:4011
static bool crimson
Definition WorldGen.cs:932
static bool spawnMeteor
Definition WorldGen.cs:980