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

◆ IdleSounds()

void Terraria.NPC.IdleSounds ( )
inline

Definition at line 106855 of file NPC.cs.

106856 {
106857 if (!(shimmerTransparency > 0f))
106858 {
106859 if ((type == 239 || type == 240) && Main.rand.Next(900) == 0)
106860 {
106861 SoundEngine.PlaySound(29, (int)position.X, (int)position.Y, Main.rand.Next(24, 26));
106862 }
106863 else if ((type == 62 || type == 156) && Main.rand.Next(700) == 0)
106864 {
106865 SoundEngine.PlaySound(29, (int)position.X, (int)position.Y, Main.rand.Next(26, 30));
106866 }
106867 else if (type == 177 && Main.rand.Next(600) == 0)
106868 {
106869 SoundEngine.PlaySound(29, (int)position.X, (int)position.Y, Main.rand.Next(30, 32));
106870 }
106871 else if (type == 226 && Main.rand.Next(800) == 0)
106872 {
106873 SoundEngine.PlaySound(29, (int)position.X, (int)position.Y, 32);
106874 }
106875 else if (type == 153 && Main.rand.Next(1000) == 0)
106876 {
106877 SoundEngine.PlaySound(29, (int)position.X, (int)position.Y, 33);
106878 }
106879 else if (wet && (type == 63 || type == 64 || type == 103) && Main.rand.Next(1000) == 0)
106880 {
106881 SoundEngine.PlaySound(29, (int)position.X, (int)position.Y, Main.rand.Next(34, 36));
106882 }
106883 else if ((type == 198 || type == 199) && Main.rand.Next(1000) == 0)
106884 {
106885 SoundEngine.PlaySound(29, (int)position.X, (int)position.Y, Main.rand.Next(36, 38));
106886 }
106887 else if ((type == 170 || type == 180 || type == 171) && Main.rand.Next(600) == 0)
106888 {
106889 SoundEngine.PlaySound(29, (int)position.X, (int)position.Y, Main.rand.Next(38, 41));
106890 }
106891 else if (type == 250 && Main.rand.Next(700) == 0)
106892 {
106893 SoundEngine.PlaySound(29, (int)position.X, (int)position.Y, Main.rand.Next(41, 44));
106894 }
106895 else if (type == 580 && Main.rand.Next(800) == 0)
106896 {
106897 SoundEngine.PlaySound(29, (int)position.X, (int)position.Y, 44);
106898 }
106899 else if (type == 582 && Main.rand.Next(800) == 0)
106900 {
106901 SoundEngine.PlaySound(29, (int)position.X, (int)position.Y, 44);
106902 }
106903 else if (type == 581 && Main.rand.Next(800) == 0)
106904 {
106905 SoundEngine.PlaySound(29, (int)position.X, (int)position.Y, Main.rand.Next(44, 47));
106906 }
106907 else if (type == 508 && Main.rand.Next(800) == 0)
106908 {
106909 SoundEngine.PlaySound(29, (int)position.X, (int)position.Y, 44);
106910 }
106911 else if (type == 509 && Main.rand.Next(800) == 0)
106912 {
106913 SoundEngine.PlaySound(29, (int)position.X, (int)position.Y, Main.rand.Next(44, 47));
106914 }
106915 else if (type == 494 && Main.rand.Next(600) == 0)
106916 {
106917 SoundEngine.PlaySound(29, (int)position.X, (int)position.Y, 47);
106918 }
106919 else if (type == 467 && Main.rand.Next(700) == 0)
106920 {
106921 SoundEngine.PlaySound(29, (int)position.X, (int)position.Y, Main.rand.Next(48, 50));
106922 }
106923 else if (type == 468 && Main.rand.Next(700) == 0)
106924 {
106925 SoundEngine.PlaySound(29, (int)position.X, (int)position.Y, Main.rand.Next(50, 53));
106926 }
106927 else if (type == 288 && Main.rand.Next(400) == 0)
106928 {
106929 SoundEngine.PlaySound(29, (int)position.X, (int)position.Y, Main.rand.Next(53, 55));
106930 }
106931 else if ((type == 524 || type == 525 || type == 526 || type == 527) && Main.rand.Next(700) == 0)
106932 {
106933 SoundEngine.PlaySound(29, (int)position.X, (int)position.Y, Main.rand.Next(55, 57));
106934 }
106935 else if ((type == 496 || type == 497) && Main.rand.Next(600) == 0)
106936 {
106937 SoundEngine.PlaySound(29, (int)position.X, (int)position.Y, Main.rand.Next(57, 59));
106938 }
106939 else if (type == 389 && Main.rand.Next(800) == 0)
106940 {
106941 SoundEngine.PlaySound(29, (int)position.X, (int)position.Y, Main.rand.Next(59, 61));
106942 }
106943 else if (type == 471 && Main.rand.Next(600) == 0)
106944 {
106945 SoundEngine.PlaySound(29, (int)position.X, (int)position.Y, Main.rand.Next(61, 63));
106946 }
106947 else if (type == 482 && Main.rand.Next(600) == 0)
106948 {
106949 SoundEngine.PlaySound(29, (int)position.X, (int)position.Y, Main.rand.Next(63, 66));
106950 }
106951 else if (type == 388 && Main.rand.Next(700) == 0)
106952 {
106953 SoundEngine.PlaySound(29, (int)position.X, (int)position.Y, Main.rand.Next(66, 69));
106954 }
106955 else if (type == 520 && Main.rand.Next(800) == 0)
106956 {
106957 SoundEngine.PlaySound(29, (int)position.X, (int)position.Y, Main.rand.Next(69, 73));
106958 }
106959 else if (type == 477 && Main.rand.Next(600) == 0)
106960 {
106961 SoundEngine.PlaySound(29, (int)position.X, (int)position.Y, 73);
106962 }
106963 else if (type == 258 && Main.rand.Next(700) == 0)
106964 {
106965 SoundEngine.PlaySound(29, (int)position.X, (int)position.Y, Main.rand.Next(74, 78));
106966 }
106967 else if (type == 252 && Main.rand.Next(700) == 0)
106968 {
106969 SoundEngine.PlaySound(29, (int)position.X, (int)position.Y, 78);
106970 }
106971 else if (type == 469 && Main.rand.Next(700) == 0)
106972 {
106973 SoundEngine.PlaySound(29, (int)position.X, (int)position.Y, Main.rand.Next(79, 81));
106974 }
106975 else if ((type == 253 || type == 82) && Main.rand.Next(700) == 0)
106976 {
106977 SoundEngine.PlaySound(29, (int)position.X, (int)position.Y, Main.rand.Next(81, 84));
106978 }
106979 else if (type >= 498 && type <= 506 && Main.rand.Next(600) == 0)
106980 {
106981 SoundEngine.PlaySound(29, (int)position.X, (int)position.Y, Main.rand.Next(84, 86));
106982 }
106983 else if (type == 391 && Main.rand.Next(700) == 0)
106984 {
106985 SoundEngine.PlaySound(29, (int)position.X, (int)position.Y, Main.rand.Next(86, 87));
106986 }
106987 }
106988 }
static SlotId PlaySound(in SoundStyle? style, Vector2? position=null, SoundUpdateCallback? updateCallback=null)
Attempts to play a sound style with the provided sound style (if it's not null), and returns a valid ...
bool wet
The Entity is currently in water. Projectile: Affects movement speed and some projectiles die when ...
Definition Entity.cs:57
Vector2 position
The position of this Entity in world coordinates.
Definition Entity.cs:28
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
float shimmerTransparency
Definition NPC.cs:643

References Terraria.Audio.SoundEngine.PlaySound(), and Terraria.Main.rand.

+ Here is the call graph for this function: