872 {
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048 drawData.tileCache = Main.tile[
tileX,
tileY];
1049 drawData.typeCache =
drawData.tileCache.type;
1050 drawData.tileFrameX =
drawData.tileCache.frameX;
1051 drawData.tileFrameY =
drawData.tileCache.frameY;
1052 drawData.tileLight = Lighting.GetColor(
tileX,
tileY);
1054 {
1055 return;
1056 }
1057 GetTileDrawData(
tileX,
tileY,
drawData.tileCache,
drawData.typeCache,
ref drawData.tileFrameX,
ref drawData.tileFrameY,
out drawData.tileWidth,
out drawData.tileHeight,
out drawData.tileTop,
out drawData.halfBrickHeight,
out drawData.addFrX,
out drawData.addFrY,
out drawData.tileSpriteEffect,
out drawData.glowTexture,
out drawData.glowSourceRect,
out drawData.glowColor);
1060 Rectangle
empty = Rectangle.Empty;
1063 {
1065 }
1067 {
1068 if (((Color)(
ref drawData.tileLight)).R <
byte.MaxValue)
1069 {
1070 ((Color)(
ref drawData.tileLight)).R =
byte.MaxValue;
1071 }
1073 {
1075 }
1077 {
1079 }
1081 {
1082 int num = Dust.NewDust(
new Vector2((
float)(
tileX * 16), (
float)(
tileY * 16)), 16, 16, 60, 0
f, 0
f, 100,
default(Color), 0.3f);
1085 obj.velocity *= 0.1f;
1088 }
1089 }
1091 {
1093 {
1095 }
1097 {
1099 }
1101 {
1102 int num12 = Dust.NewDust(
new Vector2((
float)(
tileX * 16), (
float)(
tileY * 16)), 16, 16, 204, 0
f, 0
f, 150,
default(Color), 0.3f);
1105 obj2.velocity *= 0.1f;
1107 }
1108 }
1110 {
1113 {
1115 {
1117 }
1119 {
1121 }
1123 {
1125 }
1127 {
1129 int num14 = Dust.NewDust(
new Vector2((
float)(
tileX * 16), (
float)(
tileY * 16)), 16, 16, 267, 0
f, 0
f, 150,
newColor, 0.3f);
1133 obj3.velocity *= 0.1f;
1135 }
1136 }
1137 }
1139 {
1141 {
1143 }
1145 }
1148 {
1150 }
1152 {
1154 }
1159 {
1162 {
1164 }
1165 else if (
drawData.tileFrameY == 36)
1166 {
1168 }
1169 Main.spriteBatch.Draw(TextureAssets.ShroomCap.Value,
new Vector2((
float)(
tileX * 16 - (
int)screenPosition.X - 22), (
float)(
tileY * 16 - (
int)screenPosition.Y - 26)) +
screenOffset, (Rectangle?)
new Rectangle(
num15 * 62, 0, 60, 42), Lighting.GetColor(
tileX,
tileY), 0
f,
_zero, 1
f,
drawData.tileSpriteEffect, 0
f);
1170 }
1171 Rectangle
rectangle =
default(Rectangle);
1176 {
1177 return;
1178 }
1179 drawData.colorTint = Color.White;
1182 {
1183 case 136:
1185 {
1186 case 1:
1188 break;
1189 case 2:
1191 break;
1192 }
1193 break;
1194 case 442:
1196 {
1198 }
1199 break;
1200 case 51:
1201 drawData.finalColor = drawData.tileLight * 0.5f;
1202 break;
1203 case 160:
1204 case 692:
1205 {
1206 Color color = default(Color);
1207 ((Color)(
ref color)).
_002Ector(Main.DiscoR, Main.DiscoG, Main.DiscoB, 255);
1209 {
1210 color =
drawData.tileCache.actColor(color);
1211 }
1212 drawData.finalColor = color;
1213 break;
1214 }
1215 case 129:
1216 {
1217 drawData.finalColor = new Color(255, 255, 255, 100);
1220 {
1221 drawData.finalColor = Color.Transparent;
1222 }
1224 {
1225 vector.Y +=
num17 * (drawData.tileFrameY == 0).ToDirectionInt();
1226 }
1227 else
1228 {
1229 vector.X +=
num17 * (drawData.tileFrameY == 36).ToDirectionInt();
1230 }
1231 break;
1232 }
1233 case 272:
1234 {
1242 drawData.addFrY +=
num16;
1243 rectangle.Y +=
num16;
1244 break;
1245 }
1246 case 80:
1247 {
1250 {
1251 rectangle.Y += 54;
1252 }
1254 {
1255 rectangle.Y += 108;
1256 }
1257 if (crimson)
1258 {
1259 rectangle.Y += 162;
1260 }
1261 break;
1262 }
1263 case 83:
1265 break;
1266 case 323:
1268 {
1269 return;
1270 }
1271 vector.X +=
drawData.tileCache.frameY;
1272 break;
1273 case 114:
1275 {
1276 rectangle.Height += 2;
1277 }
1278 break;
1279 }
1281 {
1283 }
1284 else if (
drawData.typeCache == 171)
1285 {
1287 }
1288 else
1289 {
1291 }
1292 if (Main.tileGlowMask[
drawData.tileCache.type] != -1)
1293 {
1295 if (TextureAssets.GlowMask.IndexInRange(
num18))
1296 {
1297 drawData.drawTexture = TextureAssets.GlowMask[
num18].Value;
1298 }
1299 double num19 = Main.timeForVisualEffects * 0.08;
1300 Color
color2 = Color.White;
1303 {
1304 case 633:
1306 break;
1307 case 659:
1308 case 667:
1310 break;
1311 case 350:
1313 break;
1314 case 381:
1315 case 517:
1316 case 687:
1318 break;
1319 case 534:
1320 case 535:
1321 case 689:
1323 break;
1324 case 536:
1325 case 537:
1326 case 690:
1328 break;
1329 case 539:
1330 case 540:
1331 case 688:
1333 break;
1334 case 625:
1335 case 626:
1336 case 691:
1338 break;
1339 case 627:
1340 case 628:
1341 case 692:
1343 break;
1344 case 370:
1345 case 390:
1347 break;
1348 case 391:
1350 break;
1351 case 209:
1352 color2 = PortalHelper.GetPortalColor(Main.myPlayer, (
drawData.tileCache.frameX >= 288) ? 1 : 0);
1353 break;
1354 case 429:
1355 case 445:
1357 drawData.addFrY = 18;
1358 break;
1359 case 129:
1360 {
1362 {
1364 break;
1365 }
1367 color2 = Main.hslToRgb(0.7
f + (
float)
Math.Sin((
float)
Math.PI * 2
f * Main.GlobalTimeWrappedHourly * 0.16f + (
float)
tileX * 0.3f + (
float)
tileY * 0.7f) * 0.16f, 1
f, 0.5f);
1372 {
1373 Main.spriteBatch.Draw(
drawData.drawTexture,
vector +
num3.ToRotationVector2() * 2
f, (Rectangle?)
new Rectangle(
drawData.tileFrameX +
drawData.addFrX,
drawData.tileFrameY +
drawData.addFrY +
num2,
drawData.tileWidth,
drawData.tileHeight),
color2, 0
f, Vector2.Zero, 1
f, (SpriteEffects)0, 0
f);
1374 }
1376 break;
1377 }
1378 }
1380 {
1382 {
1383 Main.spriteBatch.Draw(
drawData.drawTexture,
vector, (Rectangle?)
new Rectangle(
drawData.tileFrameX +
drawData.addFrX,
drawData.tileFrameY +
drawData.addFrY,
drawData.tileWidth,
drawData.tileHeight),
color2, 0
f, Vector2.Zero, 1
f, (SpriteEffects)0, 0
f);
1384 }
1385 else if (
drawData.tileCache.halfBrick())
1386 {
1388 }
1390 {
1393 {
1394 Rectangle value = default(Rectangle);
1397 {
1398 value.X = 324;
1399 }
1401 }
1403 {
1404 Rectangle
value2 =
default(Rectangle);
1407 {
1408 value2.X = 306;
1409 }
1411 }
1412 }
1414 {
1415 Main.spriteBatch.Draw(
drawData.drawTexture,
vector, (Rectangle?)
new Rectangle(
drawData.tileFrameX +
drawData.addFrX,
drawData.tileFrameY +
drawData.addFrY, 16, 16),
color2, 0
f,
_zero, 1
f,
drawData.tileSpriteEffect, 0
f);
1416 }
1417 else
1418 {
1421 for (int i = 0; i < 8; i++)
1422 {
1424 int num7 = 16 - i * 2;
1428 {
1429 case 1:
1434 break;
1435 case 2:
1437 num9 = 16 - i * 2 - 2;
1440 break;
1441 case 3:
1443 break;
1444 default:
1445 num9 = 16 - i * 2 - 2;
1446 break;
1447 }
1448 Main.spriteBatch.Draw(
drawData.drawTexture,
vector +
new Vector2((
float)
num9, (
float)(i *
num5 +
num6)), (Rectangle?)
new Rectangle(
drawData.tileFrameX +
drawData.addFrX +
num9,
drawData.tileFrameY +
drawData.addFrY +
num8,
num5,
num7),
color2, 0
f,
_zero, 1
f,
drawData.tileSpriteEffect, 0
f);
1449 }
1451 Main.spriteBatch.Draw(
drawData.drawTexture,
vector +
new Vector2(0
f, (
float)
num10), (Rectangle?)
new Rectangle(
drawData.tileFrameX +
drawData.addFrX,
drawData.tileFrameY +
drawData.addFrY +
num10, 16, 2),
color2, 0
f,
_zero, 1
f,
drawData.tileSpriteEffect, 0
f);
1452 }
1453 }
1454 }
1456 {
1457 Vector2 position =
new Vector2((
float)(
tileX * 16 - (
int)screenPosition.X) - ((
float)
drawData.tileWidth - 16
f) / 2
f, (
float)(
tileY * 16 - (
int)screenPosition.Y +
drawData.tileTop)) +
screenOffset;
1459 {
1461 }
1463 }
1465 {
1470 }
1471 }
bool noGravity
Indicates if a dust should be affected by gravity or not. Not all vanilla dust have logic checking th...
bool noLight
If true, the dust will not emit light. The specific behavior depends on the dust type,...
float fadeIn
Used by some dust AI to control logic pertaining to the dust fading in. The specific behavior depends...
void DrawBasicTile(Vector2 screenPosition, Vector2 screenOffset, int tileX, int tileY, TileDrawInfo drawData, Rectangle normalTileRect, Vector2 normalTilePosition)
static Color GetFinalLight(Tile tileCache, ushort typeCache, Color tileLight, Color tint)
Color DrawTiles_GetLightOverride(int j, int i, Tile tileCache, ushort typeCache, short tileFrameX, short tileFrameY, Color tileLight)
static bool IsVisible(Tile tile)
Returns true if the tile is visible.
void DrawTile_MinecartTrack(Vector2 screenPosition, Vector2 screenOffset, int tileX, int tileY, TileDrawInfo drawData)
void DrawXmasTree(Vector2 screenPosition, Vector2 screenOffset, int tileX, int tileY, TileDrawInfo drawData)
static bool IsTileDangerous(int tileX, int tileY, Player localPlayer, Tile tileCache, ushort typeCache)
static readonly Vector2 _zero
void CacheSpecialDraws_Part2(int tileX, int tileY, TileDrawInfo drawData, bool skipDraw)
void CacheSpecialDraws_Part1(int tileX, int tileY, int tileType, int drawDataTileFrameX, int drawDataTileFrameY, bool skipDraw)
Texture2D GetTileDrawTexture(Tile tile, int tileX, int tileY)
void DrawTiles_EmitParticles(int j, int i, Tile tileCache, ushort typeCache, short tileFrameX, short tileFrameY, Color tileLight)
void GetTileDrawData(int x, int y, Tile tileCache, ushort typeCache, ref short tileFrameX, ref short tileFrameY, out int tileWidth, out int tileHeight, out int tileTop, out int halfBrickHeight, out int addFrX, out int addFrY, out SpriteEffects tileSpriteEffect, out Texture2D glowTexture, out Rectangle glowSourceRect, out Color glowColor)
bool _isActiveAndNotPaused
void GetTileOutlineInfo(int x, int y, ushort typeCache, ref Color tileLight, ref Texture2D highlightTexture, ref Color highlightColor)
static Color GetShimmerGlitterColor(bool top, float worldPositionX, float worldPositionY)
static bool[] BlocksStairsAbove
static bool[] HasSlopeFrames
static bool[] HasOutlines
Indicates that this tile has an outline texture to be drawn to indicate that it is interactable....
static bool[] BlocksStairs
static void DrawEffects(int i, int j, int type, SpriteBatch spriteBatch, ref TileDrawInfo drawData)
This serves as the central class from which tile-related functions are supported and carried out.
FastRandom WithModifier(ulong modifier)