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

◆ AI_194_HorsemanPumpkin()

void Terraria.Projectile.AI_194_HorsemanPumpkin ( )
inlineprivate

Definition at line 42317 of file Projectile.cs.

42318 {
42319 //IL_000b: Unknown result type (might be due to invalid IL or missing references)
42320 //IL_0010: Unknown result type (might be due to invalid IL or missing references)
42321 //IL_0041: Unknown result type (might be due to invalid IL or missing references)
42322 //IL_0043: Unknown result type (might be due to invalid IL or missing references)
42323 //IL_0048: Unknown result type (might be due to invalid IL or missing references)
42324 //IL_004d: Unknown result type (might be due to invalid IL or missing references)
42325 //IL_006d: Unknown result type (might be due to invalid IL or missing references)
42326 //IL_0082: Unknown result type (might be due to invalid IL or missing references)
42327 //IL_0077: Unknown result type (might be due to invalid IL or missing references)
42328 //IL_00cc: Unknown result type (might be due to invalid IL or missing references)
42329 //IL_00f2: Unknown result type (might be due to invalid IL or missing references)
42330 //IL_003b: Unknown result type (might be due to invalid IL or missing references)
42331 //IL_0040: Unknown result type (might be due to invalid IL or missing references)
42332 //IL_015a: Unknown result type (might be due to invalid IL or missing references)
42333 //IL_0185: Unknown result type (might be due to invalid IL or missing references)
42334 //IL_018b: Unknown result type (might be due to invalid IL or missing references)
42335 int num = (int)ai[0];
42336 Vector2 center = base.Center;
42337 if (Main.player.IndexInRange(num))
42338 {
42339 Player player = Main.player[num];
42340 if (player.active && !player.dead)
42341 {
42342 center = player.Center;
42343 }
42344 }
42345 Vector2 vector = center - base.Center;
42346 int num2 = 30;
42347 float num3 = 4f;
42348 float num4 = 5f;
42349 float num5 = 0.4f;
42350 float num6 = 0.4f;
42351 if (!(vector.Y < (float)num2) || !(vector.Y > (float)(-num2)))
42352 {
42353 float num7 = (float)Math.Sign(vector.Y) * num6;
42354 velocity.Y = Utils.Clamp(velocity.Y + num7, 0f - num4, num4);
42355 }
42356 velocity.X = Utils.Clamp(velocity.X + (float)Math.Sign(vector.X) * num5, 0f - num3, num3);
42357 rotation = velocity.ToRotation();
42358 spriteDirection = ((!(velocity.X < 0f)) ? 1 : (-1));
42359 if (timeLeft < 6)
42360 {
42361 Opacity -= 0.1f;
42362 }
42363 else
42364 {
42365 Opacity += 1f / 30f;
42366 }
42367 if (Main.rand.Next(3) != 0)
42368 {
42369 Dust dust = Dust.NewDustDirect(position, width, height, 6, velocity.X, velocity.Y);
42370 dust.scale = 0.6f;
42371 dust.fadeIn = 1.1f;
42372 dust.noGravity = true;
42373 dust.noLight = true;
42374 }
42375 }
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 width
The width of this Entity's hitbox, in pixels.
Definition Entity.cs:46
int height
The height of this Entity's hitbox, in pixels.
Definition Entity.cs:51
float[] ai
An array with 3 slots used for any sort of data storage, which is occasionally synced to the server....
int timeLeft
Time in ticks before this projectile will naturally despawn. Each update timeLeft is decreased by 1...
float rotation
Rotation of the projectile. Radians not Degrees. Use T:Microsoft.Xna.Framework.MathHelper if you want...

References Terraria.Entity.active, Terraria.Entity.Center, Terraria.Player.dead, Terraria.Dust.NewDustDirect(), Terraria.Main.player, and Terraria.Main.rand.

+ Here is the call graph for this function: