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

◆ DungeonRoom()

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

Definition at line 30051 of file WorldGen.cs.

30052 {
30053 //IL_0081: Unknown result type (might be due to invalid IL or missing references)
30054 //IL_0089: Unknown result type (might be due to invalid IL or missing references)
30055 //IL_0091: Unknown result type (might be due to invalid IL or missing references)
30056 //IL_0099: Unknown result type (might be due to invalid IL or missing references)
30057 //IL_00ac: Unknown result type (might be due to invalid IL or missing references)
30058 //IL_00cb: Unknown result type (might be due to invalid IL or missing references)
30059 //IL_00eb: Unknown result type (might be due to invalid IL or missing references)
30060 //IL_010a: Unknown result type (might be due to invalid IL or missing references)
30061 //IL_0441: Unknown result type (might be due to invalid IL or missing references)
30062 //IL_0453: Unknown result type (might be due to invalid IL or missing references)
30063 //IL_0262: Unknown result type (might be due to invalid IL or missing references)
30064 //IL_0277: Unknown result type (might be due to invalid IL or missing references)
30065 //IL_028d: Unknown result type (might be due to invalid IL or missing references)
30066 //IL_02a2: Unknown result type (might be due to invalid IL or missing references)
30067 //IL_035b: Unknown result type (might be due to invalid IL or missing references)
30068 //IL_035c: Unknown result type (might be due to invalid IL or missing references)
30069 //IL_035d: Unknown result type (might be due to invalid IL or missing references)
30070 //IL_0362: Unknown result type (might be due to invalid IL or missing references)
30071 //IL_03ab: Unknown result type (might be due to invalid IL or missing references)
30072 //IL_03cc: Unknown result type (might be due to invalid IL or missing references)
30073 //IL_03ed: Unknown result type (might be due to invalid IL or missing references)
30074 //IL_040e: Unknown result type (might be due to invalid IL or missing references)
30075 double num = genRand.Next(15, 30);
30076 Vector2D val = default(Vector2D);
30077 val.X = (double)genRand.Next(-10, 11) * 0.1;
30078 val.Y = (double)genRand.Next(-10, 11) * 0.1;
30079 Vector2D val2 = default(Vector2D);
30080 val2.X = i;
30081 val2.Y = (double)j - num / 2.0;
30082 int num2 = genRand.Next(10, 20);
30083 double num3 = val2.X;
30084 double num4 = val2.X;
30085 double num5 = val2.Y;
30086 double num6 = val2.Y;
30087 while (num2 > 0)
30088 {
30089 num2--;
30090 int num7 = (int)(val2.X - num * 0.8 - 5.0);
30091 int num8 = (int)(val2.X + num * 0.8 + 5.0);
30092 int num9 = (int)(val2.Y - num * 0.8 - 5.0);
30093 int num10 = (int)(val2.Y + num * 0.8 + 5.0);
30094 if (num7 < 0)
30095 {
30096 num7 = 0;
30097 }
30098 if (num8 > Main.maxTilesX)
30099 {
30100 num8 = Main.maxTilesX;
30101 }
30102 if (num9 < 0)
30103 {
30104 num9 = 0;
30105 }
30106 if (num10 > Main.maxTilesY)
30107 {
30108 num10 = Main.maxTilesY;
30109 }
30110 for (int k = num7; k < num8; k++)
30111 {
30112 for (int l = num9; l < num10; l++)
30113 {
30114 if (k < GenVars.dMinX)
30115 {
30116 GenVars.dMinX = k;
30117 }
30118 if (k > GenVars.dMaxX)
30119 {
30120 GenVars.dMaxX = k;
30121 }
30122 if (l > GenVars.dMaxY)
30123 {
30124 GenVars.dMaxY = l;
30125 }
30126 Main.tile[k, l].liquid = 0;
30127 if (!Main.wallDungeon[Main.tile[k, l].wall])
30128 {
30129 Main.tile[k, l].Clear(TileDataType.Slope);
30130 Main.tile[k, l].active(active: true);
30131 Main.tile[k, l].type = tileType;
30132 }
30133 }
30134 }
30135 for (int m = num7 + 1; m < num8 - 1; m++)
30136 {
30137 for (int n = num9 + 1; n < num10 - 1; n++)
30138 {
30139 Main.tile[m, n].wall = (ushort)wallType;
30140 }
30141 }
30142 num7 = (int)(val2.X - num * 0.5);
30143 num8 = (int)(val2.X + num * 0.5);
30144 num9 = (int)(val2.Y - num * 0.5);
30145 num10 = (int)(val2.Y + num * 0.5);
30146 if (num7 < 0)
30147 {
30148 num7 = 0;
30149 }
30150 if (num8 > Main.maxTilesX)
30151 {
30152 num8 = Main.maxTilesX;
30153 }
30154 if (num9 < 0)
30155 {
30156 num9 = 0;
30157 }
30158 if (num10 > Main.maxTilesY)
30159 {
30160 num10 = Main.maxTilesY;
30161 }
30162 if ((double)num7 < num3)
30163 {
30164 num3 = num7;
30165 }
30166 if ((double)num8 > num4)
30167 {
30168 num4 = num8;
30169 }
30170 if ((double)num9 < num5)
30171 {
30172 num5 = num9;
30173 }
30174 if ((double)num10 > num6)
30175 {
30176 num6 = num10;
30177 }
30178 for (int num11 = num7; num11 < num8; num11++)
30179 {
30180 for (int num12 = num9; num12 < num10; num12++)
30181 {
30182 Main.tile[num11, num12].active(active: false);
30183 Main.tile[num11, num12].wall = (ushort)wallType;
30184 }
30185 }
30186 val2 += val;
30187 val.X += (double)genRand.Next(-10, 11) * 0.05;
30188 val.Y += (double)genRand.Next(-10, 11) * 0.05;
30189 if (val.X > 1.0)
30190 {
30191 val.X = 1.0;
30192 }
30193 if (val.X < -1.0)
30194 {
30195 val.X = -1.0;
30196 }
30197 if (val.Y > 1.0)
30198 {
30199 val.Y = 1.0;
30200 }
30201 if (val.Y < -1.0)
30202 {
30203 val.Y = -1.0;
30204 }
30205 }
30208 GenVars.dRoomSize[GenVars.numDRooms] = (int)num;
30215 }
static UnifiedRandom genRand
Definition WorldGen.cs:1215

References Terraria.WorldBuilding.GenVars.dMaxX, Terraria.WorldBuilding.GenVars.dMaxY, Terraria.WorldBuilding.GenVars.dMinX, Terraria.WorldBuilding.GenVars.dRoomB, Terraria.WorldBuilding.GenVars.dRoomL, Terraria.WorldBuilding.GenVars.dRoomR, Terraria.WorldBuilding.GenVars.dRoomSize, Terraria.WorldBuilding.GenVars.dRoomT, Terraria.WorldBuilding.GenVars.dRoomTreasure, Terraria.WorldBuilding.GenVars.dRoomX, Terraria.WorldBuilding.GenVars.dRoomY, Terraria.Main.maxTilesX, Terraria.Main.maxTilesY, Terraria.WorldBuilding.GenVars.numDRooms, Terraria.Main.tile, Terraria.Main.wallDungeon, ReLogic.Utilities.Vector2D.X, and ReLogic.Utilities.Vector2D.Y.