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

◆ shine() [1/2]

static Color Terraria.Main.shine ( Color newColor,
int type )
inlinestatic

Definition at line 20992 of file Main.cs.

20993 {
20994 //IL_0166: Unknown result type (might be due to invalid IL or missing references)
20995 //IL_03de: Unknown result type (might be due to invalid IL or missing references)
20996 int num = ((Color)(ref newColor)).R;
20997 int num2 = ((Color)(ref newColor)).G;
20998 int num3 = ((Color)(ref newColor)).B;
20999 float num4 = 0.6f;
21000 switch (type)
21001 {
21002 case 25:
21003 num = (int)((float)(int)((Color)(ref newColor)).R * 0.95f);
21004 num2 = (int)((float)(int)((Color)(ref newColor)).G * 0.85f);
21005 num3 = (int)((double)(int)((Color)(ref newColor)).B * 1.1);
21006 break;
21007 case 117:
21008 num = (int)((float)(int)((Color)(ref newColor)).R * 1.1f);
21009 num2 = (int)((float)(int)((Color)(ref newColor)).G * 1f);
21010 num3 = (int)((double)(int)((Color)(ref newColor)).B * 1.2);
21011 break;
21012 case 204:
21013 num4 = 0.3f + (float)(int)mouseTextColor / 300f;
21014 num = (int)((float)(int)((Color)(ref newColor)).R * (1.3f * num4));
21015 if (num > 255)
21016 {
21017 num = 255;
21018 }
21019 return new Color(num, num2, num3, 255);
21020 case 211:
21021 num4 = 0.3f + (float)(int)mouseTextColor / 300f;
21022 num2 = (int)((float)(int)((Color)(ref newColor)).G * (1.5f * num4));
21023 num3 = (int)((float)(int)((Color)(ref newColor)).B * (1.1f * num4));
21024 break;
21025 case 147:
21026 case 161:
21027 num = (int)((float)(int)((Color)(ref newColor)).R * 1.1f);
21028 num2 = (int)((float)(int)((Color)(ref newColor)).G * 1.12f);
21029 num3 = (int)((double)(int)((Color)(ref newColor)).B * 1.15);
21030 break;
21031 case 163:
21032 num = (int)((float)(int)((Color)(ref newColor)).R * 1.05f);
21033 num2 = (int)((float)(int)((Color)(ref newColor)).G * 1.1f);
21034 num3 = (int)((double)(int)((Color)(ref newColor)).B * 1.15);
21035 break;
21036 case 164:
21037 num = (int)((float)(int)((Color)(ref newColor)).R * 1.1f);
21038 num2 = (int)((float)(int)((Color)(ref newColor)).G * 1.1f);
21039 num3 = (int)((double)(int)((Color)(ref newColor)).B * 1.2);
21040 break;
21041 case 178:
21042 num4 = 0.5f;
21043 num = (int)((float)(int)((Color)(ref newColor)).R * (1f + num4));
21044 num2 = (int)((float)(int)((Color)(ref newColor)).G * (1f + num4));
21045 num3 = (int)((float)(int)((Color)(ref newColor)).B * (1f + num4));
21046 break;
21047 case 185:
21048 case 186:
21049 num4 = 0.3f;
21050 num = (int)((float)(int)((Color)(ref newColor)).R * (1f + num4));
21051 num2 = (int)((float)(int)((Color)(ref newColor)).G * (1f + num4));
21052 num3 = (int)((float)(int)((Color)(ref newColor)).B * (1f + num4));
21053 break;
21054 case 262:
21055 case 263:
21056 case 264:
21057 case 265:
21058 case 266:
21059 case 267:
21060 case 268:
21061 num3 += 100;
21062 num += 100;
21063 num2 += 100;
21064 break;
21065 default:
21066 if (tileShine2[type])
21067 {
21068 num = (int)((float)(int)((Color)(ref newColor)).R * (1f + num4));
21069 num2 = (int)((float)(int)((Color)(ref newColor)).G * (1f + num4));
21070 num3 = (int)((float)(int)((Color)(ref newColor)).B * (1f + num4));
21071 }
21072 break;
21073 }
21074 float num5 = shimmerAlpha;
21075 if (num5 > 0f)
21076 {
21077 num = (int)((float)num * (1f - num5) + (float)num * shimmerShine.X * num5);
21078 num2 = (int)((float)num2 * (1f - num5) + (float)num2 * shimmerShine.Y * num5);
21079 num3 = (int)((float)num3 * (1f - num5) + (float)num3 * shimmerShine.Z * num5);
21080 }
21081 if (num > 255)
21082 {
21083 num = 255;
21084 }
21085 if (num2 > 255)
21086 {
21087 num2 = 255;
21088 }
21089 if (num3 > 255)
21090 {
21091 num3 = 255;
21092 }
21093 ((Color)(ref newColor)).R = (byte)num;
21094 ((Color)(ref newColor)).G = (byte)num2;
21095 ((Color)(ref newColor)).B = (byte)num3;
21096 return new Color((int)(byte)num, (int)(byte)num2, (int)(byte)num3, (int)((Color)(ref newColor)).A);
21097 }
static byte mouseTextColor
A value that oscillates between 190 and 255. It is used to drive the slight pulsing color effect seen...
Definition Main.cs:1904
static bool[] tileShine2
If true, the tile will be drawn to be slightly more bright.
Definition Main.cs:1554
static float shimmerAlpha
Definition Main.cs:1077

References Terraria.Graphics.Light.Color, Terraria.Main.mouseTextColor, Terraria.Main.shimmerAlpha, and Terraria.Main.tileShine2.

Referenced by Terraria.GameContent.Drawing.TileDrawing.GetFinalLight(), and Terraria.GameContent.Drawing.TileDrawing.GetFinalLight().

+ Here is the caller graph for this function: