Terraria.Player.FloorVisuals C# (CSharp) Method

FloorVisuals() public method

public FloorVisuals ( bool Falling ) : void
Falling bool
return void
        public void FloorVisuals(bool Falling)
        {
            int index1 = (int)(((double)this.position.X + (double)(this.width / 2)) / 16.0);
            int index2 = (int)(((double)this.position.Y + (double)this.height) / 16.0);
            if ((double)this.gravDir == -1.0)
                index2 = (int)((double)this.position.Y - 0.100000001490116) / 16;
            int num1 = -1;
            if (Main.tile[index1 - 1, index2] == null)
                Main.tile[index1 - 1, index2] = new Tile();
            if (Main.tile[index1 + 1, index2] == null)
                Main.tile[index1 + 1, index2] = new Tile();
            if (Main.tile[index1, index2] == null)
                Main.tile[index1, index2] = new Tile();
            if (Main.tile[index1, index2].nactive() && Main.tileSolid[(int)Main.tile[index1, index2].type])
                num1 = (int)Main.tile[index1, index2].type;
            else if (Main.tile[index1 - 1, index2].nactive() && Main.tileSolid[(int)Main.tile[index1 - 1, index2].type])
                num1 = (int)Main.tile[index1 - 1, index2].type;
            else if (Main.tile[index1 + 1, index2].nactive() && Main.tileSolid[(int)Main.tile[index1 + 1, index2].type])
                num1 = (int)Main.tile[index1 + 1, index2].type;
            if (num1 <= -1)
            {
                this.slippy = false;
                this.slippy2 = false;
                this.sticky = false;
                this.powerrun = false;
            }
            else
            {
                this.sticky = num1 == 229;
                this.slippy = num1 == 161 || num1 == 162 || (num1 == 163 || num1 == 164) || num1 == 200 || num1 == (int)sbyte.MaxValue;
                this.slippy2 = num1 == 197;
                this.powerrun = num1 == 198;
                if ((int)Main.tile[index1 - 1, index2].slope() != 0 || (int)Main.tile[index1, index2].slope() != 0 || (int)Main.tile[index1 + 1, index2].slope() != 0)
                    num1 = -1;
                if (this.wet || this.mount.Cart || num1 != 147 && num1 != 25 && (num1 != 53 && num1 != 189) && (num1 != 0 && num1 != 123 && (num1 != 57 && num1 != 112)) && (num1 != 116 && num1 != 196 && (num1 != 193 && num1 != 195) && (num1 != 197 && num1 != 199 && (num1 != 229 && num1 != 371))))
                    return;
                int num2 = 1;
                if (Falling)
                    num2 = 20;
                for (int index3 = 0; index3 < num2; ++index3)
                {
                    bool flag = true;
                    int Type = 76;
                    if (num1 == 53)
                        Type = 32;
                    if (num1 == 189)
                        Type = 16;
                    if (num1 == 0)
                        Type = 0;
                    if (num1 == 123)
                        Type = 53;
                    if (num1 == 57)
                        Type = 36;
                    if (num1 == 112)
                        Type = 14;
                    if (num1 == 116)
                        Type = 51;
                    if (num1 == 196)
                        Type = 108;
                    if (num1 == 193)
                        Type = 4;
                    if (num1 == 195 || num1 == 199)
                        Type = 5;
                    if (num1 == 197)
                        Type = 4;
                    if (num1 == 229)
                        Type = 153;
                    if (num1 == 371)
                        Type = 243;
                    if (num1 == 25)
                        Type = 37;
                    if (Type == 32 && Main.rand.Next(2) == 0)
                        flag = false;
                    if (Type == 14 && Main.rand.Next(2) == 0)
                        flag = false;
                    if (Type == 51 && Main.rand.Next(2) == 0)
                        flag = false;
                    if (Type == 36 && Main.rand.Next(2) == 0)
                        flag = false;
                    if (Type == 0 && Main.rand.Next(3) != 0)
                        flag = false;
                    if (Type == 53 && Main.rand.Next(3) != 0)
                        flag = false;
                    Color newColor = new Color();
                    if (num1 == 193)
                        newColor = new Color(30, 100, (int)byte.MaxValue, 100);
                    if (num1 == 197)
                        newColor = new Color(97, 200, (int)byte.MaxValue, 100);
                    if (!Falling)
                    {
                        float num3 = Math.Abs(this.velocity.X) / 3f;
                        if ((double)Main.rand.Next(100) > (double)num3 * 100.0)
                            flag = false;
                    }
                    if (flag)
                    {
                        float num3 = this.velocity.X;
                        if ((double)num3 > 6.0)
                            num3 = 6f;
                        if ((double)num3 < -6.0)
                            num3 = -6f;
                        if ((double)this.velocity.X != 0.0 || Falling)
                        {
                            int index4 = Dust.NewDust(new Vector2(this.position.X, (float)((double)this.position.Y + (double)this.height - 2.0)), this.width, 6, Type, 0.0f, 0.0f, 50, newColor, 1f);
                            if ((double)this.gravDir == -1.0)
                                Main.dust[index4].position.Y -= (float)(this.height + 4);
                            if (Type == 76)
                            {
                                Main.dust[index4].scale += (float)Main.rand.Next(3) * 0.1f;
                                Main.dust[index4].noLight = true;
                            }
                            if (Type == 16 || Type == 108 || Type == 153)
                                Main.dust[index4].scale += (float)Main.rand.Next(6) * 0.1f;
                            if (Type == 37)
                            {
                                Main.dust[index4].scale += 0.25f;
                                Main.dust[index4].alpha = 50;
                            }
                            if (Type == 5)
                                Main.dust[index4].scale += (float)Main.rand.Next(2, 8) * 0.1f;
                            Main.dust[index4].noGravity = true;
                            if (num2 > 1)
                            {
                                Main.dust[index4].velocity.X *= 1.2f;
                                Main.dust[index4].velocity.Y *= 0.8f;
                                --Main.dust[index4].velocity.Y;
                                Main.dust[index4].velocity *= 0.8f;
                                Main.dust[index4].scale += (float)Main.rand.Next(3) * 0.1f;
                                Main.dust[index4].velocity.X = (float)(((double)Main.dust[index4].position.X - ((double)this.position.X + (double)(this.width / 2))) * 0.200000002980232);
                                if ((double)Main.dust[index4].velocity.Y > 0.0)
                                    Main.dust[index4].velocity.Y *= -1f;
                                Main.dust[index4].velocity.X += num3 * 0.3f;
                            }
                            else
                                Main.dust[index4].velocity *= 0.2f;
                            Main.dust[index4].position.X -= num3 * 1f;
                            if ((double)this.gravDir == -1.0)
                                Main.dust[index4].velocity.Y *= -1f;
                        }
                    }
                }
            }
        }
Player