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

◆ CanHitWithOwnBody()

bool Terraria.Projectile.CanHitWithOwnBody ( Entity ent)
inline

Definition at line 11518 of file Projectile.cs.

11519 {
11520 //IL_0002: Unknown result type (might be due to invalid IL or missing references)
11521 //IL_0017: Unknown result type (might be due to invalid IL or missing references)
11522 //IL_0029: Unknown result type (might be due to invalid IL or missing references)
11523 //IL_0045: Unknown result type (might be due to invalid IL or missing references)
11524 //IL_0064: Unknown result type (might be due to invalid IL or missing references)
11525 //IL_0069: Unknown result type (might be due to invalid IL or missing references)
11526 //IL_0071: Unknown result type (might be due to invalid IL or missing references)
11527 //IL_0085: Unknown result type (might be due to invalid IL or missing references)
11528 //IL_008a: Unknown result type (might be due to invalid IL or missing references)
11529 //IL_009c: Unknown result type (might be due to invalid IL or missing references)
11530 //IL_00bb: Unknown result type (might be due to invalid IL or missing references)
11531 //IL_00c0: Unknown result type (might be due to invalid IL or missing references)
11532 //IL_00c8: Unknown result type (might be due to invalid IL or missing references)
11533 //IL_00d7: Unknown result type (might be due to invalid IL or missing references)
11534 //IL_00f1: Unknown result type (might be due to invalid IL or missing references)
11535 //IL_00f6: Unknown result type (might be due to invalid IL or missing references)
11536 //IL_00fe: Unknown result type (might be due to invalid IL or missing references)
11537 //IL_0111: Unknown result type (might be due to invalid IL or missing references)
11538 //IL_0116: Unknown result type (might be due to invalid IL or missing references)
11539 //IL_0151: Unknown result type (might be due to invalid IL or missing references)
11540 //IL_0162: Unknown result type (might be due to invalid IL or missing references)
11541 //IL_0167: Unknown result type (might be due to invalid IL or missing references)
11542 //IL_016c: Unknown result type (might be due to invalid IL or missing references)
11543 //IL_016e: Unknown result type (might be due to invalid IL or missing references)
11544 //IL_017f: Unknown result type (might be due to invalid IL or missing references)
11545 //IL_0184: Unknown result type (might be due to invalid IL or missing references)
11546 //IL_0189: Unknown result type (might be due to invalid IL or missing references)
11547 //IL_0217: Unknown result type (might be due to invalid IL or missing references)
11548 //IL_021a: Unknown result type (might be due to invalid IL or missing references)
11549 //IL_0192: Unknown result type (might be due to invalid IL or missing references)
11550 //IL_0197: Unknown result type (might be due to invalid IL or missing references)
11551 //IL_01d4: Unknown result type (might be due to invalid IL or missing references)
11552 //IL_01d9: Unknown result type (might be due to invalid IL or missing references)
11553 //IL_01c1: Unknown result type (might be due to invalid IL or missing references)
11554 //IL_01cd: Unknown result type (might be due to invalid IL or missing references)
11555 //IL_01d2: Unknown result type (might be due to invalid IL or missing references)
11556 //IL_0203: Unknown result type (might be due to invalid IL or missing references)
11557 //IL_020f: Unknown result type (might be due to invalid IL or missing references)
11558 //IL_0214: Unknown result type (might be due to invalid IL or missing references)
11559 if (Distance(ent.Center) > ownerHitCheckDistance)
11560 {
11561 return false;
11562 }
11563 bool flag = Collision.CanHit(base.position, width, height, ent.position, ent.width, ent.height) || Collision.CanHitLine(base.Center + new Vector2((float)(direction * width / 2), (float)(-height / 3)), 0, 0, ent.Center + new Vector2(0f, (float)(-ent.height / 3)), 0, 0) || Collision.CanHitLine(base.Center + new Vector2((float)(direction * width / 2), (float)(-height / 3)), 0, 0, ent.Center, 0, 0) || Collision.CanHitLine(base.Center + new Vector2((float)(direction * width / 2), 0f), 0, 0, ent.Center + new Vector2(0f, (float)(ent.height / 3)), 0, 0);
11565 if (num != 0f)
11566 {
11567 if (flag)
11568 {
11569 return flag;
11570 }
11572 Vector2 position = base.Top + new Vector2(0f, 0f - num);
11573 Vector2 position2 = ent.Top + new Vector2(0f, 0f - num);
11574 if (genSearch != null)
11575 {
11577 {
11578 position = result.ToWorldCoordinates();
11579 }
11581 {
11582 position2 = result.ToWorldCoordinates();
11583 }
11584 }
11585 flag |= Collision.CanHitLine(position, 0, 0, position2, 0, 0);
11586 }
11587 return flag;
11588 }
float Distance(Vector2 Other)
Definition Entity.cs:275
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
static GenSearch[] ExtendedCanHitCheckSearch
A T:Terraria.WorldBuilding.GenSearch to use when checking for collisions, in addition to standard hit...
static float[] ExtendedCanHitCheckRange
If non-zero, then the given projectile type (F:Terraria.Projectile.type) will check for collisions th...
static Conditions.NotNull _cachedConditions_notNull
int type
The Projectile ID of this projectile. The Projectile ID is a unique number assigned to each Projectil...
static Conditions.IsSolid _cachedConditions_solid
static GenSearch Chain(GenSearch search, params GenCondition[] conditions)
Definition Searches.cs:154
static bool Find(Point origin, GenSearch search, out Point result)
Definition WorldUtils.cs:30

References Terraria.Projectile._cachedConditions_notNull, Terraria.Projectile._cachedConditions_solid, Terraria.Collision.CanHit(), Terraria.Collision.CanHitLine(), Terraria.WorldBuilding.Searches.Chain(), Terraria.Entity.direction, Terraria.Entity.Distance(), Terraria.ID.ProjectileID.Sets.ExtendedCanHitCheckRange, Terraria.ID.ProjectileID.Sets.ExtendedCanHitCheckSearch, Terraria.WorldBuilding.WorldUtils.Find(), Terraria.Entity.height, Terraria.Projectile.ownerHitCheckDistance, Terraria.Entity.position, Terraria.Projectile.type, and Terraria.Entity.width.

+ Here is the call graph for this function: