Advertisement
Guest User

YDK 2 EDOPro Goat

a guest
Jan 17th, 2021
1,067
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 10.00 KB | None | 0 0
  1. using System;
  2. using System.IO;
  3. using System.Collections.Generic;
  4. using System.Runtime.InteropServices;
  5.  
  6. namespace YDK2EDOPro
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             if (args.Length == 0)
  13.             {
  14.                 MessageBox(0, "Please drag & drop one or more YDK-files onto me...", "YDK 2 EDOPro", MB_ICONASTERISK | MB_OK);
  15.                 return;
  16.             }
  17.  
  18.             string basePath = Path.GetDirectoryName(args[0]) + Path.DirectorySeparatorChar;
  19.             if (MessageBox(0, "Copy fixed decks to current location?", "YDK 2 EDOPro", MB_ICONQUESTION | MB_YESNO) == IDYES)
  20.                 basePath = Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location) + Path.DirectorySeparatorChar;
  21.             foreach (string file in args)
  22.             {
  23.                 if (!file.EndsWith(".ydk"))
  24.                     continue;
  25.                 string[] rawDeck = File.ReadAllLines(file);
  26.                 string[] variantDeck = new string[rawDeck.Length];
  27.                 rawDeck.CopyTo(variantDeck, 0);
  28.                 for (int i = 0; i < rawDeck.Length; i++)
  29.                 {
  30.                     if (rawDeck[i].Length < 4 || !Char.IsDigit(rawDeck[i][0]))
  31.                         continue;
  32.                     if (Int32.TryParse(rawDeck[i], out int cardId))
  33.                     {
  34.                         if (goat_Aliases.ContainsKey(cardId))
  35.                             variantDeck[i] = goat_Aliases[cardId].ToString();
  36.                     }
  37.                 }
  38.                 string filePath = basePath + Path.GetFileNameWithoutExtension(file) + " (EDO).ydk";
  39.                 if (File.Exists(filePath))
  40.                     File.Delete(filePath);
  41.                 File.WriteAllLines(filePath, variantDeck);
  42.             }
  43.         }
  44.  
  45.         private static Dictionary<int, int> goat_Aliases = new Dictionary<int, int>()
  46.         {
  47.             { 126218, 504700000 },
  48.             { 218704, 504700001 },
  49.             { 596051, 504700002 },
  50.             { 980973, 504700003 },
  51.             { 1689516, 504700004 },
  52.             { 1965724, 504700005 },
  53.             { 1995985, 504700006 },
  54.             { 2111707, 504700007 },
  55.             { 2926176, 504700133 },
  56.             { 6104968, 504700008 },
  57.             { 6390406, 504700009 },
  58.             { 6850209, 504700010 },
  59.             { 7512044, 504700011 },
  60.             { 8131171, 511000818 },
  61.             { 8964854, 504700012 },
  62.             { 9156135, 504700013 },
  63.             { 10035717, 504700014 },
  64.             { 11224103, 504700015 },
  65.             { 11760174, 504700016 },
  66.             { 12503902, 504700017 },
  67.             { 12923641, 504700018 },
  68.             { 13026402, 504700019 },
  69.             { 13604200, 504700020 },
  70.             { 14878871, 504700179 },
  71.             { 15013468, 504700021 },
  72.             { 15653824, 504700022 },
  73.             { 16227556, 511002982 },
  74.             { 16430187, 504700023 },
  75.             { 16762927, 504700024 },
  76.             { 17449108, 504700025 },
  77.             { 17655904, 504700026 },
  78.             { 17814387, 504700027 },
  79.             { 18190572, 504700028 },
  80.             { 19612721, 504700029 },
  81.             { 20436034, 504700030 },
  82.             { 21070956, 504700180 },
  83.             { 21593977, 21593987 },
  84.             { 22020907, 504700031 },
  85.             { 22359980, 504700032 },
  86.             { 22567609, 504700033 },
  87.             { 22873798, 504700034 },
  88.             { 22996376, 504700035 },
  89.             { 23118924, 504700036 },
  90.             { 23171610, 504700037 },
  91.             { 23205979, 504700038 },
  92.             { 23265313, 504700039 },
  93.             { 23265594, 511002851 },
  94.             { 23401839, 504700040 },
  95.             { 23401840, 504700040 },
  96.             { 23927567, 504700041 },
  97.             { 24140059, 504700042 },
  98.             { 24294108, 504700043 },
  99.             { 24317029, 504700044 },
  100.             { 25119460, 504700045 },
  101.             { 25290459, 504700046 },
  102.             { 26202165, 504700178 },
  103.             { 26902560, 504700047 },
  104.             { 26931058, 504700048 },
  105.             { 27770341, 504700049 },
  106.             { 29267084, 504700050 },
  107.             { 29389368, 504700051 },
  108.             { 29401950, 504700052 },
  109.             { 30314994, 504700053 },
  110.             { 31786629, 504700054 },
  111.             { 32807846, 504700055 },
  112.             { 32919136, 504700056 },
  113.             { 34088136, 504700057 },
  114.             { 34830502, 504700058 },
  115.             { 37580756, 504700059 },
  116.             { 37721209, 504700060 },
  117.             { 37957847, 504700061 },
  118.             { 38369349, 504700062 },
  119.             { 38552107, 504700063 },
  120.             { 39191307, 504700064 },
  121.             { 39892082, 504700065 },
  122.             { 40172183, 504700066 },
  123.             { 40240595, 504700067 },
  124.             { 40619825, 504700068 },
  125.             { 40737112, 511001039 },
  126.             { 41398771, 504700069 },
  127.             { 41925941, 504700070 },
  128.             { 43040603, 504700071 },
  129.             { 43586926, 511000868 },
  130.             { 44209392, 504700072 },
  131.             { 45547649, 504700073 },
  132.             { 45894482, 511003006 },
  133.             { 46363422, 504700074 },
  134.             { 46384672, 504700075 },
  135.             { 47025270, 504700076 },
  136.             { 47355498, 511002998 },
  137.             { 47507260, 504700077 },
  138.             { 47829960, 504700078 },
  139.             { 48148828, 504700079 },
  140.             { 49217579, 504700080 },
  141.             { 49441499, 504700081 },
  142.             { 49681811, 504700082 },
  143.             { 51402177, 504700083 },
  144.             { 52624755, 504700084 },
  145.             { 52684508, 504700085 },
  146.             { 53183600, 504700086 },
  147.             { 53839837, 504700087 },
  148.             { 54098121, 504700088 },
  149.             { 55348096, 504700089 },
  150.             { 56916805, 504700090 },
  151.             { 56948373, 504700091 },
  152.             { 57617178, 504700092 },
  153.             { 57839750, 504700093 },
  154.             { 57882509, 504700094 },
  155.             { 58551308, 504700095 },
  156.             { 58577036, 504700096 },
  157.             { 60102563, 504700097 },
  158.             { 60806437, 504700098 },
  159.             { 61441708, 504700099 },
  160.             { 61622107, 504700100 },
  161.             { 61740673, 511002996 },
  162.             { 62340868, 504700101 },
  163.             { 63519819, 504700102 },
  164.             { 63689843, 504700103 },
  165.             { 63995093, 504700104 },
  166.             { 64389297, 504700105 },
  167.             { 64500000, 511002853 },
  168.             { 64631466, 504700106 },
  169.             { 65240384, 65240394 },
  170.             { 65260293, 504700107 },
  171.             { 65458948, 504700108 },
  172.             { 65622692, 511002852 },
  173.             { 65878864, 504700109 },
  174.             { 68057622, 504700110 },
  175.             { 68540058, 504700111 },
  176.             { 68540059, 504700111 },
  177.             { 69122763, 504700112 },
  178.             { 69542930, 504700113 },
  179.             { 70046172, 504700114 },
  180.             { 70861343, 504700115 },
  181.             { 71044499, 504700116 },
  182.             { 71829750, 504700117 },
  183.             { 72989439, 504700118 },
  184.             { 73398797, 504700119 },
  185.             { 73431236, 504700120 },
  186.             { 73628505, 504700121 },
  187.             { 73752131, 504700122 },
  188.             { 73915051, 504700123 },
  189.             { 74137509, 504700124 },
  190.             { 74153887, 504700125 },
  191.             { 74388798, 504700126 },
  192.             { 74458486, 504700127 },
  193.             { 74591968, 504700128 },
  194.             { 74713516, 504700129 },
  195.             { 75043725, 511003027 },
  196.             { 75417459, 504700130 },
  197.             { 75745607, 504700131 },
  198.             { 75830094, 504700132 },
  199.             { 76754619, 504700134 },
  200.             { 77044671, 504700135 },
  201.             { 78010363, 504700144 },
  202.             { 78636495, 504700136 },
  203.             { 79109599, 504700137 },
  204.             { 79575620, 504700138 },
  205.             { 79853073, 504700139 },
  206.             { 80168720, 511003028 },
  207.             { 81210420, 504700140 },
  208.             { 82003859, 504700141 },
  209.             { 82301904, 511000819 },
  210.             { 83011277, 504700142 },
  211.             { 83011278, 504700142 },
  212.             { 83555666, 511000824 },
  213.             { 83555667, 511000824 },
  214.             { 83986578, 504700143 },
  215.             { 84834865, 504700145 },
  216.             { 85489096, 504700146 },
  217.             { 85602018, 504700147 },
  218.             { 86327225, 504700148 },
  219.             { 87210505, 504700149 },
  220.             { 87340664, 504700150 },
  221.             { 87473172, 504700151 },
  222.             { 87910978, 511002995 },
  223.             { 88472456, 504700152 },
  224.             { 88789641, 504700153 },
  225.             { 88989706, 504700154 },
  226.             { 89801755, 504700155 },
  227.             { 89997728, 504700156 },
  228.             { 90219263, 504700157 },
  229.             { 90846359, 504700158 },
  230.             { 90980792, 504700159 },
  231.             { 91842653, 504700160 },
  232.             { 91998119, 504700161 },
  233.             { 91998120, 504700161 },
  234.             { 91998121, 504700161 },
  235.             { 93107608, 504700162 },
  236.             { 93920745, 504700163 },
  237.             { 94568601, 504700164 },
  238.             { 94585852, 504700165 },
  239.             { 95132338, 504700166 },
  240.             { 95178994, 504700167 },
  241.             { 95214051, 504700168 },
  242.             { 95492061, 504700169 },
  243.             { 95727991, 511000228 },
  244.             { 95956346, 504700170 },
  245.             { 96316857, 511002983 },
  246.             { 96965364, 504700171 },
  247.             { 97017120, 504700172 },
  248.             { 98239899, 504700173 },
  249.             { 98434877, 504700174 },
  250.             { 98446407, 504700175 },
  251.             { 99414168, 504700181 },
  252.             { 99597615, 504700176 },
  253.             { 99724761, 504700177 }
  254.         };
  255.         private const int IDYES = 6;
  256.         private const uint MB_OK = 0x00000000;
  257.         private const uint MB_YESNO = 0x00000004;
  258.         private const uint MB_ICONASTERISK = 0x00000040;
  259.         private const uint MB_ICONQUESTION = 0x00000020;
  260.  
  261.         [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
  262.         private static extern int MessageBox(int hWnd, String text, String caption, uint type);
  263.     }
  264. }
  265.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement