Terraria.Player.Yoraiz0rEye C# (CSharp) Method

Yoraiz0rEye() public method

public Yoraiz0rEye ( ) : void
return void
        public void Yoraiz0rEye()
        {
            int index = 0 + this.bodyFrame.Y / 56;
            if (index >= Main.OffsetsPlayerHeadgear.Length)
                index = 0;
            Vector2 spinningpoint1 = new Vector2((float)(3 * this.direction - (this.direction == 1 ? 1 : 0)), -11.5f * this.gravDir) + Vector2.UnitY * this.gfxOffY + this.Size / 2f + Main.OffsetsPlayerHeadgear[index];
            Vector2 spinningpoint2 = new Vector2((float)(3 * this.shadowDirection[1] - (this.direction == 1 ? 1 : 0)), -11.5f * this.gravDir) + this.Size / 2f + Main.OffsetsPlayerHeadgear[index];
            Vector2 vector2_1 = Vector2.Zero;
            if (this.mount.Active && this.mount.Cart)
            {
                int num = Math.Sign(this.velocity.X);
                if (num == 0)
                    num = this.direction;
                vector2_1 = Utils.RotatedBy(new Vector2(MathHelper.Lerp(0.0f, -8f, this.fullRotation / 0.7853982f), MathHelper.Lerp(0.0f, 2f, Math.Abs(this.fullRotation / 0.7853982f))), (double)this.fullRotation, new Vector2());
                if (num == Math.Sign(this.fullRotation))
                    vector2_1 *= MathHelper.Lerp(1f, 0.6f, Math.Abs(this.fullRotation / 0.7853982f));
            }
            if ((double)this.fullRotation != 0.0)
            {
                spinningpoint1 = Utils.RotatedBy(spinningpoint1, (double)this.fullRotation, this.fullRotationOrigin);
                spinningpoint2 = Utils.RotatedBy(spinningpoint2, (double)this.fullRotation, this.fullRotationOrigin);
            }
            Vector2 vector2_2 = this.position + spinningpoint1 + vector2_1;
            Vector2 vector2_3 = this.oldPosition + spinningpoint2 + vector2_1;
            float num1 = 1f;
            switch (this.yoraiz0rEye % 10)
            {
                case 1:
                    return;
                case 2:
                    num1 = 0.5f;
                    break;
                case 3:
                    num1 = 0.625f;
                    break;
                case 4:
                    num1 = 0.75f;
                    break;
                case 5:
                    num1 = 0.875f;
                    break;
                case 6:
                    num1 = 1f;
                    break;
                case 7:
                    num1 = 1.1f;
                    break;
            }
            if (this.yoraiz0rEye < 7)
            {
                DelegateMethods.v3_1 = Main.hslToRgb(Main.rgbToHsl(this.eyeColor).X, 1f, 0.5f).ToVector3() * 0.5f * num1;
                if (this.velocity != Vector2.Zero)
                    Utils.PlotTileLine(this.Center, this.Center + this.velocity * 2f, 4f, new Utils.PerLinePoint(DelegateMethods.CastLightOpen));
                else
                    Utils.PlotTileLine(this.Left, this.Right, 4f, new Utils.PerLinePoint(DelegateMethods.CastLightOpen));
            }
            int num2 = (int)Vector2.Distance(vector2_2, vector2_3) / 3 + 1;
            if ((double)Vector2.Distance(vector2_2, vector2_3) % 3.0 != 0.0)
                ++num2;
            for (float num3 = 1f; (double)num3 <= (double)num2; ++num3)
            {
                Dust dust = Main.dust[Dust.NewDust(this.Center, 0, 0, 182, 0.0f, 0.0f, 0, new Color(), 1f)];
                dust.position = Vector2.Lerp(vector2_3, vector2_2, num3 / (float)num2);
                dust.noGravity = true;
                dust.velocity = Vector2.Zero;
                dust.customData = (object)this;
                dust.scale = num1;
                dust.shader = GameShaders.Armor.GetSecondaryShader(this.cYorai, this);
            }
        }
Player