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

◆ DryCollision()

void Terraria.Player.DryCollision ( bool fallThrough,
bool ignorePlats )
inline

Definition at line 21728 of file Player.cs.

21729 {
21730 //IL_0396: Unknown result type (might be due to invalid IL or missing references)
21731 //IL_039c: Unknown result type (might be due to invalid IL or missing references)
21732 //IL_03b1: Unknown result type (might be due to invalid IL or missing references)
21733 //IL_03b6: Unknown result type (might be due to invalid IL or missing references)
21734 //IL_0030: Unknown result type (might be due to invalid IL or missing references)
21735 //IL_0036: Unknown result type (might be due to invalid IL or missing references)
21736 //IL_004b: Unknown result type (might be due to invalid IL or missing references)
21737 //IL_005d: Unknown result type (might be due to invalid IL or missing references)
21738 //IL_0062: Unknown result type (might be due to invalid IL or missing references)
21739 //IL_0067: Unknown result type (might be due to invalid IL or missing references)
21740 //IL_0080: Unknown result type (might be due to invalid IL or missing references)
21741 //IL_0085: Unknown result type (might be due to invalid IL or missing references)
21742 //IL_03e7: Unknown result type (might be due to invalid IL or missing references)
21743 //IL_03ee: Unknown result type (might be due to invalid IL or missing references)
21744 //IL_03f4: Unknown result type (might be due to invalid IL or missing references)
21745 //IL_040d: Unknown result type (might be due to invalid IL or missing references)
21746 //IL_0412: Unknown result type (might be due to invalid IL or missing references)
21747 //IL_0418: Unknown result type (might be due to invalid IL or missing references)
21748 //IL_043e: Unknown result type (might be due to invalid IL or missing references)
21749 //IL_0444: Unknown result type (might be due to invalid IL or missing references)
21750 //IL_0449: Unknown result type (might be due to invalid IL or missing references)
21751 //IL_044e: Unknown result type (might be due to invalid IL or missing references)
21752 //IL_00d4: Unknown result type (might be due to invalid IL or missing references)
21753 //IL_038d: Unknown result type (might be due to invalid IL or missing references)
21754 //IL_038e: Unknown result type (might be due to invalid IL or missing references)
21755 //IL_00f7: Unknown result type (might be due to invalid IL or missing references)
21756 //IL_00fa: Unknown result type (might be due to invalid IL or missing references)
21757 //IL_00ff: Unknown result type (might be due to invalid IL or missing references)
21758 //IL_0102: Unknown result type (might be due to invalid IL or missing references)
21759 //IL_0104: Unknown result type (might be due to invalid IL or missing references)
21760 //IL_0110: Unknown result type (might be due to invalid IL or missing references)
21761 //IL_0115: Unknown result type (might be due to invalid IL or missing references)
21762 //IL_0269: Unknown result type (might be due to invalid IL or missing references)
21763 //IL_026e: Unknown result type (might be due to invalid IL or missing references)
21764 //IL_0280: Unknown result type (might be due to invalid IL or missing references)
21765 //IL_0285: Unknown result type (might be due to invalid IL or missing references)
21766 //IL_02b3: Unknown result type (might be due to invalid IL or missing references)
21767 //IL_02b9: Unknown result type (might be due to invalid IL or missing references)
21768 //IL_02be: Unknown result type (might be due to invalid IL or missing references)
21769 //IL_02d4: Unknown result type (might be due to invalid IL or missing references)
21770 //IL_02d9: Unknown result type (might be due to invalid IL or missing references)
21771 //IL_02dc: Unknown result type (might be due to invalid IL or missing references)
21772 //IL_0302: Unknown result type (might be due to invalid IL or missing references)
21773 //IL_0307: Unknown result type (might be due to invalid IL or missing references)
21774 //IL_0309: Unknown result type (might be due to invalid IL or missing references)
21775 //IL_030e: Unknown result type (might be due to invalid IL or missing references)
21776 //IL_0316: Unknown result type (might be due to invalid IL or missing references)
21777 //IL_0328: Unknown result type (might be due to invalid IL or missing references)
21778 //IL_0341: Unknown result type (might be due to invalid IL or missing references)
21779 //IL_0343: Unknown result type (might be due to invalid IL or missing references)
21780 //IL_0371: Unknown result type (might be due to invalid IL or missing references)
21781 //IL_0376: Unknown result type (might be due to invalid IL or missing references)
21782 //IL_0378: Unknown result type (might be due to invalid IL or missing references)
21783 //IL_0379: Unknown result type (might be due to invalid IL or missing references)
21784 //IL_037b: Unknown result type (might be due to invalid IL or missing references)
21785 //IL_0380: Unknown result type (might be due to invalid IL or missing references)
21786 int num = ((!onTrack) ? height : (height - 10));
21787 if (((Vector2)(ref velocity)).Length() > 16f)
21788 {
21789 Vector2 val = Collision.TileCollision(position, velocity, width, num, fallThrough, ignorePlats, (int)gravDir);
21790 float num2 = ((Vector2)(ref velocity)).Length();
21791 Vector2 vector2 = Vector2.Normalize(velocity);
21792 if (val.Y == 0f)
21793 {
21794 vector2.Y = 0f;
21795 }
21796 Vector2 zero = Vector2.Zero;
21797 bool flag = mount.Type == 7 || mount.Type == 8 || mount.Type == 12 || mount.Type == 44 || mount.Type == 49;
21798 _ = Vector2.Zero;
21799 while (num2 > 0f)
21800 {
21801 float num3 = num2;
21802 if (num3 > 16f)
21803 {
21804 num3 = 16f;
21805 }
21806 num2 -= num3;
21807 Vector2 vector3 = vector2 * num3;
21808 velocity = vector3;
21810 vector3 = velocity;
21811 if (velocity.Y == gravity && (!mount.Active || (!mount.Cart && mount.Type != 48 && !flag)))
21812 {
21813 Collision.StepDown(ref position, ref vector3, width, height, ref stepSpeed, ref gfxOffY, (int)gravDir, waterWalk || waterWalk2);
21814 }
21815 if (gravDir == -1f)
21816 {
21817 if ((carpetFrame != -1 || velocity.Y <= gravity) && !controlUp)
21818 {
21819 Collision.StepUp(ref position, ref vector3, width, height, ref stepSpeed, ref gfxOffY, (int)gravDir, controlUp);
21820 }
21821 }
21822 else if (flag || ((carpetFrame != -1 || velocity.Y >= gravity) && !controlDown && !mount.Cart))
21823 {
21824 Collision.StepUp(ref position, ref vector3, width, height, ref stepSpeed, ref gfxOffY, (int)gravDir, controlUp);
21825 }
21826 Vector2 vector4 = Collision.TileCollision(position, vector3, width, num, fallThrough, ignorePlats, (int)gravDir);
21827 if (Collision.up && gravDir == 1f)
21828 {
21829 jump = 0;
21830 }
21831 if (waterWalk || waterWalk2)
21832 {
21833 Vector2 val2 = velocity;
21834 vector4 = Collision.WaterCollision(position, vector4, width, height, fallThrough, fall2: false, waterWalk);
21835 if (val2 != velocity)
21836 {
21837 fallStart = (int)(position.Y / 16f);
21838 }
21839 }
21840 position += vector4;
21841 bool falling = false;
21842 if (vector4.Y > gravity)
21843 {
21844 falling = true;
21845 }
21846 if (vector4.Y < 0f - gravity)
21847 {
21848 falling = true;
21849 }
21850 velocity = vector4;
21852 TryBouncingBlocks(falling);
21855 Collision.StepConveyorBelt(this, gravDir);
21856 vector4 = velocity;
21857 zero += vector4;
21858 }
21859 velocity = zero;
21860 return;
21861 }
21862 velocity = Collision.TileCollision(position, velocity, width, num, fallThrough, ignorePlats, (int)gravDir);
21863 if (Collision.up && gravDir == 1f)
21864 {
21865 jump = 0;
21866 }
21867 if (waterWalk || waterWalk2)
21868 {
21869 Vector2 val3 = velocity;
21870 velocity = Collision.WaterCollision(position, velocity, width, height, fallThrough, fall2: false, waterWalk);
21871 if (val3 != velocity)
21872 {
21873 fallStart = (int)(position.Y / 16f);
21874 }
21875 }
21876 position += velocity;
21877 }
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
bool Active
Definition Mount.cs:348
float stepSpeed
Definition Player.cs:1816
Mount mount
This player's T:Terraria.Mount. Do not overwrite this value. Instead, call M:Terraria....
Definition Player.cs:2323
void SlopingCollision(bool fallThrough, bool ignorePlats)
Definition Player.cs:22001
void UpdateTouchingTiles()
Definition Player.cs:58128
void SlopeDownMovement()
Definition Player.cs:21547
float gfxOffY
An offset from the actual position of the player that will be added to the draw position....
Definition Player.cs:1814
void TryBouncingBlocks(bool Falling)
Definition Player.cs:33502
void TryLandingOnDetonator()
Definition Player.cs:33477

References Terraria.Mount.Active, Terraria.Player.carpetFrame, Terraria.Mount.Cart, Terraria.Player.controlDown, Terraria.Player.controlUp, Terraria.Player.fallStart, Terraria.Player.gfxOffY, Terraria.Player.gravDir, Terraria.Player.gravity, Terraria.Entity.height, Terraria.Player.jump, Terraria.Player.mount, Terraria.Player.onTrack, Terraria.Entity.position, Terraria.Player.SlopeDownMovement(), Terraria.Player.SlopingCollision(), Terraria.Collision.StepConveyorBelt(), Terraria.Collision.StepDown(), Terraria.Player.stepSpeed, Terraria.Collision.StepUp(), Terraria.Collision.TileCollision(), Terraria.Player.TryBouncingBlocks(), Terraria.Player.TryLandingOnDetonator(), Terraria.Mount.Type, Terraria.Collision.up, Terraria.Player.UpdateTouchingTiles(), Terraria.Entity.velocity, Terraria.Collision.WaterCollision(), Terraria.Player.waterWalk, Terraria.Player.waterWalk2, and Terraria.Entity.width.

Referenced by Terraria.Player.Update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: