1949 {
1950 switch (tileType)
1951 {
1952 case 89:
1953 switch (tileCache.frameX / 54)
1954 {
1955 case 0:
1956 case 21:
1957 case 23:
1958 baseOption = 0;
1959 break;
1960 case 43:
1961 baseOption = 2;
1962 break;
1963 default:
1964 baseOption = 1;
1965 break;
1966 }
1967 break;
1968 case 160:
1969 case 627:
1970 case 628:
1971 case 692:
1972 baseOption = (x + y) % 9;
1973 break;
1974 case 461:
1975 if (Main.player[Main.myPlayer].ZoneCorrupt)
1976 {
1977 baseOption = 1;
1978 }
1979 else if (Main.player[Main.myPlayer].ZoneCrimson)
1980 {
1981 baseOption = 2;
1982 }
1983 else if (Main.player[Main.myPlayer].ZoneHallow)
1984 {
1985 baseOption = 3;
1986 }
1987 break;
1988 case 80:
1989 {
1990 WorldGen.GetCactusType(x, y, tileCache.frameX, tileCache.frameY, out var evil, out var good, out var crimson);
1991 if (evil)
1992 {
1993 baseOption = 1;
1994 }
1995 else if (good)
1996 {
1997 baseOption = 2;
1998 }
1999 else if (crimson)
2000 {
2001 baseOption = 3;
2002 }
2003 else
2004 {
2005 baseOption = 0;
2006 }
2007 break;
2008 }
2009 case 529:
2010 {
2011 int num2 = y + 1;
2012 WorldGen.GetBiomeInfluence(x, x, num2, num2, out var corruptCount, out var crimsonCount, out var hallowedCount);
2013 int num3 = corruptCount;
2014 if (num3 < crimsonCount)
2015 {
2016 num3 = crimsonCount;
2017 }
2018 if (num3 < hallowedCount)
2019 {
2020 num3 = hallowedCount;
2021 }
2022 int num4 = 0;
2023 num4 = ((corruptCount == 0 && crimsonCount == 0 && hallowedCount == 0) ? ((x < WorldGen.beachDistance || x > Main.maxTilesX -
WorldGen.beachDistance) ? 1 : 0) : ((hallowedCount == num3) ? 2 : ((crimsonCount != num3) ? 4 : 3)));
2024 baseOption = num4;
2025 break;
2026 }
2027 case 530:
2028 {
2029 int num8 = y - tileCache.frameY % 36 / 18 + 2;
2030 int num9 = x - tileCache.frameX % 54 / 18;
2031 WorldGen.GetBiomeInfluence(num9, num9 + 3, num8, num8, out var corruptCount2, out var crimsonCount2, out var hallowedCount2);
2032 int num10 = corruptCount2;
2033 if (num10 < crimsonCount2)
2034 {
2035 num10 = crimsonCount2;
2036 }
2037 if (num10 < hallowedCount2)
2038 {
2039 num10 = hallowedCount2;
2040 }
2041 int num11 = 0;
2042 num11 = ((corruptCount2 != 0 || crimsonCount2 != 0 || hallowedCount2 != 0) ? ((hallowedCount2 == num10) ? 1 : ((crimsonCount2 != num10) ? 3 : 2)) : 0);
2043 baseOption = num11;
2044 break;
2045 }
2046 case 19:
2047 {
2048 int num6 = tileCache.frameY / 18;
2049 baseOption = 0;
2050 if (num6 == 48)
2051 {
2052 baseOption = 1;
2053 }
2054 break;
2055 }
2056 case 15:
2057 {
2058 int num13 = tileCache.frameY / 40;
2059 baseOption = 0;
2060 if (num13 == 1 || num13 == 20)
2061 {
2062 baseOption = 1;
2063 }
2064 break;
2065 }
2066 case 518:
2067 case 519:
2068 baseOption = tileCache.frameY / 18;
2069 break;
2070 case 4:
2071 if (tileCache.frameX < 66)
2072 {
2073 baseOption = 1;
2074 }
2075 baseOption = 0;
2076 break;
2077 case 572:
2078 baseOption = tileCache.frameY / 36;
2079 break;
2080 case 21:
2081 case 441:
2082 switch (tileCache.frameX / 36)
2083 {
2084 case 1:
2085 case 2:
2086 case 10:
2087 case 13:
2088 case 15:
2089 baseOption = 1;
2090 break;
2091 case 3:
2092 case 4:
2093 baseOption = 2;
2094 break;
2095 case 6:
2096 baseOption = 3;
2097 break;
2098 case 11:
2099 case 17:
2100 baseOption = 4;
2101 break;
2102 default:
2103 baseOption = 0;
2104 break;
2105 }
2106 break;
2107 case 467:
2108 case 468:
2109 {
2110 int num = tileCache.frameX / 36;
2111 switch (num)
2112 {
2113 case 0:
2114 case 1:
2115 case 2:
2116 case 3:
2117 case 4:
2118 case 5:
2119 case 6:
2120 case 7:
2121 case 8:
2122 case 9:
2123 case 10:
2124 case 11:
2125 baseOption = num;
2126 break;
2127 case 12:
2128 case 13:
2129 baseOption = 10;
2130 break;
2131 case 14:
2132 baseOption = 0;
2133 break;
2134 case 15:
2135 baseOption = 10;
2136 break;
2137 case 16:
2138 baseOption = 3;
2139 break;
2140 default:
2141 baseOption = 0;
2142 break;
2143 }
2144 break;
2145 }
2146 case 560:
2147 {
2148 int num = tileCache.frameX / 36;
2149 if ((uint)num <= 2u)
2150 {
2151 baseOption = num;
2152 }
2153 else
2154 {
2155 baseOption = 0;
2156 }
2157 break;
2158 }
2159 case 28:
2160 case 653:
2161 if (tileCache.frameY < 144)
2162 {
2163 baseOption = 0;
2164 }
2165 else if (tileCache.frameY < 252)
2166 {
2167 baseOption = 1;
2168 }
2169 else if (tileCache.frameY < 360 || (tileCache.frameY > 900 && tileCache.frameY < 1008))
2170 {
2171 baseOption = 2;
2172 }
2173 else if (tileCache.frameY < 468)
2174 {
2175 baseOption = 3;
2176 }
2177 else if (tileCache.frameY < 576)
2178 {
2179 baseOption = 4;
2180 }
2181 else if (tileCache.frameY < 684)
2182 {
2183 baseOption = 5;
2184 }
2185 else if (tileCache.frameY < 792)
2186 {
2187 baseOption = 6;
2188 }
2189 else if (tileCache.frameY < 898)
2190 {
2191 baseOption = 8;
2192 }
2193 else if (tileCache.frameY < 1006)
2194 {
2195 baseOption = 7;
2196 }
2197 else if (tileCache.frameY < 1114)
2198 {
2199 baseOption = 0;
2200 }
2201 else if (tileCache.frameY < 1222)
2202 {
2203 baseOption = 3;
2204 }
2205 else
2206 {
2207 baseOption = 7;
2208 }
2209 break;
2210 case 27:
2211 if (tileCache.frameY < 34)
2212 {
2213 baseOption = 1;
2214 }
2215 else
2216 {
2217 baseOption = 0;
2218 }
2219 break;
2220 case 31:
2221 if (tileCache.frameX >= 36)
2222 {
2223 baseOption = 1;
2224 }
2225 else
2226 {
2227 baseOption = 0;
2228 }
2229 break;
2230 case 26:
2231 if (tileCache.frameX >= 54)
2232 {
2233 baseOption = 1;
2234 }
2235 else
2236 {
2237 baseOption = 0;
2238 }
2239 break;
2240 case 137:
2241 switch (tileCache.frameY / 18)
2242 {
2243 default:
2244 baseOption = 0;
2245 break;
2246 case 1:
2247 case 2:
2248 case 3:
2249 case 4:
2250 baseOption = 1;
2251 break;
2252 case 5:
2253 baseOption = 2;
2254 break;
2255 }
2256 break;
2257 case 82:
2258 case 83:
2259 case 84:
2260 if (tileCache.frameX < 18)
2261 {
2262 baseOption = 0;
2263 }
2264 else if (tileCache.frameX < 36)
2265 {
2266 baseOption = 1;
2267 }
2268 else if (tileCache.frameX < 54)
2269 {
2270 baseOption = 2;
2271 }
2272 else if (tileCache.frameX < 72)
2273 {
2274 baseOption = 3;
2275 }
2276 else if (tileCache.frameX < 90)
2277 {
2278 baseOption = 4;
2279 }
2280 else if (tileCache.frameX < 108)
2281 {
2282 baseOption = 5;
2283 }
2284 else
2285 {
2286 baseOption = 6;
2287 }
2288 break;
2289 case 591:
2290 baseOption = tileCache.frameX / 36;
2291 break;
2292 case 105:
2293 if (tileCache.frameX >= 1548 && tileCache.frameX <= 1654)
2294 {
2295 baseOption = 1;
2296 }
2297 else if (tileCache.frameX >= 1656 && tileCache.frameX <= 1798)
2298 {
2299 baseOption = 2;
2300 }
2301 else
2302 {
2303 baseOption = 0;
2304 }
2305 break;
2306 case 133:
2307 if (tileCache.frameX < 52)
2308 {
2309 baseOption = 0;
2310 }
2311 else
2312 {
2313 baseOption = 1;
2314 }
2315 break;
2316 case 134:
2317 if (tileCache.frameX < 28)
2318 {
2319 baseOption = 0;
2320 }
2321 else
2322 {
2323 baseOption = 1;
2324 }
2325 break;
2326 case 149:
2327 baseOption = y % 3;
2328 break;
2329 case 165:
2330 if (tileCache.frameX < 54)
2331 {
2332 baseOption = 0;
2333 }
2334 else if (tileCache.frameX < 106)
2335 {
2336 baseOption = 1;
2337 }
2338 else if (tileCache.frameX >= 216)
2339 {
2340 baseOption = 1;
2341 }
2342 else if (tileCache.frameX < 162)
2343 {
2344 baseOption = 2;
2345 }
2346 else
2347 {
2348 baseOption = 3;
2349 }
2350 break;
2351 case 178:
2352 if (tileCache.frameX < 18)
2353 {
2354 baseOption = 0;
2355 }
2356 else if (tileCache.frameX < 36)
2357 {
2358 baseOption = 1;
2359 }
2360 else if (tileCache.frameX < 54)
2361 {
2362 baseOption = 2;
2363 }
2364 else if (tileCache.frameX < 72)
2365 {
2366 baseOption = 3;
2367 }
2368 else if (tileCache.frameX < 90)
2369 {
2370 baseOption = 4;
2371 }
2372 else if (tileCache.frameX < 108)
2373 {
2374 baseOption = 5;
2375 }
2376 else
2377 {
2378 baseOption = 6;
2379 }
2380 break;
2381 case 184:
2382 if (tileCache.frameX < 22)
2383 {
2384 baseOption = 0;
2385 }
2386 else if (tileCache.frameX < 44)
2387 {
2388 baseOption = 1;
2389 }
2390 else if (tileCache.frameX < 66)
2391 {
2392 baseOption = 2;
2393 }
2394 else if (tileCache.frameX < 88)
2395 {
2396 baseOption = 3;
2397 }
2398 else if (tileCache.frameX < 110)
2399 {
2400 baseOption = 4;
2401 }
2402 else if (tileCache.frameX < 132)
2403 {
2404 baseOption = 5;
2405 }
2406 else if (tileCache.frameX < 154)
2407 {
2408 baseOption = 6;
2409 }
2410 else if (tileCache.frameX < 176)
2411 {
2412 baseOption = 7;
2413 }
2414 else if (tileCache.frameX < 198)
2415 {
2416 baseOption = 8;
2417 }
2418 else if (tileCache.frameX < 220)
2419 {
2420 baseOption = 9;
2421 }
2422 else if (tileCache.frameX < 242)
2423 {
2424 baseOption = 10;
2425 }
2426 break;
2427 case 650:
2428 {
2429 int num = tileCache.frameX / 36;
2430 int num12 = tileCache.frameY / 18 - 1;
2431 num += num12 * 18;
2432 if (num < 6 || num == 19 || num == 20 || num == 21 || num == 22 || num == 23 || num == 24 || num == 33 || num == 38 || num == 39 || num == 40)
2433 {
2434 baseOption = 0;
2435 }
2436 else if (num < 16)
2437 {
2438 baseOption = 2;
2439 }
2440 else if (num < 19 || num == 31 || num == 32)
2441 {
2442 baseOption = 1;
2443 }
2444 else if (num < 31)
2445 {
2446 baseOption = 3;
2447 }
2448 else if (num < 38)
2449 {
2450 baseOption = 4;
2451 }
2452 else if (num < 59)
2453 {
2454 baseOption = 0;
2455 }
2456 else if (num < 62)
2457 {
2458 baseOption = 1;
2459 }
2460 break;
2461 }
2462 case 649:
2463 {
2464 int num = tileCache.frameX / 18;
2465 if (num < 6 || num == 28 || num == 29 || num == 30 || num == 31 || num == 32)
2466 {
2467 baseOption = 0;
2468 }
2469 else if (num < 12 || num == 33 || num == 34 || num == 35)
2470 {
2471 baseOption = 1;
2472 }
2473 else if (num < 28)
2474 {
2475 baseOption = 2;
2476 }
2477 else if (num < 48)
2478 {
2479 baseOption = 3;
2480 }
2481 else if (num < 54)
2482 {
2483 baseOption = 4;
2484 }
2485 else if (num < 72)
2486 {
2487 baseOption = 0;
2488 }
2489 else if (num == 72)
2490 {
2491 baseOption = 1;
2492 }
2493 break;
2494 }
2495 case 185:
2496 {
2497 int num;
2498 if (tileCache.frameY < 18)
2499 {
2500 num = tileCache.frameX / 18;
2501 if (num < 6 || num == 28 || num == 29 || num == 30 || num == 31 || num == 32)
2502 {
2503 baseOption = 0;
2504 }
2505 else if (num < 12 || num == 33 || num == 34 || num == 35)
2506 {
2507 baseOption = 1;
2508 }
2509 else if (num < 28)
2510 {
2511 baseOption = 2;
2512 }
2513 else if (num < 48)
2514 {
2515 baseOption = 3;
2516 }
2517 else if (num < 54)
2518 {
2519 baseOption = 4;
2520 }
2521 else if (num < 72)
2522 {
2523 baseOption = 0;
2524 }
2525 else if (num == 72)
2526 {
2527 baseOption = 1;
2528 }
2529 break;
2530 }
2531 num = tileCache.frameX / 36;
2532 int num7 = tileCache.frameY / 18 - 1;
2533 num += num7 * 18;
2534 if (num < 6 || num == 19 || num == 20 || num == 21 || num == 22 || num == 23 || num == 24 || num == 33 || num == 38 || num == 39 || num == 40)
2535 {
2536 baseOption = 0;
2537 }
2538 else if (num < 16)
2539 {
2540 baseOption = 2;
2541 }
2542 else if (num < 19 || num == 31 || num == 32)
2543 {
2544 baseOption = 1;
2545 }
2546 else if (num < 31)
2547 {
2548 baseOption = 3;
2549 }
2550 else if (num < 38)
2551 {
2552 baseOption = 4;
2553 }
2554 else if (num < 59)
2555 {
2556 baseOption = 0;
2557 }
2558 else if (num < 62)
2559 {
2560 baseOption = 1;
2561 }
2562 break;
2563 }
2564 case 186:
2565 case 647:
2566 {
2567 int num = tileCache.frameX / 54;
2568 if (num < 7)
2569 {
2570 baseOption = 2;
2571 }
2572 else if (num < 22 || num == 33 || num == 34 || num == 35)
2573 {
2574 baseOption = 0;
2575 }
2576 else if (num < 25)
2577 {
2578 baseOption = 1;
2579 }
2580 else if (num == 25)
2581 {
2582 baseOption = 5;
2583 }
2584 else if (num < 32)
2585 {
2586 baseOption = 3;
2587 }
2588 break;
2589 }
2590 case 187:
2591 case 648:
2592 {
2593 int num = tileCache.frameX / 54;
2594 int num5 = tileCache.frameY / 36;
2595 num += num5 * 36;
2596 if (num < 3 || num == 14 || num == 15 || num == 16)
2597 {
2598 baseOption = 0;
2599 }
2600 else if (num < 6)
2601 {
2602 baseOption = 6;
2603 }
2604 else if (num < 9)
2605 {
2606 baseOption = 7;
2607 }
2608 else if (num < 14)
2609 {
2610 baseOption = 4;
2611 }
2612 else if (num < 18)
2613 {
2614 baseOption = 4;
2615 }
2616 else if (num < 23)
2617 {
2618 baseOption = 8;
2619 }
2620 else if (num < 25)
2621 {
2622 baseOption = 0;
2623 }
2624 else if (num < 29)
2625 {
2626 baseOption = 1;
2627 }
2628 else if (num < 47)
2629 {
2630 baseOption = 0;
2631 }
2632 else if (num < 50)
2633 {
2634 baseOption = 1;
2635 }
2636 else if (num < 52)
2637 {
2638 baseOption = 10;
2639 }
2640 else if (num < 55)
2641 {
2642 baseOption = 2;
2643 }
2644 break;
2645 }
2646 case 227:
2647 baseOption = tileCache.frameX / 34;
2648 break;
2649 case 129:
2650 if (tileCache.frameX >= 324)
2651 {
2652 baseOption = 1;
2653 }
2654 else
2655 {
2656 baseOption = 0;
2657 }
2658 break;
2659 case 240:
2660 {
2661 int num = tileCache.frameX / 54;
2662 int num14 = tileCache.frameY / 54;
2663 num += num14 * 36;
2664 if ((num < 0 || num > 11) && (num < 47 || num > 53))
2665 {
2666 switch (num)
2667 {
2668 case 72:
2669 case 73:
2670 case 75:
2671 break;
2672 case 12:
2673 case 13:
2674 case 14:
2675 case 15:
2676 baseOption = 1;
2677 return;
2678 default:
2679 switch (num)
2680 {
2681 case 16:
2682 case 17:
2683 baseOption = 2;
2684 break;
2685 default:
2686 if (num < 63 || num > 71)
2687 {
2688 switch (num)
2689 {
2690 case 74:
2691 case 76:
2692 case 77:
2693 case 78:
2694 case 79:
2695 case 80:
2696 case 81:
2697 case 82:
2698 case 83:
2699 case 84:
2700 case 85:
2701 case 86:
2702 case 87:
2703 case 88:
2704 case 89:
2705 case 90:
2706 case 91:
2707 case 92:
2708 break;
2709 default:
2710 if (num >= 41 && num <= 45)
2711 {
2712 baseOption = 3;
2713 }
2714 else if (num == 46)
2715 {
2716 baseOption = 4;
2717 }
2718 return;
2719 }
2720 }
2721 goto case 18;
2722 case 18:
2723 case 19:
2724 case 20:
2725 case 21:
2726 case 22:
2727 case 23:
2728 case 24:
2729 case 25:
2730 case 26:
2731 case 27:
2732 case 28:
2733 case 29:
2734 case 30:
2735 case 31:
2736 case 32:
2737 case 33:
2738 case 34:
2739 case 35:
2740 baseOption = 1;
2741 break;
2742 }
2743 return;
2744 }
2745 }
2746 baseOption = 0;
2747 break;
2748 }
2749 case 242:
2750 {
2751 int num = tileCache.frameY / 72;
2752 if (tileCache.frameX / 106 == 0 && num >= 22 && num <= 24)
2753 {
2754 baseOption = 1;
2755 }
2756 else
2757 {
2758 baseOption = 0;
2759 }
2760 break;
2761 }
2762 case 440:
2763 {
2764 int num = tileCache.frameX / 54;
2765 if (num > 6)
2766 {
2767 num = 6;
2768 }
2769 baseOption = num;
2770 break;
2771 }
2772 case 457:
2773 {
2774 int num = tileCache.frameX / 36;
2775 if (num > 4)
2776 {
2777 num = 4;
2778 }
2779 baseOption = num;
2780 break;
2781 }
2782 case 453:
2783 {
2784 int num = tileCache.frameX / 36;
2785 if (num > 2)
2786 {
2787 num = 2;
2788 }
2789 baseOption = num;
2790 break;
2791 }
2792 case 419:
2793 {
2794 int num = tileCache.frameX / 18;
2795 if (num > 2)
2796 {
2797 num = 2;
2798 }
2799 baseOption = num;
2800 break;
2801 }
2802 case 428:
2803 {
2804 int num = tileCache.frameY / 18;
2805 if (num > 3)
2806 {
2807 num = 3;
2808 }
2809 baseOption = num;
2810 break;
2811 }
2812 case 420:
2813 {
2814 int num = tileCache.frameY / 18;
2815 if (num > 5)
2816 {
2817 num = 5;
2818 }
2819 baseOption = num;
2820 break;
2821 }
2822 case 423:
2823 {
2824 int num = tileCache.frameY / 18;
2825 if (num > 6)
2826 {
2827 num = 6;
2828 }
2829 baseOption = num;
2830 break;
2831 }
2832 case 493:
2833 if (tileCache.frameX < 18)
2834 {
2835 baseOption = 0;
2836 }
2837 else if (tileCache.frameX < 36)
2838 {
2839 baseOption = 1;
2840 }
2841 else if (tileCache.frameX < 54)
2842 {
2843 baseOption = 2;
2844 }
2845 else if (tileCache.frameX < 72)
2846 {
2847 baseOption = 3;
2848 }
2849 else if (tileCache.frameX < 90)
2850 {
2851 baseOption = 4;
2852 }
2853 else
2854 {
2855 baseOption = 5;
2856 }
2857 break;
2858 case 548:
2859 if (tileCache.frameX / 54 < 7)
2860 {
2861 baseOption = 0;
2862 }
2863 else
2864 {
2865 baseOption = 1;
2866 }
2867 break;
2868 case 597:
2869 {
2870 int num = tileCache.frameX / 54;
2871 if ((uint)num <= 8u)
2872 {
2873 baseOption = num;
2874 }
2875 else
2876 {
2877 baseOption = 0;
2878 }
2879 break;
2880 }
2881 default:
2882 baseOption = 0;
2883 break;
2884 }
2885 }