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

◆ UpdatePet()

void Terraria.Player.UpdatePet ( int i)
inline

Definition at line 15644 of file Player.cs.

15645 {
15646 //IL_009d: Unknown result type (might be due to invalid IL or missing references)
15647 if (i == Main.myPlayer && miscEquips[0].buffType >= 1 && miscEquips[0].stack >= 1)
15648 {
15649 int num = miscEquips[0].buffType;
15650 if ((Main.vanityPet[num] || Main.lightPet[num]) && !hideMisc[0] && (miscEquips[0].type != 603 || Main.runningCollectorsEdition) && FindBuffIndex(num) == -1)
15651 {
15652 AddBuff(num, 3600);
15654 }
15655 }
15656 }
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 ...
Vector2 position
The position of this Entity in world coordinates.
Definition Entity.cs:28
int stack
The current stack of the item. F:Terraria.Item.maxStack indicates the max possible stack.
Definition Item.cs:396
int buffType
The Buff ID of the buff given by this item on use. To have a potion give multiple buffs,...
Definition Item.cs:683
int type
The Item ID of this item. The Item ID is a unique number assigned to each Item loaded into the game....
Definition Item.cs:345
BitsByte hideMisc
Definition Player.cs:1882
int FindBuffIndex(int type)
Definition Player.cs:5676
Item[] miscEquips
The player's equipment items. From indexes 0-4: Pet, Light Pet, Minecart, Mount, and Hook.
Definition Player.cs:1658
void AddBuff(int type, int timeToAdd, bool quiet=true, bool foodHack=false)
Gives the player the provided buff. This accounts for if the player is immune to the buff....
Definition Player.cs:5700

References Terraria.Player.AddBuff(), Terraria.Item.buffType, Terraria.Player.FindBuffIndex(), Terraria.Player.hideMisc, Terraria.Main.lightPet, Terraria.Player.miscEquips, Terraria.Main.myPlayer, Terraria.Audio.SoundEngine.PlaySound(), Terraria.Entity.position, Terraria.Main.runningCollectorsEdition, Terraria.Item.stack, Terraria.Item.type, and Terraria.Main.vanityPet.

Referenced by Terraria.Player.Update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: