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

◆ ghostHeal()

void Terraria.Projectile.ghostHeal ( int dmg,
Vector2 Position,
Entity victim )
inline

Definition at line 11192 of file Projectile.cs.

11193 {
11194 //IL_013c: Unknown result type (might be due to invalid IL or missing references)
11195 //IL_0142: Unknown result type (might be due to invalid IL or missing references)
11196 //IL_00e6: Unknown result type (might be due to invalid IL or missing references)
11197 float num = 0.2f;
11198 num -= (float)numHits * 0.05f;
11199 if (num <= 0f)
11200 {
11201 return;
11202 }
11203 float num2 = (float)dmg * num;
11204 if ((int)num2 <= 0 || Main.player[Main.myPlayer].lifeSteal <= 0f)
11205 {
11206 return;
11207 }
11208 Main.player[Main.myPlayer].lifeSteal -= num2;
11209 if (!magic)
11210 {
11211 return;
11212 }
11213 float num3 = 0f;
11214 int num4 = owner;
11215 for (int i = 0; i < 255; i++)
11216 {
11217 if (Main.player[i].active && !Main.player[i].dead && ((!Main.player[owner].hostile && !Main.player[i].hostile) || Main.player[owner].team == Main.player[i].team) && Distance(Main.player[i].Center) <= 3000f)
11218 {
11219 int num5 = Main.player[i].statLifeMax2 - Main.player[i].statLife;
11220 if ((float)num5 > num3)
11221 {
11222 num3 = num5;
11223 num4 = i;
11224 }
11225 }
11226 }
11227 NewProjectile(GetProjectileSource_OnHit(victim, 15), Position.X, Position.Y, 0f, 0f, 298, 0, 0f, owner, num4, num2);
11228 }
float Distance(Vector2 Other)
Definition Entity.cs:275
int owner
The index of the player who owns this projectile. In Multiplayer, Clients "own" projectiles that they...
IEntitySource GetProjectileSource_OnHit(Entity victim, int projectileSourceId)
static int NewProjectile(IEntitySource spawnSource, Vector2 position, Vector2 velocity, int Type, int Damage, float KnockBack, int Owner=-1, float ai0=0f, float ai1=0f, float ai2=0f)
This particular overload uses a Vector2 instead of X and Y to determine the actual spawn position and...

References Terraria.Entity.Distance(), Terraria.Projectile.GetProjectileSource_OnHit(), Terraria.Projectile.magic, Terraria.Main.myPlayer, Terraria.Projectile.NewProjectile(), Terraria.Projectile.numHits, Terraria.Projectile.owner, and Terraria.Main.player.

Referenced by Terraria.Projectile.Damage().

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