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

◆ BuffHandle_SpawnPetIfNeeded()

void Terraria.Player.BuffHandle_SpawnPetIfNeeded ( ref bool petBool,
int petProjID,
int buffIndex )
inline

Definition at line 11674 of file Player.cs.

11675 {
11676 petBool = true;
11677 bool flag = true;
11679 {
11680 flag = false;
11681 }
11682 Vector2 center = base.Center;
11683 if (buffType[buffIndex] == 341)
11684 {
11685 float num = 10f;
11686 if (petProjID == 934)
11687 {
11688 center += new Vector2(num * (float)direction, 0f);
11689 }
11690 else
11691 {
11692 center -= new Vector2(num * (float)direction, 0f);
11693 }
11694 }
11695 if (flag && whoAmI == Main.myPlayer)
11696 {
11697 Projectile.NewProjectile(GetProjectileSource_Buff(buffIndex), center.X, center.Y, 0f, 0f, petProjID, 0, 0f, whoAmI);
11698 }
11699 }
IEntitySource GetProjectileSource_Buff(int buffIndex)
Definition Player.cs:9266
int[] ownedProjectileCounts
Definition Player.cs:2545

References Terraria.Main.myPlayer, and Terraria.Projectile.NewProjectile().