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

◆ shine() [1/2]

static Microsoft.Xna.Framework.Color Terraria.Main.shine ( Microsoft::Xna::Framework::Color newColor,
int type )
inlinestatic

Definition at line 20065 of file Main.cs.

20066 {
20067 int num = newColor.R;
20068 int num2 = newColor.G;
20069 int num3 = newColor.B;
20070 float num4 = 0.6f;
20071 switch (type)
20072 {
20073 case 25:
20074 num = (int)((float)(int)newColor.R * 0.95f);
20075 num2 = (int)((float)(int)newColor.G * 0.85f);
20076 num3 = (int)((double)(int)newColor.B * 1.1);
20077 break;
20078 case 117:
20079 num = (int)((float)(int)newColor.R * 1.1f);
20080 num2 = (int)((float)(int)newColor.G * 1f);
20081 num3 = (int)((double)(int)newColor.B * 1.2);
20082 break;
20083 case 204:
20084 num4 = 0.3f + (float)(int)mouseTextColor / 300f;
20085 num = (int)((float)(int)newColor.R * (1.3f * num4));
20086 if (num > 255)
20087 {
20088 num = 255;
20089 }
20090 return new Microsoft.Xna.Framework.Color(num, num2, num3, 255);
20091 case 211:
20092 num4 = 0.3f + (float)(int)mouseTextColor / 300f;
20093 num2 = (int)((float)(int)newColor.G * (1.5f * num4));
20094 num3 = (int)((float)(int)newColor.B * (1.1f * num4));
20095 break;
20096 case 147:
20097 case 161:
20098 num = (int)((float)(int)newColor.R * 1.1f);
20099 num2 = (int)((float)(int)newColor.G * 1.12f);
20100 num3 = (int)((double)(int)newColor.B * 1.15);
20101 break;
20102 case 163:
20103 num = (int)((float)(int)newColor.R * 1.05f);
20104 num2 = (int)((float)(int)newColor.G * 1.1f);
20105 num3 = (int)((double)(int)newColor.B * 1.15);
20106 break;
20107 case 164:
20108 num = (int)((float)(int)newColor.R * 1.1f);
20109 num2 = (int)((float)(int)newColor.G * 1.1f);
20110 num3 = (int)((double)(int)newColor.B * 1.2);
20111 break;
20112 case 178:
20113 num4 = 0.5f;
20114 num = (int)((float)(int)newColor.R * (1f + num4));
20115 num2 = (int)((float)(int)newColor.G * (1f + num4));
20116 num3 = (int)((float)(int)newColor.B * (1f + num4));
20117 break;
20118 case 185:
20119 case 186:
20120 num4 = 0.3f;
20121 num = (int)((float)(int)newColor.R * (1f + num4));
20122 num2 = (int)((float)(int)newColor.G * (1f + num4));
20123 num3 = (int)((float)(int)newColor.B * (1f + num4));
20124 break;
20125 case 262:
20126 case 263:
20127 case 264:
20128 case 265:
20129 case 266:
20130 case 267:
20131 case 268:
20132 num3 += 100;
20133 num += 100;
20134 num2 += 100;
20135 break;
20136 default:
20137 if (tileShine2[type])
20138 {
20139 num = (int)((float)(int)newColor.R * (1f + num4));
20140 num2 = (int)((float)(int)newColor.G * (1f + num4));
20141 num3 = (int)((float)(int)newColor.B * (1f + num4));
20142 }
20143 break;
20144 }
20145 float num5 = shimmerAlpha;
20146 if (num5 > 0f)
20147 {
20148 num = (int)((float)num * (1f - num5) + (float)num * shimmerShine.X * num5);
20149 num2 = (int)((float)num2 * (1f - num5) + (float)num2 * shimmerShine.Y * num5);
20150 num3 = (int)((float)num3 * (1f - num5) + (float)num3 * shimmerShine.Z * num5);
20151 }
20152 if (num > 255)
20153 {
20154 num = 255;
20155 }
20156 if (num2 > 255)
20157 {
20158 num2 = 255;
20159 }
20160 if (num3 > 255)
20161 {
20162 num3 = 255;
20163 }
20164 newColor.R = (byte)num;
20165 newColor.G = (byte)num2;
20166 newColor.B = (byte)num3;
20167 return new Microsoft.Xna.Framework.Color((byte)num, (byte)num2, (byte)num3, newColor.A);
20168 }
static byte mouseTextColor
Definition Main.cs:1751
static bool[] tileShine2
Definition Main.cs:1439
static float shimmerAlpha
Definition Main.cs:1008

References Terraria.Main.mouseTextColor, Terraria.Main.shimmerAlpha, Terraria.Main.tileShine2, and System.type.

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