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

◆ AI_148_StarSpawner()

void Terraria.Projectile.AI_148_StarSpawner ( )
inlineprivate

Definition at line 56045 of file Projectile.cs.

56046 {
56047 //IL_00c1: Unknown result type (might be due to invalid IL or missing references)
56048 //IL_00da: Unknown result type (might be due to invalid IL or missing references)
56049 if (Main.dayTime && !Main.remixWorld)
56050 {
56051 Kill();
56052 return;
56053 }
56054 ai[0] += (float)Main.desiredWorldEventsUpdateRate;
56055 if (localAI[0] == 0f && Main.netMode != 2)
56056 {
56057 localAI[0] = 1f;
56058 if ((double)Main.LocalPlayer.position.Y < Main.worldSurface * 16.0)
56059 {
56060 Star.StarFall(position.X);
56061 }
56062 }
56063 if (owner != Main.myPlayer || !(ai[0] >= 180f))
56064 {
56065 return;
56066 }
56067 if (ai[1] > -1f)
56068 {
56069 velocity.X *= 0.35f;
56070 if (base.Center.X < Main.player[(int)ai[1]].Center.X)
56071 {
56072 velocity.X = Math.Abs(velocity.X);
56073 }
56074 else
56075 {
56076 velocity.X = 0f - Math.Abs(velocity.X);
56077 }
56078 }
56079 NewProjectile(GetProjectileSource_FromThis(), position.X, position.Y, velocity.X, velocity.Y, 12, 1000, 10f, Main.myPlayer);
56080 Kill();
56081 }
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...
float[] ai
An array with 3 slots used for any sort of data storage, which is occasionally synced to the server....
IEntitySource GetProjectileSource_FromThis()
float[] localAI
Acts like F:Terraria.Projectile.ai, but does not sync to the server. Many vanilla T:Terraria....
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.dayTime, Terraria.Main.desiredWorldEventsUpdateRate, Terraria.Main.LocalPlayer, Terraria.Main.myPlayer, Terraria.Main.netMode, Terraria.Main.player, Terraria.Main.remixWorld, Terraria.Star.StarFall(), and Terraria.Main.worldSurface.

+ Here is the call graph for this function: