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

◆ Initialize()

static void Terraria.Minecart.Initialize ( )
inlinestatic

Definition at line 91 of file Minecart.cs.

92 {
93 //IL_00f2: Unknown result type (might be due to invalid IL or missing references)
94 //IL_00f7: Unknown result type (might be due to invalid IL or missing references)
95 //IL_0120: Unknown result type (might be due to invalid IL or missing references)
96 //IL_0125: Unknown result type (might be due to invalid IL or missing references)
97 //IL_0169: Unknown result type (might be due to invalid IL or missing references)
98 //IL_016e: Unknown result type (might be due to invalid IL or missing references)
99 //IL_01b2: Unknown result type (might be due to invalid IL or missing references)
100 //IL_01b7: Unknown result type (might be due to invalid IL or missing references)
101 //IL_021c: Unknown result type (might be due to invalid IL or missing references)
102 //IL_0221: Unknown result type (might be due to invalid IL or missing references)
103 //IL_0286: Unknown result type (might be due to invalid IL or missing references)
104 //IL_028b: Unknown result type (might be due to invalid IL or missing references)
105 //IL_02dc: Unknown result type (might be due to invalid IL or missing references)
106 //IL_02e1: Unknown result type (might be due to invalid IL or missing references)
107 //IL_0332: Unknown result type (might be due to invalid IL or missing references)
108 //IL_0337: Unknown result type (might be due to invalid IL or missing references)
109 //IL_037e: Unknown result type (might be due to invalid IL or missing references)
110 //IL_0383: Unknown result type (might be due to invalid IL or missing references)
111 //IL_03ca: Unknown result type (might be due to invalid IL or missing references)
112 //IL_03cf: Unknown result type (might be due to invalid IL or missing references)
113 //IL_0427: Unknown result type (might be due to invalid IL or missing references)
114 //IL_042c: Unknown result type (might be due to invalid IL or missing references)
115 //IL_0484: Unknown result type (might be due to invalid IL or missing references)
116 //IL_0489: Unknown result type (might be due to invalid IL or missing references)
117 //IL_04eb: Unknown result type (might be due to invalid IL or missing references)
118 //IL_04f0: Unknown result type (might be due to invalid IL or missing references)
119 //IL_0552: Unknown result type (might be due to invalid IL or missing references)
120 //IL_0557: Unknown result type (might be due to invalid IL or missing references)
121 //IL_058b: Unknown result type (might be due to invalid IL or missing references)
122 //IL_0590: Unknown result type (might be due to invalid IL or missing references)
123 //IL_05c4: Unknown result type (might be due to invalid IL or missing references)
124 //IL_05c9: Unknown result type (might be due to invalid IL or missing references)
125 //IL_0626: Unknown result type (might be due to invalid IL or missing references)
126 //IL_062b: Unknown result type (might be due to invalid IL or missing references)
127 //IL_0688: Unknown result type (might be due to invalid IL or missing references)
128 //IL_068d: Unknown result type (might be due to invalid IL or missing references)
129 //IL_06ea: Unknown result type (might be due to invalid IL or missing references)
130 //IL_06ef: Unknown result type (might be due to invalid IL or missing references)
131 //IL_074c: Unknown result type (might be due to invalid IL or missing references)
132 //IL_0751: Unknown result type (might be due to invalid IL or missing references)
133 //IL_0798: Unknown result type (might be due to invalid IL or missing references)
134 //IL_079d: Unknown result type (might be due to invalid IL or missing references)
135 //IL_07ce: Unknown result type (might be due to invalid IL or missing references)
136 //IL_07d3: Unknown result type (might be due to invalid IL or missing references)
137 //IL_080f: Unknown result type (might be due to invalid IL or missing references)
138 //IL_0814: Unknown result type (might be due to invalid IL or missing references)
139 //IL_0850: Unknown result type (might be due to invalid IL or missing references)
140 //IL_0855: Unknown result type (might be due to invalid IL or missing references)
141 //IL_089a: Unknown result type (might be due to invalid IL or missing references)
142 //IL_089f: Unknown result type (might be due to invalid IL or missing references)
143 //IL_08e4: Unknown result type (might be due to invalid IL or missing references)
144 //IL_08e9: Unknown result type (might be due to invalid IL or missing references)
145 //IL_0942: Unknown result type (might be due to invalid IL or missing references)
146 //IL_0947: Unknown result type (might be due to invalid IL or missing references)
147 //IL_09a0: Unknown result type (might be due to invalid IL or missing references)
148 //IL_09a5: Unknown result type (might be due to invalid IL or missing references)
149 //IL_0a08: Unknown result type (might be due to invalid IL or missing references)
150 //IL_0a0d: Unknown result type (might be due to invalid IL or missing references)
151 //IL_0a70: Unknown result type (might be due to invalid IL or missing references)
152 //IL_0a75: Unknown result type (might be due to invalid IL or missing references)
153 //IL_0aae: Unknown result type (might be due to invalid IL or missing references)
154 //IL_0ab3: Unknown result type (might be due to invalid IL or missing references)
155 //IL_0aec: Unknown result type (might be due to invalid IL or missing references)
156 //IL_0af1: Unknown result type (might be due to invalid IL or missing references)
157 //IL_0b48: Unknown result type (might be due to invalid IL or missing references)
158 //IL_0b4d: Unknown result type (might be due to invalid IL or missing references)
159 //IL_0ba4: Unknown result type (might be due to invalid IL or missing references)
160 //IL_0ba9: Unknown result type (might be due to invalid IL or missing references)
161 //IL_0c00: Unknown result type (might be due to invalid IL or missing references)
162 //IL_0c05: Unknown result type (might be due to invalid IL or missing references)
163 //IL_0c5c: Unknown result type (might be due to invalid IL or missing references)
164 //IL_0c61: Unknown result type (might be due to invalid IL or missing references)
165 //IL_0c7b: Unknown result type (might be due to invalid IL or missing references)
166 //IL_0c80: Unknown result type (might be due to invalid IL or missing references)
167 //IL_0c96: Unknown result type (might be due to invalid IL or missing references)
168 //IL_0c9b: Unknown result type (might be due to invalid IL or missing references)
169 //IL_0cb1: Unknown result type (might be due to invalid IL or missing references)
170 //IL_0cb6: Unknown result type (might be due to invalid IL or missing references)
171 //IL_0ccc: Unknown result type (might be due to invalid IL or missing references)
172 //IL_0cd1: Unknown result type (might be due to invalid IL or missing references)
173 //IL_0ce8: Unknown result type (might be due to invalid IL or missing references)
174 //IL_0cf2: Unknown result type (might be due to invalid IL or missing references)
175 //IL_0cf7: Unknown result type (might be due to invalid IL or missing references)
176 if (!Main.dedServ && (float)TextureAssets.MinecartMount.Width() != 50f)
177 {
178 throw new Exception("Be sure to update Minecart.textureWidth to match the actual texture size of " + 50f + ".");
179 }
180 _rightSideConnection = new int[36];
181 _leftSideConnection = new int[36];
182 _trackType = new int[36];
183 _boostLeft = new bool[36];
184 _texturePosition = (Vector2[])(object)new Vector2[40];
185 _tileHeight = new int[36][];
186 for (int i = 0; i < 36; i++)
187 {
188 int[] array = new int[8];
189 for (int j = 0; j < array.Length; j++)
190 {
191 array[j] = 5;
192 }
193 _tileHeight[i] = array;
194 }
195 int num = 0;
198 _tileHeight[num][0] = -4;
199 _tileHeight[num][7] = -4;
200 _texturePosition[num] = new Vector2(0f, 0f);
201 num++;
204 _texturePosition[num] = new Vector2(1f, 0f);
205 num++;
208 for (int k = 0; k < 4; k++)
209 {
210 _tileHeight[num][k] = -1;
211 }
212 _texturePosition[num] = new Vector2(2f, 1f);
213 num++;
216 for (int l = 4; l < 8; l++)
217 {
218 _tileHeight[num][l] = -1;
219 }
220 _texturePosition[num] = new Vector2(3f, 1f);
221 num++;
224 _tileHeight[num][0] = 1;
225 _tileHeight[num][1] = 2;
226 _tileHeight[num][2] = 3;
227 _tileHeight[num][3] = 3;
228 _tileHeight[num][4] = 4;
229 _tileHeight[num][5] = 4;
230 _texturePosition[num] = new Vector2(0f, 2f);
231 num++;
234 _tileHeight[num][2] = 4;
235 _tileHeight[num][3] = 4;
236 _tileHeight[num][4] = 3;
237 _tileHeight[num][5] = 3;
238 _tileHeight[num][6] = 2;
239 _tileHeight[num][7] = 1;
240 _texturePosition[num] = new Vector2(1f, 2f);
241 num++;
244 _tileHeight[num][4] = 6;
245 _tileHeight[num][5] = 6;
246 _tileHeight[num][6] = 7;
247 _tileHeight[num][7] = 8;
248 _texturePosition[num] = new Vector2(0f, 1f);
249 num++;
252 _tileHeight[num][0] = 8;
253 _tileHeight[num][1] = 7;
254 _tileHeight[num][2] = 6;
255 _tileHeight[num][3] = 6;
256 _texturePosition[num] = new Vector2(1f, 1f);
257 num++;
260 for (int m = 0; m < 8; m++)
261 {
262 _tileHeight[num][m] = 8 - m;
263 }
264 _texturePosition[num] = new Vector2(0f, 3f);
265 num++;
268 for (int n = 0; n < 8; n++)
269 {
270 _tileHeight[num][n] = n + 1;
271 }
272 _texturePosition[num] = new Vector2(1f, 3f);
273 num++;
276 _tileHeight[num][0] = 1;
277 _tileHeight[num][1] = 2;
278 for (int num12 = 2; num12 < 8; num12++)
279 {
280 _tileHeight[num][num12] = -1;
281 }
282 _texturePosition[num] = new Vector2(4f, 1f);
283 num++;
286 _tileHeight[num][6] = 2;
287 _tileHeight[num][7] = 1;
288 for (int num23 = 0; num23 < 6; num23++)
289 {
290 _tileHeight[num][num23] = -1;
291 }
292 _texturePosition[num] = new Vector2(5f, 1f);
293 num++;
296 _tileHeight[num][0] = 8;
297 _tileHeight[num][1] = 7;
298 _tileHeight[num][2] = 6;
299 for (int num26 = 3; num26 < 8; num26++)
300 {
301 _tileHeight[num][num26] = -1;
302 }
303 _texturePosition[num] = new Vector2(6f, 1f);
304 num++;
307 _tileHeight[num][5] = 6;
308 _tileHeight[num][6] = 7;
309 _tileHeight[num][7] = 8;
310 for (int num27 = 0; num27 < 5; num27++)
311 {
312 _tileHeight[num][num27] = -1;
313 }
314 _texturePosition[num] = new Vector2(7f, 1f);
315 num++;
318 _tileHeight[num][0] = -4;
319 _texturePosition[num] = new Vector2(2f, 0f);
320 num++;
323 _tileHeight[num][7] = -4;
324 _texturePosition[num] = new Vector2(3f, 0f);
325 num++;
328 for (int num28 = 0; num28 < 6; num28++)
329 {
330 _tileHeight[num][num28] = num28 + 1;
331 }
332 _tileHeight[num][6] = -3;
333 _tileHeight[num][7] = -3;
334 _texturePosition[num] = new Vector2(4f, 0f);
335 num++;
338 _tileHeight[num][0] = -3;
339 _tileHeight[num][1] = -3;
340 for (int num29 = 2; num29 < 8; num29++)
341 {
342 _tileHeight[num][num29] = 8 - num29;
343 }
344 _texturePosition[num] = new Vector2(5f, 0f);
345 num++;
348 for (int num30 = 0; num30 < 6; num30++)
349 {
350 _tileHeight[num][num30] = 8 - num30;
351 }
352 _tileHeight[num][6] = -3;
353 _tileHeight[num][7] = -3;
354 _texturePosition[num] = new Vector2(6f, 0f);
355 num++;
358 _tileHeight[num][0] = -3;
359 _tileHeight[num][1] = -3;
360 for (int num31 = 2; num31 < 8; num31++)
361 {
362 _tileHeight[num][num31] = num31 + 1;
363 }
364 _texturePosition[num] = new Vector2(7f, 0f);
365 num++;
368 _tileHeight[num][0] = -4;
369 _tileHeight[num][7] = -4;
370 _trackType[num] = 1;
371 _texturePosition[num] = new Vector2(0f, 4f);
372 num++;
375 _trackType[num] = 1;
376 _texturePosition[num] = new Vector2(1f, 4f);
377 num++;
380 _tileHeight[num][0] = -4;
381 _trackType[num] = 1;
382 _texturePosition[num] = new Vector2(0f, 5f);
383 num++;
386 _tileHeight[num][7] = -4;
387 _trackType[num] = 1;
388 _texturePosition[num] = new Vector2(1f, 5f);
389 num++;
392 for (int num2 = 0; num2 < 6; num2++)
393 {
394 _tileHeight[num][num2] = -2;
395 }
396 _texturePosition[num] = new Vector2(2f, 2f);
397 num++;
400 for (int num3 = 2; num3 < 8; num3++)
401 {
402 _tileHeight[num][num3] = -2;
403 }
404 _texturePosition[num] = new Vector2(3f, 2f);
405 num++;
408 _tileHeight[num][0] = 1;
409 _tileHeight[num][1] = 2;
410 for (int num4 = 2; num4 < 8; num4++)
411 {
412 _tileHeight[num][num4] = -2;
413 }
414 _texturePosition[num] = new Vector2(4f, 2f);
415 num++;
418 _tileHeight[num][6] = 2;
419 _tileHeight[num][7] = 1;
420 for (int num5 = 0; num5 < 6; num5++)
421 {
422 _tileHeight[num][num5] = -2;
423 }
424 _texturePosition[num] = new Vector2(5f, 2f);
425 num++;
428 _tileHeight[num][0] = 8;
429 _tileHeight[num][1] = 7;
430 _tileHeight[num][2] = 6;
431 for (int num6 = 3; num6 < 8; num6++)
432 {
433 _tileHeight[num][num6] = -2;
434 }
435 _texturePosition[num] = new Vector2(6f, 2f);
436 num++;
439 _tileHeight[num][5] = 6;
440 _tileHeight[num][6] = 7;
441 _tileHeight[num][7] = 8;
442 for (int num7 = 0; num7 < 5; num7++)
443 {
444 _tileHeight[num][num7] = -2;
445 }
446 _texturePosition[num] = new Vector2(7f, 2f);
447 num++;
450 _trackType[num] = 2;
451 _boostLeft[num] = false;
452 _texturePosition[num] = new Vector2(2f, 3f);
453 num++;
456 _trackType[num] = 2;
457 _boostLeft[num] = true;
458 _texturePosition[num] = new Vector2(3f, 3f);
459 num++;
462 for (int num8 = 0; num8 < 8; num8++)
463 {
464 _tileHeight[num][num8] = 8 - num8;
465 }
466 _trackType[num] = 2;
467 _boostLeft[num] = false;
468 _texturePosition[num] = new Vector2(4f, 3f);
469 num++;
472 for (int num9 = 0; num9 < 8; num9++)
473 {
474 _tileHeight[num][num9] = num9 + 1;
475 }
476 _trackType[num] = 2;
477 _boostLeft[num] = true;
478 _texturePosition[num] = new Vector2(5f, 3f);
479 num++;
482 for (int num10 = 0; num10 < 8; num10++)
483 {
484 _tileHeight[num][num10] = 8 - num10;
485 }
486 _trackType[num] = 2;
487 _boostLeft[num] = true;
488 _texturePosition[num] = new Vector2(6f, 3f);
489 num++;
492 for (int num11 = 0; num11 < 8; num11++)
493 {
494 _tileHeight[num][num11] = num11 + 1;
495 }
496 _trackType[num] = 2;
497 _boostLeft[num] = false;
498 _texturePosition[num] = new Vector2(7f, 3f);
499 num++;
500 _texturePosition[36] = new Vector2(0f, 6f);
501 _texturePosition[37] = new Vector2(1f, 6f);
502 _texturePosition[39] = new Vector2(0f, 7f);
503 _texturePosition[38] = new Vector2(1f, 7f);
504 for (int num13 = 0; num13 < _texturePosition.Length; num13++)
505 {
507 reference *= 18f;
508 }
509 for (int num14 = 0; num14 < _tileHeight.Length; num14++)
510 {
511 int[] array2 = _tileHeight[num14];
512 for (int num15 = 0; num15 < array2.Length; num15++)
513 {
514 if (array2[num15] >= 0)
515 {
516 array2[num15] = (8 - array2[num15]) * 2;
517 }
518 }
519 }
520 int[] array3 = new int[36];
521 _trackSwitchOptions = new int[64][];
522 for (int num16 = 0; num16 < 64; num16++)
523 {
524 int num17 = 0;
525 for (int num18 = 1; num18 < 256; num18 <<= 1)
526 {
527 if ((num16 & num18) == num18)
528 {
529 num17++;
530 }
531 }
532 int num19 = 0;
533 for (int num20 = 0; num20 < 36; num20++)
534 {
535 array3[num20] = -1;
536 int num21 = 0;
537 switch (_leftSideConnection[num20])
538 {
539 case 0:
540 num21 |= 1;
541 break;
542 case 1:
543 num21 |= 2;
544 break;
545 case 2:
546 num21 |= 4;
547 break;
548 }
550 {
551 case 0:
552 num21 |= 8;
553 break;
554 case 1:
555 num21 |= 0x10;
556 break;
557 case 2:
558 num21 |= 0x20;
559 break;
560 }
561 if (num17 < 2)
562 {
563 if (num16 != num21)
564 {
565 continue;
566 }
567 }
568 else if (num21 == 0 || (num16 & num21) != num21)
569 {
570 continue;
571 }
572 array3[num20] = num20;
573 num19++;
574 }
575 if (num19 == 0)
576 {
577 continue;
578 }
579 int[] array4 = new int[num19];
580 int num22 = 0;
581 for (int num24 = 0; num24 < 36; num24++)
582 {
583 if (array3[num24] != -1)
584 {
586 num22++;
587 }
588 }
590 }
594 for (int num25 = 0; num25 < _trackType.Length; num25++)
595 {
596 switch (_trackType[num25])
597 {
598 case 1:
599 if (_firstPressureFrame == -1)
600 {
601 _firstPressureFrame = (short)num25;
602 }
603 break;
604 case 2:
605 if (_boostLeft[num25])
606 {
607 if (_firstLeftBoostFrame == -1)
608 {
610 }
611 }
612 else if (_firstRightBoostFrame == -1)
613 {
615 }
616 break;
617 }
618 }
619 }
static Asset< Texture2D > MinecartMount
static int[] _leftSideConnection
Definition Minecart.cs:71
static bool[] _boostLeft
Definition Minecart.cs:77
static int[][] _trackSwitchOptions
Definition Minecart.cs:87
static short _firstPressureFrame
Definition Minecart.cs:81
static short _firstRightBoostFrame
Definition Minecart.cs:85
static Vector2[] _texturePosition
Definition Minecart.cs:79
static short _firstLeftBoostFrame
Definition Minecart.cs:83
static int[] _trackType
Definition Minecart.cs:75
static int[] _rightSideConnection
Definition Minecart.cs:73
static int[][] _tileHeight
Definition Minecart.cs:89

References Terraria.Minecart._boostLeft, Terraria.Minecart._firstLeftBoostFrame, Terraria.Minecart._firstPressureFrame, Terraria.Minecart._firstRightBoostFrame, Terraria.Minecart._leftSideConnection, Terraria.Minecart._rightSideConnection, Terraria.Minecart._texturePosition, Terraria.Minecart._tileHeight, Terraria.Minecart._trackSwitchOptions, Terraria.Minecart._trackType, Terraria.Main.dedServ, and Terraria.GameContent.TextureAssets.MinecartMount.

Referenced by Terraria.Main.Initialize_AlmostEverything(), and Terraria.Main.PostContentLoadInitialize().

+ Here is the caller graph for this function: