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

◆ DungeonStairs()

static void Terraria.WorldGen.DungeonStairs ( int i,
int j,
ushort tileType,
int wallType )
inlinestatic

Definition at line 28897 of file WorldGen.cs.

28898 {
28899 //IL_0000: Unknown result type (might be due to invalid IL or missing references)
28900 //IL_0005: Unknown result type (might be due to invalid IL or missing references)
28901 //IL_0124: Unknown result type (might be due to invalid IL or missing references)
28902 //IL_0164: Unknown result type (might be due to invalid IL or missing references)
28903 //IL_0135: Unknown result type (might be due to invalid IL or missing references)
28904 //IL_0175: Unknown result type (might be due to invalid IL or missing references)
28905 //IL_01c5: Unknown result type (might be due to invalid IL or missing references)
28906 //IL_01e7: Unknown result type (might be due to invalid IL or missing references)
28907 //IL_020a: Unknown result type (might be due to invalid IL or missing references)
28908 //IL_021f: Unknown result type (might be due to invalid IL or missing references)
28909 //IL_05b9: Unknown result type (might be due to invalid IL or missing references)
28910 //IL_05c5: Unknown result type (might be due to invalid IL or missing references)
28911 //IL_0271: Unknown result type (might be due to invalid IL or missing references)
28912 //IL_0284: Unknown result type (might be due to invalid IL or missing references)
28913 //IL_02bf: Unknown result type (might be due to invalid IL or missing references)
28914 //IL_02e0: Unknown result type (might be due to invalid IL or missing references)
28915 //IL_030e: Unknown result type (might be due to invalid IL or missing references)
28916 //IL_033c: Unknown result type (might be due to invalid IL or missing references)
28917 //IL_0368: Unknown result type (might be due to invalid IL or missing references)
28918 //IL_04ab: Unknown result type (might be due to invalid IL or missing references)
28919 //IL_04c4: Unknown result type (might be due to invalid IL or missing references)
28920 //IL_04de: Unknown result type (might be due to invalid IL or missing references)
28921 //IL_04f7: Unknown result type (might be due to invalid IL or missing references)
28922 //IL_0588: Unknown result type (might be due to invalid IL or missing references)
28923 //IL_0589: Unknown result type (might be due to invalid IL or missing references)
28924 //IL_058a: Unknown result type (might be due to invalid IL or missing references)
28925 //IL_058f: Unknown result type (might be due to invalid IL or missing references)
28926 //IL_0590: Unknown result type (might be due to invalid IL or missing references)
28928 double num = genRand.Next(5, 9);
28929 int num2 = 1;
28930 Vector2D val = default(Vector2D);
28931 val.X = i;
28932 val.Y = j;
28933 int num3 = genRand.Next(10, 30);
28934 num2 = ((i <= GenVars.dEnteranceX) ? 1 : (-1));
28935 if (i > Main.maxTilesX - 400)
28936 {
28937 num2 = -1;
28938 }
28939 else if (i < 400)
28940 {
28941 num2 = 1;
28942 }
28943 zero.Y = -1.0;
28944 zero.X = num2;
28945 if (genRand.Next(3) != 0)
28946 {
28947 zero.X *= 1.0 + (double)genRand.Next(0, 200) * 0.01;
28948 }
28949 else if (genRand.Next(3) == 0)
28950 {
28951 zero.X *= (double)genRand.Next(50, 76) * 0.01;
28952 }
28953 else if (genRand.Next(6) == 0)
28954 {
28955 zero.Y *= 2.0;
28956 }
28957 if (GenVars.dungeonX < Main.maxTilesX / 2 && zero.X < 0.0 && zero.X < 0.5)
28958 {
28959 zero.X = -0.5;
28960 }
28961 if (GenVars.dungeonX > Main.maxTilesX / 2 && zero.X > 0.0 && zero.X > 0.5)
28962 {
28963 zero.X = -0.5;
28964 }
28965 if (drunkWorldGen)
28966 {
28967 num2 *= -1;
28968 zero.X *= -1.0;
28969 }
28970 while (num3 > 0)
28971 {
28972 num3--;
28973 int num4 = (int)(val.X - num - 4.0 - (double)genRand.Next(6));
28974 int num5 = (int)(val.X + num + 4.0 + (double)genRand.Next(6));
28975 int num6 = (int)(val.Y - num - 4.0);
28976 int num7 = (int)(val.Y + num + 4.0 + (double)genRand.Next(6));
28977 if (num4 < 0)
28978 {
28979 num4 = 0;
28980 }
28981 if (num5 > Main.maxTilesX)
28982 {
28983 num5 = Main.maxTilesX;
28984 }
28985 if (num6 < 0)
28986 {
28987 num6 = 0;
28988 }
28989 if (num7 > Main.maxTilesY)
28990 {
28991 num7 = Main.maxTilesY;
28992 }
28993 int num8 = 1;
28994 if (val.X > (double)(Main.maxTilesX / 2))
28995 {
28996 num8 = -1;
28997 }
28998 int num9 = (int)(val.X + GenVars.dxStrength1 * 0.6 * (double)num8 + GenVars.dxStrength2 * (double)num8);
28999 int num10 = (int)(GenVars.dyStrength2 * 0.5);
29000 if (val.Y < Main.worldSurface - 5.0 && Main.tile[num9, (int)(val.Y - num - 6.0 + (double)num10)].wall == 0 && Main.tile[num9, (int)(val.Y - num - 7.0 + (double)num10)].wall == 0 && Main.tile[num9, (int)(val.Y - num - 8.0 + (double)num10)].wall == 0)
29001 {
29002 GenVars.dSurface = true;
29003 TileRunner(num9, (int)(val.Y - num - 6.0 + (double)num10), genRand.Next(25, 35), genRand.Next(10, 20), -1, addTile: false, 0.0, -1.0);
29004 }
29005 for (int k = num4; k < num5; k++)
29006 {
29007 for (int l = num6; l < num7; l++)
29008 {
29009 Main.tile[k, l].liquid = 0;
29010 if (!Main.wallDungeon[Main.tile[k, l].wall])
29011 {
29012 Main.tile[k, l].wall = 0;
29013 Main.tile[k, l].active(active: true);
29014 Main.tile[k, l].type = tileType;
29015 }
29016 }
29017 }
29018 for (int m = num4 + 1; m < num5 - 1; m++)
29019 {
29020 for (int n = num6 + 1; n < num7 - 1; n++)
29021 {
29022 Main.tile[m, n].wall = (ushort)wallType;
29023 }
29024 }
29025 int num11 = 0;
29026 if (genRand.Next((int)num) == 0)
29027 {
29028 num11 = genRand.Next(1, 3);
29029 }
29030 num4 = (int)(val.X - num * 0.5 - (double)num11);
29031 num5 = (int)(val.X + num * 0.5 + (double)num11);
29032 num6 = (int)(val.Y - num * 0.5 - (double)num11);
29033 num7 = (int)(val.Y + num * 0.5 + (double)num11);
29034 if (num4 < 0)
29035 {
29036 num4 = 0;
29037 }
29038 if (num5 > Main.maxTilesX)
29039 {
29040 num5 = Main.maxTilesX;
29041 }
29042 if (num6 < 0)
29043 {
29044 num6 = 0;
29045 }
29046 if (num7 > Main.maxTilesY)
29047 {
29048 num7 = Main.maxTilesY;
29049 }
29050 for (int num12 = num4; num12 < num5; num12++)
29051 {
29052 for (int num13 = num6; num13 < num7; num13++)
29053 {
29054 Main.tile[num12, num13].active(active: false);
29056 }
29057 }
29058 if (GenVars.dSurface)
29059 {
29060 num3 = 0;
29061 }
29062 val += zero;
29063 if (val.Y < Main.worldSurface)
29064 {
29065 zero.Y *= 0.98;
29066 }
29067 }
29068 GenVars.dungeonX = (int)val.X;
29069 GenVars.dungeonY = (int)val.Y;
29070 }
static UnifiedRandom genRand
Definition WorldGen.cs:1215
static void PlaceWall(int i, int j, int type, bool mute=false)
static bool drunkWorldGen
Definition WorldGen.cs:1154
static void TileRunner(int i, int j, double strength, int steps, int type, bool addTile=false, double speedX=0.0, double speedY=0.0, bool noYChange=false, bool overRide=true, int ignoreTileType=-1)
static Vector2D Zero
Definition Vector2D.cs:24

References Terraria.WorldBuilding.GenVars.dEnteranceX, Terraria.WorldBuilding.GenVars.dSurface, Terraria.WorldBuilding.GenVars.dungeonX, Terraria.WorldBuilding.GenVars.dxStrength1, Terraria.WorldBuilding.GenVars.dyStrength2, Terraria.Main.maxTilesX, Terraria.Main.maxTilesY, Terraria.Main.tile, Terraria.Main.wallDungeon, Terraria.Main.worldSurface, ReLogic.Utilities.Vector2D.X, ReLogic.Utilities.Vector2D.Y, and ReLogic.Utilities.Vector2D.Zero.