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

◆ EmitLiquidDrops()

void Terraria.GameContent.Drawing.TileDrawing.EmitLiquidDrops ( int j,
int i,
Tile tileCache,
ushort typeCache )
inlineprivate

Definition at line 6415 of file TileDrawing.cs.

6416 {
6417 int num = 60;
6418 switch (typeCache)
6419 {
6420 case 374:
6421 num = 120;
6422 break;
6423 case 375:
6424 num = 180;
6425 break;
6426 case 461:
6427 num = 180;
6428 break;
6429 }
6430 if (tileCache.liquid != 0 || _rand.Next(num * 2) != 0)
6431 {
6432 return;
6433 }
6434 Rectangle rectangle = new Rectangle(i * 16, j * 16, 16, 16);
6435 rectangle.X -= 34;
6436 rectangle.Width += 68;
6437 rectangle.Y -= 100;
6438 rectangle.Height = 400;
6439 for (int k = 0; k < 600; k++)
6440 {
6441 if (_gore[k].active && ((_gore[k].type >= 706 && _gore[k].type <= 717) || _gore[k].type == 943 || _gore[k].type == 1147 || (_gore[k].type >= 1160 && _gore[k].type <= 1162)))
6442 {
6443 Rectangle value = new Rectangle((int)_gore[k].position.X, (int)_gore[k].position.Y, 16, 16);
6444 if (rectangle.Intersects(value))
6445 {
6446 return;
6447 }
6448 }
6449 }
6450 Vector2 position = new Vector2(i * 16, j * 16);
6451 int type = 706;
6452 if (Main.waterStyle == 14)
6453 {
6454 type = 706;
6455 }
6456 else if (Main.waterStyle == 13)
6457 {
6458 type = 706;
6459 }
6460 else if (Main.waterStyle == 12)
6461 {
6462 type = 1147;
6463 }
6464 else if (Main.waterStyle > 1)
6465 {
6466 type = 706 + Main.waterStyle - 1;
6467 }
6468 if (typeCache == 374)
6469 {
6470 type = 716;
6471 }
6472 if (typeCache == 375)
6473 {
6474 type = 717;
6475 }
6476 if (typeCache == 461)
6477 {
6478 type = 943;
6479 if (Main.player[Main.myPlayer].ZoneCorrupt)
6480 {
6481 type = 1160;
6482 }
6483 if (Main.player[Main.myPlayer].ZoneCrimson)
6484 {
6485 type = 1161;
6486 }
6487 if (Main.player[Main.myPlayer].ZoneHallow)
6488 {
6489 type = 1162;
6490 }
6491 }
6492 int num2 = Gore.NewGore(position, default(Vector2), type);
6493 _gore[num2].velocity *= 0f;
6494 }
Vector2 velocity
Definition Gore.cs:19
Vector2 position
Definition Gore.cs:17

References Terraria.GameContent.Drawing.TileDrawing._gore, Terraria.GameContent.Drawing.TileDrawing._rand, Terraria.Tile.liquid, Terraria.Main.myPlayer, Terraria.Gore.NewGore(), Terraria.Utilities.UnifiedRandom.Next(), Terraria.Main.player, Terraria.Gore.position, System.type, System.value, Microsoft.Xna.Framework.Graphics.Vector2, Terraria.Gore.velocity, Terraria.Main.waterStyle, and Microsoft.Xna.Framework.Vector2.Y.

Referenced by Terraria.GameContent.Drawing.TileDrawing.Draw().