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

◆ Yoraiz0rEye()

void Terraria.Player.Yoraiz0rEye ( )
inline

Definition at line 11862 of file Player.cs.

11863 {
11864 int num = 0;
11865 num += bodyFrame.Y / 56;
11866 if (num >= Main.OffsetsPlayerHeadgear.Length)
11867 {
11868 num = 0;
11869 }
11870 Vector2 vector = Main.OffsetsPlayerHeadgear[num];
11871 vector *= Directions;
11872 Vector2 vector2 = new Vector2(width / 2, height / 2) + vector + (MountedCenter - base.Center);
11875 if (face == 19)
11876 {
11877 vector2.Y -= 5f * gravDir;
11878 }
11879 if (head == 276)
11880 {
11881 vector2.X += 2.5f * (float)direction;
11882 }
11883 if (mount.Active && mount.Type == 52)
11884 {
11885 vector2.X += 14f * (float)direction;
11886 vector2.Y -= 2f * gravDir;
11887 }
11888 float y = -11.5f * gravDir;
11889 Vector2 vector3 = new Vector2(3 * direction - ((direction == 1) ? 1 : 0), y) + Vector2.UnitY * gfxOffY + vector2;
11890 Vector2 vector4 = new Vector2(3 * shadowDirection[1] - ((direction == 1) ? 1 : 0), y) + vector2;
11892 if (mount.Active && mount.Cart)
11893 {
11894 int num2 = Math.Sign(velocity.X);
11895 if (num2 == 0)
11896 {
11897 num2 = direction;
11898 }
11899 vector5 = new Vector2(MathHelper.Lerp(0f, -8f, fullRotation / ((float)Math.PI / 4f)), MathHelper.Lerp(0f, 2f, Math.Abs(fullRotation / ((float)Math.PI / 4f)))).RotatedBy(fullRotation);
11900 if (num2 == Math.Sign(fullRotation))
11901 {
11902 vector5 *= MathHelper.Lerp(1f, 0.6f, Math.Abs(fullRotation / ((float)Math.PI / 4f)));
11903 }
11904 }
11905 if (fullRotation != 0f)
11906 {
11909 }
11910 float num3 = 0f;
11913 vector7.Y -= num3 / 2f;
11914 vector6.Y -= num3 / 2f;
11915 float num4 = 1f;
11916 switch (yoraiz0rEye % 10)
11917 {
11918 case 1:
11919 return;
11920 case 2:
11921 num4 = 0.5f;
11922 break;
11923 case 3:
11924 num4 = 0.625f;
11925 break;
11926 case 4:
11927 num4 = 0.75f;
11928 break;
11929 case 5:
11930 num4 = 0.875f;
11931 break;
11932 case 6:
11933 num4 = 1f;
11934 break;
11935 case 7:
11936 num4 = 1.1f;
11937 break;
11938 }
11939 if (yoraiz0rEye < 7)
11940 {
11941 DelegateMethods.v3_1 = Main.hslToRgb(Main.rgbToHsl(eyeColor).X, 1f, 0.5f).ToVector3() * 0.5f * num4;
11942 if (velocity != Vector2.Zero)
11943 {
11944 Utils.PlotTileLine(base.Center, base.Center + velocity * 2f, 4f, DelegateMethods.CastLightOpen);
11945 }
11946 else
11947 {
11948 Utils.PlotTileLine(base.Left, base.Right, 4f, DelegateMethods.CastLightOpen);
11949 }
11950 }
11951 int num5 = (int)Vector2.Distance(vector6, vector7) / 3 + 1;
11952 if (Vector2.Distance(vector6, vector7) % 3f != 0f)
11953 {
11954 num5++;
11955 }
11956 for (float num6 = 1f; num6 <= (float)num5; num6 += 1f)
11957 {
11958 Dust obj = Main.dust[Dust.NewDust(base.Center, 0, 0, 182)];
11959 obj.position = Vector2.Lerp(vector7, vector6, num6 / (float)num5);
11960 obj.noGravity = true;
11961 obj.velocity = Vector2.Zero;
11962 obj.customData = this;
11963 obj.scale = num4;
11964 obj.shader = GameShaders.Armor.GetSecondaryShader(cYorai, this);
11965 }
11966 }
static float Lerp(float value1, float value2, float amount)
Definition MathHelper.cs:53
static double Abs(double value)
const double PI
Definition Math.cs:16
static int Sign(decimal value)
Definition Math.cs:1202
Vector2 oldPosition
Definition Entity.cs:18
Vector2 velocity
Definition Entity.cs:16
Vector2 position
Definition Entity.cs:14
static ArmorShaderDataSet Armor
Definition GameShaders.cs:7
bool Active
Definition Mount.cs:345
PlayerSittingHelper sitting
Definition Player.cs:2463
Vector2 MountedCenter
Definition Player.cs:2853
Vector2 Directions
Definition Player.cs:3326
float fullRotation
Definition Player.cs:1291
int[] shadowDirection
Definition Player.cs:1511
Vector2 fullRotationOrigin
Definition Player.cs:1293
static float Distance(Vector2 value1, Vector2 value2)
Definition Vector2.cs:91
static Vector2 Lerp(Vector2 value1, Vector2 value2, float amount)
Definition Vector2.cs:227
void GetSittingOffsetInfo(Player player, out Vector2 posOffset, out float seatAdjustment)

References System.Math.Abs(), Terraria.Graphics.Shaders.GameShaders.Armor, Terraria.DelegateMethods.CastLightOpen(), Microsoft.Xna.Framework.Vector2.Distance(), Terraria.Main.dust, Terraria.Main.hslToRgb(), Microsoft.Xna.Framework.MathHelper.Lerp(), Microsoft.Xna.Framework.Vector2.Lerp(), Terraria.Dust.NewDust(), System.obj, Terraria.Main.OffsetsPlayerHeadgear, System.Math.PI, Terraria.Utils.PlotTileLine(), Terraria.Main.rgbToHsl(), System.Math.Sign(), and Microsoft.Xna.Framework.Vector2.Zero.