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

◆ TryBouncingBlocks()

void Terraria.Player.TryBouncingBlocks ( bool Falling)
inlineprivate

Definition at line 33502 of file Player.cs.

33503 {
33504 //IL_0060: Unknown result type (might be due to invalid IL or missing references)
33505 //IL_0065: Unknown result type (might be due to invalid IL or missing references)
33506 //IL_006c: Unknown result type (might be due to invalid IL or missing references)
33507 //IL_0073: Unknown result type (might be due to invalid IL or missing references)
33508 //IL_00b2: Unknown result type (might be due to invalid IL or missing references)
33509 //IL_0162: Unknown result type (might be due to invalid IL or missing references)
33510 //IL_0167: Unknown result type (might be due to invalid IL or missing references)
33511 //IL_0169: Unknown result type (might be due to invalid IL or missing references)
33512 //IL_0189: Unknown result type (might be due to invalid IL or missing references)
33513 //IL_01a6: Unknown result type (might be due to invalid IL or missing references)
33514 //IL_01fb: Unknown result type (might be due to invalid IL or missing references)
33515 //IL_01ff: Unknown result type (might be due to invalid IL or missing references)
33516 //IL_0204: Unknown result type (might be due to invalid IL or missing references)
33517 //IL_0211: Unknown result type (might be due to invalid IL or missing references)
33518 //IL_0222: Unknown result type (might be due to invalid IL or missing references)
33519 //IL_0229: Unknown result type (might be due to invalid IL or missing references)
33520 //IL_022e: Unknown result type (might be due to invalid IL or missing references)
33521 //IL_0233: Unknown result type (might be due to invalid IL or missing references)
33522 //IL_0236: Unknown result type (might be due to invalid IL or missing references)
33523 //IL_023b: Unknown result type (might be due to invalid IL or missing references)
33524 //IL_0249: Unknown result type (might be due to invalid IL or missing references)
33525 //IL_024b: Unknown result type (might be due to invalid IL or missing references)
33526 bool num7 = !wet && !shimmering && (velocity.Y >= 5f || velocity.Y <= -5f);
33527 bool flag = false;
33528 bool flag2 = false;
33529 float num2 = 1f;
33530 if (!num7)
33531 {
33532 return;
33533 }
33534 bool flag3 = false;
33535 int num3 = 0;
33536 foreach (Point touchedTile in TouchedTiles)
33537 {
33538 Tile tile = Main.tile[touchedTile.X, touchedTile.Y];
33539 if (tile != null && tile.active() && tile.nactive() && (flag || Main.tileBouncy[tile.type]))
33540 {
33541 flag3 = true;
33542 num3 = touchedTile.Y;
33543 break;
33544 }
33545 }
33546 if (!flag3)
33547 {
33548 return;
33549 }
33550 velocity.Y *= -0.8f;
33551 if (controlJump)
33552 {
33553 velocity.Y = MathHelper.Clamp(velocity.Y, -13f, 13f);
33554 }
33555 position.Y = num3 * 16 - ((velocity.Y < 0f) ? height : (-16));
33556 FloorVisuals(Falling);
33557 if (flag2)
33558 {
33559 Vector2 vector = (fullRotation - (float)Math.PI / 2f).ToRotationVector2();
33560 if (vector.Y > 0f)
33561 {
33562 vector.Y *= -1f;
33563 }
33564 vector.Y = vector.Y * 0.5f + -0.5f;
33565 float num4 = 0f - vector.Y;
33566 if (num4 < 0f)
33567 {
33568 num4 = 0f;
33569 }
33570 float num5 = num4 * 1.5f + 1f;
33571 float value = Math.Abs(velocity.Y) * num5 * num2;
33572 value = MathHelper.Clamp(value, 2f, 16f);
33573 velocity = vector * value;
33574 float num6 = 20f;
33575 Vector2 vector2 = base.Center + (fullRotation + (float)Math.PI / 2f).ToRotationVector2() * num6;
33576 vector2 = base.Bottom;
33578 {
33579 PositionInWorld = vector2
33580 }, whoAmI);
33581 }
33582 velocity.Y = MathHelper.Clamp(velocity.Y, -20f, 20f);
33583 if (velocity.Y * gravDir < 0f)
33584 {
33585 fallStart = (int)position.Y / 16;
33586 }
33587 }
bool wet
The Entity is currently in water. Projectile: Affects movement speed and some projectiles die when ...
Definition Entity.cs:57
int whoAmI
The index of this Entity within its specific array. These arrays track the entities in the world....
Definition Entity.cs:16
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 height
The height of this Entity's hitbox, in pixels.
Definition Entity.cs:51
static void RequestParticleSpawn(bool clientOnly, ParticleOrchestraType type, ParticleOrchestraSettings settings, int? overrideInvokingPlayerIndex=null)
List< Point > TouchedTiles
Definition Player.cs:3123
void FloorVisuals(bool Falling)
Definition Player.cs:22043
float fullRotation
Definition Player.cs:1801

References Terraria.Tile.active(), Terraria.Player.controlJump, Terraria.Player.fallStart, Terraria.Player.FloorVisuals(), Terraria.Player.fullRotation, Terraria.Player.gravDir, Terraria.Entity.height, Terraria.Tile.nactive(), Terraria.Entity.position, Terraria.GameContent.Drawing.ParticleOrchestrator.RequestParticleSpawn(), Terraria.Player.shimmering, Terraria.Main.tile, Terraria.Main.tileBouncy, Terraria.Player.TouchedTiles, Terraria.Tile.type, Terraria.Entity.velocity, Terraria.Entity.wet, and Terraria.Entity.whoAmI.

Referenced by Terraria.Player.DryCollision(), and Terraria.Player.Update().

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