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

◆ AI_007_AttemptToPlayIdleAnimationsForPets()

void Terraria.NPC.AI_007_AttemptToPlayIdleAnimationsForPets ( int petIdleChance)
inlineprivate

Definition at line 48892 of file NPC.cs.

48893 {
48894 if (velocity.X == 0f && Main.netMode != 1 && Main.rand.Next(petIdleChance) == 0)
48895 {
48896 int num = 3;
48897 if (type == 638)
48898 {
48899 num = 2;
48900 }
48902 {
48903 num = 0;
48904 }
48905 ai[0] = ((num == 0) ? 20 : Main.rand.Next(20, 20 + num));
48906 ai[1] = 200 + Main.rand.Next(300);
48907 if (ai[0] == 20f && type == 637)
48908 {
48909 ai[1] = 500 + Main.rand.Next(200);
48910 }
48911 if (ai[0] == 21f && type == 638)
48912 {
48913 ai[1] = 100 + Main.rand.Next(100);
48914 }
48915 if (ai[0] == 22f && type == 656)
48916 {
48917 ai[1] = 200 + Main.rand.Next(200);
48918 }
48919 if (ai[0] == 20f && NPCID.Sets.IsTownSlime[type])
48920 {
48921 ai[1] = 180 + Main.rand.Next(240);
48922 }
48923 ai[2] = 0f;
48924 localAI[3] = 0f;
48925 netUpdate = true;
48926 }
48927 }
Vector2 velocity
Definition Entity.cs:16
static bool[] IsTownSlime
Definition NPCID.cs:4101
float[] localAI
Definition NPC.cs:449
float[] ai
Definition NPC.cs:447
int type
Definition NPC.cs:445
bool netUpdate
Definition NPC.cs:507

References Terraria.NPC.ai, Terraria.ID.NPCID.Sets.IsTownSlime, Terraria.NPC.localAI, Terraria.Main.netMode, Terraria.NPC.netUpdate, Terraria.Main.rand, Terraria.NPC.type, Terraria.Entity.velocity, and Microsoft.Xna.Framework.Vector2.X.

Referenced by Terraria.NPC.AI_007_TownEntities().