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

◆ WallslideMovement()

void Terraria.Player.WallslideMovement ( )
inline

Definition at line 19745 of file Player.cs.

19746 {
19747 //IL_043d: Unknown result type (might be due to invalid IL or missing references)
19748 //IL_0453: Unknown result type (might be due to invalid IL or missing references)
19749 //IL_0459: Unknown result type (might be due to invalid IL or missing references)
19750 //IL_0216: Unknown result type (might be due to invalid IL or missing references)
19751 //IL_022c: Unknown result type (might be due to invalid IL or missing references)
19752 //IL_0232: Unknown result type (might be due to invalid IL or missing references)
19753 //IL_04bc: Unknown result type (might be due to invalid IL or missing references)
19754 //IL_04c6: Unknown result type (might be due to invalid IL or missing references)
19755 //IL_04cb: Unknown result type (might be due to invalid IL or missing references)
19756 //IL_0295: Unknown result type (might be due to invalid IL or missing references)
19757 //IL_029f: Unknown result type (might be due to invalid IL or missing references)
19758 //IL_02a4: Unknown result type (might be due to invalid IL or missing references)
19759 sliding = false;
19760 if (slideDir == 0 || spikedBoots <= 0 || mount.Active || ((!controlLeft || slideDir != -1) && (!controlRight || slideDir != 1)))
19761 {
19762 return;
19763 }
19764 bool flag = false;
19765 float num = position.X;
19766 if (slideDir == 1)
19767 {
19768 num += (float)width;
19769 }
19770 num += (float)slideDir;
19771 float num2 = position.Y + (float)height + 1f;
19772 if (gravDir < 0f)
19773 {
19774 num2 = position.Y - 1f;
19775 }
19776 num /= 16f;
19777 num2 /= 16f;
19778 if (WorldGen.SolidTile((int)num, (int)num2) && WorldGen.SolidTile((int)num, (int)num2 - 1))
19779 {
19780 flag = true;
19781 }
19782 if (spikedBoots >= 2)
19783 {
19784 if (!flag || ((!(velocity.Y > 0f) || gravDir != 1f) && (!(velocity.Y < gravity) || gravDir != -1f)))
19785 {
19786 return;
19787 }
19788 float num3 = gravity;
19789 if (slowFall)
19790 {
19791 num3 = ((!TryingToHoverUp) ? (gravity / 3f * gravDir) : (gravity / 10f * gravDir));
19792 }
19793 fallStart = (int)(position.Y / 16f);
19794 if ((controlDown && gravDir == 1f) || (controlUp && gravDir == -1f))
19795 {
19796 velocity.Y = 4f * gravDir;
19797 int num4 = Dust.NewDust(new Vector2(position.X + (float)(width / 2) + (float)((width / 2 - 4) * slideDir), position.Y + (float)(height / 2) + (float)(height / 2 - 4) * gravDir), 8, 8, 31);
19798 if (slideDir < 0)
19799 {
19800 Main.dust[num4].position.X -= 10f;
19801 }
19802 if (gravDir < 0f)
19803 {
19804 Main.dust[num4].position.Y -= 12f;
19805 }
19806 Dust obj = Main.dust[num4];
19807 obj.velocity *= 0.1f;
19808 Main.dust[num4].scale *= 1.2f;
19809 Main.dust[num4].noGravity = true;
19810 Main.dust[num4].shader = GameShaders.Armor.GetSecondaryShader(cShoe, this);
19811 }
19812 else if (gravDir == -1f)
19813 {
19814 velocity.Y = (0f - num3 + 1E-05f) * gravDir;
19815 }
19816 else
19817 {
19818 velocity.Y = (0f - num3 + 1E-05f) * gravDir;
19819 }
19820 sliding = true;
19821 }
19822 else if ((flag && (double)velocity.Y > 0.5 && gravDir == 1f) || ((double)velocity.Y < -0.5 && gravDir == -1f))
19823 {
19824 fallStart = (int)(position.Y / 16f);
19825 if (controlDown)
19826 {
19827 velocity.Y = 4f * gravDir;
19828 }
19829 else
19830 {
19831 velocity.Y = 0.5f * gravDir;
19832 }
19833 sliding = true;
19834 int num5 = Dust.NewDust(new Vector2(position.X + (float)(width / 2) + (float)((width / 2 - 4) * slideDir), position.Y + (float)(height / 2) + (float)(height / 2 - 4) * gravDir), 8, 8, 31);
19835 if (slideDir < 0)
19836 {
19837 Main.dust[num5].position.X -= 10f;
19838 }
19839 if (gravDir < 0f)
19840 {
19841 Main.dust[num5].position.Y -= 12f;
19842 }
19843 Dust obj2 = Main.dust[num5];
19844 obj2.velocity *= 0.1f;
19845 Main.dust[num5].scale *= 1.2f;
19846 Main.dust[num5].noGravity = true;
19847 Main.dust[num5].shader = GameShaders.Armor.GetSecondaryShader(cShoe, this);
19848 }
19849 }
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
static ArmorShaderDataSet Armor
Definition GameShaders.cs:7
bool Active
Definition Mount.cs:348
bool controlRight
Definition Player.cs:1896
int spikedBoots
Used by the Shoe Spikes and Climbing Claws to allow for holding onto walls (of tiles,...
Definition Player.cs:1309
Mount mount
This player's T:Terraria.Mount. Do not overwrite this value. Instead, call M:Terraria....
Definition Player.cs:2323
bool TryingToHoverUp
Definition Player.cs:4263

References Terraria.Mount.Active, Terraria.Graphics.Shaders.GameShaders.Armor, Terraria.Player.controlDown, Terraria.Player.controlLeft, Terraria.Player.controlRight, Terraria.Player.controlUp, Terraria.Player.cShoe, Terraria.Main.dust, Terraria.Player.fallStart, Terraria.Player.gravDir, Terraria.Player.gravity, Terraria.Entity.height, Terraria.Player.mount, Terraria.Dust.NewDust(), Terraria.Entity.position, Terraria.Player.slideDir, Terraria.Player.sliding, Terraria.Player.slowFall, Terraria.WorldGen.SolidTile(), Terraria.Player.spikedBoots, Terraria.Player.TryingToHoverUp, Terraria.Entity.velocity, 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: