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

◆ GetPettingInfo()

void Terraria.Player.GetPettingInfo ( int animalNpcIndex,
out int targetDirection,
out Vector2 playerPositionWhenPetting,
out bool isPetSmall )
inlineprivate

Definition at line 31123 of file Player.cs.

31124 {
31125 NPC nPC = Main.npc[animalNpcIndex];
31126 targetDirection = ((nPC.Center.X > base.Center.X) ? 1 : (-1));
31127 int num = 36;
31128 isPetSmall = false;
31129 switch (nPC.type)
31130 {
31131 case 637:
31132 isPetSmall = true;
31133 num = 28;
31134 break;
31135 case 656:
31136 isPetSmall = true;
31137 num = 24;
31138 break;
31139 case 670:
31140 case 678:
31141 case 679:
31142 case 680:
31143 case 681:
31144 case 683:
31145 isPetSmall = true;
31146 num = 26;
31147 break;
31148 case 682:
31149 isPetSmall = true;
31150 num = 22;
31151 break;
31152 case 684:
31153 isPetSmall = true;
31154 num = 20;
31155 break;
31156 }
31157 playerPositionWhenPetting = nPC.Bottom + new Vector2(-targetDirection * num, 0f);
31158 }

References Terraria.Main.npc.