74424 {
74425
74426
74427
74428
74429
74430
74431
74432
74433
74434
74435
74436
74437
74438
74439
74440
74441
74442
74443
74444
74445
74446
74447
74448
74449
74450
74451
74452
74453
74454
74455
74456
74457
74458
74459
74460
74461
74462
74463
74464
74465
74466
74467
74468
74469
74470
74471
74472
74473
74474
74475
74476
74477
74478
74479
74480
74481
74482
74483
74484
74485
74486
74487
74488
74489
74490
74491
74492
74493
74494
74495
74496
74497
74498
74499
74500
74501
74502
74503
74504
74505
74506
74507
74508
74509
74510
74511
74512
74513
74514
74515
74516
74517
74518
74519
74520
74521
74522
74523
74524
74525
74526
74527
74528
74529
74530
74531
74532
74533
74534
74535
74536
74537
74538
74539
74540
74541
74542
74543
74544
74545
74546
74547
74548
74549
74550
74551
74553 for (
int i = 0; i <
whoAmI; i++)
74554 {
74555 if (Main.projectile[i].active && Main.projectile[i].owner ==
owner && Main.projectile[i].type ==
type)
74556 {
74558 }
74559 }
74560 if (
owner == Main.myPlayer)
74561 {
74564 {
74565 localAI[0] += (float)Main.rand.Next(10, 31) * 0.1f;
74566 }
74568 num /= (1
f + Main.player[
owner].inverseMeleeSpeed) / 2
f;
74571 {
74573 }
74574 }
74575 if (
type == 603 &&
owner == Main.myPlayer)
74576 {
74579 {
74582 Vector2
vector2 =
default(Vector2);
74583 ((Vector2)(
ref vector2)).
_002Ector((
float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101));
74585 vector2 *= (float)Main.rand.Next(10, 41) * 0.1f;
74586 if (Main.rand.Next(3) == 0)
74587 {
74589 }
74592 for (
int j = 0;
j < 200;
j++)
74593 {
74594 if (Main.npc[
j].CanBeChasedBy(
this))
74595 {
74596 float num10 = Main.npc[
j].position.X + (float)(Main.npc[
j].width / 2);
74597 float num11 = Main.npc[
j].position.Y + (float)(Main.npc[
j].height / 2);
74600 {
74607 }
74608 }
74609 }
74613 }
74614 }
74615 bool flag2 =
false;
74617 {
74619 }
74620 if (Main.player[
owner].dead)
74621 {
74623 return;
74624 }
74626 {
74628 Main.player[
owner].SetDummyItemTime(2);
74630 {
74631 Main.player[
owner].ChangeDir(1);
74633 }
74634 else
74635 {
74636 Main.player[
owner].ChangeDir(-1);
74638 }
74639 }
74641 {
74643 }
74652 {
74653 if (Main.rand.Next(6) == 0)
74654 {
74656 Main.dust[
num3].noGravity =
true;
74657 }
74658 }
74659 else if (
type == 553 && Main.rand.Next(2) == 0)
74660 {
74662 Main.dust[
num4].noGravity =
true;
74663 Main.dust[
num4].scale = 1.6f;
74664 }
74665 if (Main.player[
owner].yoyoString)
74666 {
74668 }
74669 num2 /= (1
f + Main.player[
owner].inverseMeleeSpeed * 3
f) / 4
f;
74670 num14 /= (1
f + Main.player[
owner].inverseMeleeSpeed * 3
f) / 4
f;
74673 {
74675 }
74677 {
74679 }
74682 {
74684 }
74686 {
74688 {
74690 }
74691 bool flag3 =
false;
74692 bool flag4 =
false;
74695 {
74697 if ((
double)((Vector2)(
ref vector3)).Length() > (double)
num2 * 1.3)
74698 {
74700 }
74701 }
74702 if (
owner == Main.myPlayer)
74703 {
74704 if (!Main.player[
owner].channel || Main.player[
owner].stoned || Main.player[
owner].frozen)
74705 {
74709 }
74710 else
74711 {
74712 Vector2
val = Main.ReverseGravitySupport(Main.MouseScreen) + Main.screenPosition;
74715 Vector2
vector4 =
new Vector2(x, y) - Main.player[
owner].Center;
74717 {
74723 }
74724 if (
ai[0] != x ||
ai[1] != y)
74725 {
74726 Vector2
vector5 =
new Vector2(x, y) - Main.player[
owner].Center;
74728 {
74734 }
74738 }
74739 }
74740 }
74742 {
74745 }
74747 {
74749 {
74753 {
74754 velocity.X *= 0.5f;
74755 }
74757 {
74758 velocity.Y *= 0.5f;
74759 }
74761 {
74762 velocity.X *= 0.5f;
74763 }
74765 {
74766 velocity.Y *= 0.5f;
74767 }
74768 }
74771 {
74773 }
74777 {
74781 {
74783 }
74786 }
74788 {
74790 {
74795 }
74796 }
74797 else
74798 {
74800 }
74802 {
74805 }
74806 }
74807 }
74808 else
74809 {
74816 {
74818 }
74819 else
74820 {
74824 }
74825 }
74827 }
int whoAmI
The index of this Entity within its specific array. These arrays track the entities in the world....
Vector2 velocity
The velocity of this Entity in world coordinates per tick.
Vector2 position
The position of this Entity in world coordinates.
int width
The width of this Entity's hitbox, in pixels.
int height
The height of this Entity's hitbox, in pixels.
static float[] YoyosLifeTimeMultiplier
The lifetime of a yoyo projectile (F:Terraria.ID.ProjAIStyleID.Yoyo) in seconds. A value of -1f mea...
static float[] YoyosTopSpeed
The maximum speed a yoyo projectile (F:Terraria.ID.ProjAIStyleID.Yoyo) can go in pixels per tick....
static float[] YoyosMaximumRange
The maximum distance a yoyo projectile (F:Terraria.ID.ProjAIStyleID.Yoyo) can be from its owner in pi...
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...
float[] ai
An array with 3 slots used for any sort of data storage, which is occasionally synced to the server....
bool netUpdate
Set manually to true in M:Terraria.ModLoader.ModProjectile.AI once to make it sync its current F:Terr...
IEntitySource GetProjectileSource_FromThis()
float[] localAI
Acts like F:Terraria.Projectile.ai, but does not sync to the server. Many vanilla T:Terraria....
float knockBack
This will always be set in Projectile.NewProjectile based on the weapons knockback and player stat mo...
int type
The Projectile ID of this projectile. The Projectile ID is a unique number assigned to each Projectil...
bool tileCollide
If true, the projectile will collide with tiles, usually bouncing or killing the tile depending on M:...
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...
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...