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

◆ NewProjectileDirect()

static Projectile Terraria.Projectile.NewProjectileDirect ( IEntitySource spawnSource,
Vector2 position,
Vector2 velocity,
int type,
int damage,
float knockback,
int owner = -1,
float ai0 = 0f,
float ai1 = 0f,
float ai2 = 0f )
inlinestatic



This particular overload uses a Vector2 instead of X and Y to determine the actual spawn position and a Vector2 to dictate the initial velocity. The return value is the actual Projectile instance rather than the index of the spawned Projectile within the F:Terraria.Main.projectile array.
A short-hand for

Main.projectile[Projectile.NewProjectile(...)]

Definition at line 93078 of file Projectile.cs.

93079 {
93080 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
93081 //IL_000c: Unknown result type (might be due to invalid IL or missing references)
93082 //IL_0012: Unknown result type (might be due to invalid IL or missing references)
93083 //IL_0018: Unknown result type (might be due to invalid IL or missing references)
93084 return Main.projectile[NewProjectile(spawnSource, position.X, position.Y, velocity.X, velocity.Y, type, damage, knockback, owner, ai0, ai1, ai2)];
93085 }
Vector2 velocity
The velocity of this Entity in world coordinates per tick.
Definition Entity.cs:33
Vector2 position
The position of this Entity in world coordinates.
Definition Entity.cs:28
int owner
The index of the player who owns this projectile. In Multiplayer, Clients "own" projectiles that they...
int damage
This will always be set in Projectile.NewProjectile based on the weapons damage and player stat modif...
int type
The Projectile ID of this projectile. The Projectile ID is a unique number assigned to each Projectil...
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.Main.projectile.