Terraria v1.4.4.9
Terraria source code documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros

◆ CheckLilyPad()

static void Terraria.WorldGen.CheckLilyPad ( int x,
int y )
inlinestatic

Definition at line 50133 of file WorldGen.cs.

50134 {
50135 if (Main.netMode == 1)
50136 {
50137 return;
50138 }
50139 if (Main.tile[x, y].liquidType() != 0)
50140 {
50141 KillTile(x, y);
50142 if (Main.netMode == 2)
50143 {
50144 NetMessage.SendData(17, -1, -1, null, 0, x, y);
50145 }
50146 return;
50147 }
50148 int num = y;
50149 while ((!Main.tile[x, num].active() || !Main.tileSolid[Main.tile[x, num].type] || Main.tileSolidTop[Main.tile[x, num].type]) && num < Main.maxTilesY - 50)
50150 {
50151 num++;
50152 if (Main.tile[x, num] == null)
50153 {
50154 return;
50155 }
50156 }
50157 int type = Main.tile[x, num].type;
50158 int num2 = -1;
50159 if (type == 2 || type == 477)
50160 {
50161 num2 = 0;
50162 }
50163 if (type == 109 || type == 109 || type == 116)
50164 {
50165 num2 = 18;
50166 }
50167 if (type == 60)
50168 {
50169 num2 = 36;
50170 }
50171 if (num2 >= 0)
50172 {
50173 if (num2 != Main.tile[x, y].frameY)
50174 {
50175 Main.tile[x, y].frameY = (short)num2;
50176 if (Main.netMode == 2)
50177 {
50178 NetMessage.SendTileSquare(-1, x, y);
50179 }
50180 }
50181 if (Main.tile[x, y - 1].liquid > 0 && !Main.tile[x, y - 1].active())
50182 {
50183 Main.tile[x, y - 1].active(active: true);
50184 Main.tile[x, y - 1].type = 518;
50185 Main.tile[x, y - 1].frameX = Main.tile[x, y].frameX;
50186 Main.tile[x, y - 1].frameY = Main.tile[x, y].frameY;
50187 Main.tile[x, y - 1].halfBrick(halfBrick: false);
50188 Main.tile[x, y - 1].slope(0);
50189 Main.tile[x, y].active(active: false);
50190 Main.tile[x, y].type = 0;
50191 SquareTileFrame(x, y - 1, resetFrame: false);
50192 if (Main.netMode == 2)
50193 {
50194 NetMessage.SendTileSquare(-1, x, y - 1, 1, 2);
50195 }
50196 }
50197 else
50198 {
50199 if (Main.tile[x, y].liquid != 0)
50200 {
50201 return;
50202 }
50203 Tile tileSafely = Framing.GetTileSafely(x, y + 1);
50204 if (!tileSafely.active())
50205 {
50206 Main.tile[x, y + 1].active(active: true);
50207 Main.tile[x, y + 1].type = 518;
50208 Main.tile[x, y + 1].frameX = Main.tile[x, y].frameX;
50209 Main.tile[x, y + 1].frameY = Main.tile[x, y].frameY;
50210 Main.tile[x, y + 1].halfBrick(halfBrick: false);
50211 Main.tile[x, y + 1].slope(0);
50212 Main.tile[x, y].active(active: false);
50213 Main.tile[x, y].type = 0;
50214 SquareTileFrame(x, y + 1, resetFrame: false);
50215 if (Main.netMode == 2)
50216 {
50217 NetMessage.SendTileSquare(-1, x, y, 1, 2);
50218 }
50219 }
50220 else if (tileSafely.active() && !TileID.Sets.Platforms[tileSafely.type] && (!Main.tileSolid[tileSafely.type] || Main.tileSolidTop[tileSafely.type]))
50221 {
50222 KillTile(x, y);
50223 if (Main.netMode == 2)
50224 {
50225 NetMessage.SendData(17, -1, -1, null, 0, x, y);
50226 }
50227 }
50228 }
50229 }
50230 else
50231 {
50232 KillTile(x, y);
50233 if (Main.netMode == 2)
50234 {
50235 NetMessage.SendData(17, -1, -1, null, 0, x, y);
50236 }
50237 }
50238 }
static bool[] Platforms
Definition TileID.cs:163
static void KillTile(int i, int j, bool fail=false, bool effectOnly=false, bool noItem=false)
static void SquareTileFrame(int i, int j, bool resetFrame=true)

References Terraria.Framing.GetTileSafely(), Terraria.Main.maxTilesY, Terraria.Main.netMode, Terraria.ID.TileID.Sets.Platforms, Terraria.NetMessage.SendData(), Terraria.NetMessage.SendTileSquare(), Terraria.Main.tile, Terraria.Main.tileSolid, Terraria.Main.tileSolidTop, and System.type.

Referenced by Terraria.Liquid.DelWater().