RikuSS4

openbee

Jun 10th, 2015
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 86.55 KB | None | 0 0
  1. local version = {
  2.   ["major"] = 2,
  3.   ["minor"] = 2,
  4.   ["patch"] = 1
  5. }
  6.  
  7. function loadFile(fileName)
  8.   local f = fs.open(fileName, "r")
  9.   if f ~= nil then
  10.     local data = f.readAll()
  11.     f.close()
  12.     return textutils.unserialize(data)
  13.   end
  14. end
  15.  
  16. function saveFile(fileName, data)
  17.   local f = fs.open(fileName, "w")
  18.   f.write(textutils.serialize(data))
  19.   f.close()
  20. end
  21.  
  22. local useAnalyzer = true
  23. local useReferenceBees = false
  24. local createLog = false
  25. local config = loadFile("bee.config")
  26.  
  27. if config == nil then
  28.   config = {
  29.     ["createLog"] = "false",
  30.     ["apiarySide"] = "left",
  31.     ["chestSide"] = "top",
  32.     ["chestDir"] = "up",
  33.     ["productDir"] = "down",
  34.     ["analyzerDir"] = "east",
  35.     ["ignoreSpecies"] = {
  36.       "Leporine"
  37.     }
  38.   }
  39.   saveFile("bee.config", config)
  40. end
  41.  
  42.  
  43. local traitPriority = {
  44.   "speciesChance",
  45.   "nocturnal",
  46.   "speed",
  47.   "fertility",
  48.   "tolerantFlyer",
  49.   "caveDwelling",
  50.   "temperatureTolerance",
  51.   "humidityTolerance",
  52.   "effect",
  53.   "flowering",
  54.   "flowerProvider",
  55.   "territory"
  56. }
  57.  
  58. function setPriorities(priority)
  59.   local species = nil
  60.   local priorityNum = 1
  61.   for traitNum, trait in ipairs(priority) do
  62.     local found = false
  63.     for traitPriorityNum = 1, #traitPriority do
  64.       if trait == traitPriority[traitPriorityNum] then
  65.         found = true
  66.         if priorityNum ~= traitPriorityNum then
  67.           table.remove(traitPriority, traitPriorityNum)
  68.           table.insert(traitPriority, priorityNum, trait)
  69.         end
  70.         priorityNum = priorityNum + 1
  71.         break
  72.       end
  73.     end
  74.     if not found then
  75.       species = trait
  76.     end
  77.   end
  78.   return species
  79. end
  80.  
  81. -- logging ----------------------------
  82.  
  83. local logFile
  84. function setupLog()
  85.   local logCount = 0
  86.   if createLog then
  87.         while fs.exists(string.format("bee.%d.log", logCount)) do
  88.             logCount = logCount + 1
  89.         end
  90.         logFile = fs.open(string.format("bee.%d.log", logCount), "w")
  91.     end
  92.   return string.format("bee.%d.log", logCount)
  93. end
  94.  
  95. function log(msg)
  96.   msg = msg or ""
  97.   if createLog then
  98.         logFile.write(tostring(msg))
  99.         logFile.flush()
  100.     end
  101.     io.write(msg)
  102. end
  103.  
  104. function logLine(...)
  105.   for i, msg in ipairs(arg) do
  106.     if msg == nil then
  107.       msg = ""
  108.     end
  109.         if createLog then
  110.             logFile.write(msg)
  111.         end
  112.     io.write(msg)
  113.   end
  114.   if createLog then
  115.         logFile.write("\n")
  116.         logFile.flush()
  117.     end
  118.   io.write("\n")
  119. end
  120.  
  121. function getPeripherals()
  122.   local names = table.concat(peripheral.getNames(), ", ")
  123.   local chestPeripheral = peripheral.wrap(config.chestSide)
  124.   if chestPeripheral == nil then
  125.     error("Bee chest not found at " .. config.chestSide .. ".  Valid config values are " .. names .. ".")
  126.   end
  127.   local apiaryPeripheral = peripheral.wrap(config.apiarySide)
  128.   if apiaryPeripheral == nil then
  129.     error("Apiary not found at " .. config.apiarySide .. ".  Valid config values are " .. names .. ".")
  130.   end
  131.   -- check config directions
  132.   if not pcall(function () chestPeripheral.pullItem(config.analyzerDir, 9) end) then
  133.     logLine("Analyzer direction incorrect.  Direction should be relative to bee chest.")
  134.     useAnalyzer = false
  135.   end
  136.   return chestPeripheral, apiaryPeripheral
  137. end
  138.  
  139. -- utility functions ------------------
  140.  
  141. function choose(list1, list2)
  142.   local newList = {}
  143.   if list2 then
  144.     for i = 1, #list2 do
  145.       for j = 1, #list1 do
  146.         if list1[j] ~= list2[i] then
  147.           table.insert(newList, {list1[j], list2[i]})
  148.         end
  149.       end
  150.     end
  151.   else
  152.     for i = 1, #list1 do
  153.       for j = i, #list1 do
  154.         if list1[i] ~= list1[j] then
  155.           table.insert(newList, {list1[i], list1[j]})
  156.         end
  157.       end
  158.     end
  159.   end
  160.   return newList
  161. end
  162.  
  163. -- fix for yet another API change from openp
  164. function getAllBees(inv)
  165.   local notbees = inv.getAllStacks()
  166.   local bees = {}
  167.   for slot, bee in pairs(notbees) do
  168.     bees[slot] = bee.all()
  169.   end
  170.   return bees
  171. end
  172.  
  173. function getBeeInSlot(inv, slot)
  174.   return inv.getStackInSlot(slot)
  175. end
  176.  
  177. -- fix for some versions returning bees.species.*
  178. local nameFix = {}
  179. function fixName(name)
  180.   if type(name) == "table" then
  181.     name = name.name
  182.   end
  183.   local newName = name:gsub("bees%.species%.",""):gsub("^.", string.upper)
  184.   if name ~= newName then
  185.     nameFix[newName] = name
  186.   end
  187.   return newName
  188. end
  189.  
  190. function fixBee(bee)
  191.   if bee.individual ~= nil then
  192.     bee.individual.displayName = fixName(bee.individual.displayName)
  193.     if bee.individual.isAnalyzed then
  194.       bee.individual.active.species.name = fixName(bee.individual.active.species.name)
  195.       bee.individual.inactive.species.name = fixName(bee.individual.inactive.species.name)
  196.     end
  197.   end
  198.   return bee
  199. end
  200.  
  201. function fixParents(parents)
  202.   parents.allele1 = fixName(parents.allele1)
  203.   parents.allele2 = fixName(parents.allele2)
  204.   if parents.result then
  205.     parents.result = fixName(parents.result)
  206.   end
  207.   return parents
  208. end
  209.  
  210. function beeName(bee)
  211.   if bee.individual.active then
  212.     return bee.slot .. "=" .. bee.individual.active.species.name:sub(1,3) .. "-" ..
  213.                               bee.individual.inactive.species.name:sub(1,3)
  214.   else
  215.     return bee.slot .. "=" .. bee.individual.displayName:sub(1,3)
  216.   end
  217. end
  218.  
  219. function printBee(bee)
  220.   if bee.individual.isAnalyzed then
  221.     local active = bee.individual.active
  222.     local inactive = bee.individual.inactive
  223.     if active.species.name ~= inactive.species.name then
  224.       log(string.format("%s-%s", active.species.name, inactive.species.name))
  225.     else
  226.       log(active.species.name)
  227.     end
  228.     if bee.raw_name == "item.for.beedronege" then
  229.       log(" Drone")
  230.     elseif bee.raw_name == "item.for.beeprincessge" then
  231.       log(" Princess")
  232.     else
  233.       log(" Queen")
  234.     end
  235.     log((active.nocturnal and " Nocturnal" or " "))
  236.     log((active.tolerantFlyer and " Flyer" or " "))
  237.     log((active.caveDwelling and " Cave" or " "))
  238.     logLine()
  239.     logLine(string.format("Fert: %d  Speed: %d  Lifespan: %d", active.fertility, active.speed, active.lifespan))
  240.   else
  241.   end
  242. end
  243.  
  244. -- mutations and scoring --------------
  245.  
  246. function getBeeBreedingData()
  247.   breedingTable = {}
  248.   breedingTable[1] = {
  249.     ['allele1'] = "Forest",
  250.     ['specialConditions'] = {},
  251.     ['allele2'] = "Meadows",
  252.     ['result'] = "Common",
  253.     ['chance'] = 15
  254.   }
  255.   breedingTable[2] = {
  256.     ['allele1'] = "Modest",
  257.     ['specialConditions'] = {},
  258.     ['allele2'] = "Forest",
  259.     ['result'] = "Common",
  260.     ['chance'] = 15
  261.   }
  262.   breedingTable[3] = {
  263.     ['allele1'] = "Modest",
  264.     ['specialConditions'] = {},
  265.     ['allele2'] = "Meadows",
  266.     ['result'] = "Common",
  267.     ['chance'] = 15
  268.   }
  269.   breedingTable[4] = {
  270.     ['allele1'] = "Wintry",
  271.     ['specialConditions'] = {},
  272.     ['allele2'] = "Forest",
  273.     ['result'] = "Common",
  274.     ['chance'] = 15
  275.   }
  276.   breedingTable[5] = {
  277.     ['allele1'] = "Wintry",
  278.     ['specialConditions'] = {},
  279.     ['allele2'] = "Meadows",
  280.     ['result'] = "Common",
  281.     ['chance'] = 15
  282.   }
  283.   breedingTable[6] = {
  284.     ['allele1'] = "Wintry",
  285.     ['specialConditions'] = {},
  286.     ['allele2'] = "Modest",
  287.     ['result'] = "Common",
  288.     ['chance'] = 15
  289.   }
  290.   breedingTable[7] = {
  291.     ['allele1'] = "Tropical",
  292.     ['specialConditions'] = {},
  293.     ['allele2'] = "Forest",
  294.     ['result'] = "Common",
  295.     ['chance'] = 15
  296.   }
  297.   breedingTable[8] = {
  298.     ['allele1'] = "Tropical",
  299.     ['specialConditions'] = {},
  300.     ['allele2'] = "Meadows",
  301.     ['result'] = "Common",
  302.     ['chance'] = 15
  303.   }
  304.   breedingTable[9] = {
  305.     ['allele1'] = "Tropical",
  306.     ['specialConditions'] = {},
  307.     ['allele2'] = "Modest",
  308.     ['result'] = "Common",
  309.     ['chance'] = 15
  310.   }
  311.   breedingTable[10] = {
  312.     ['allele1'] = "Tropical",
  313.     ['specialConditions'] = {},
  314.     ['allele2'] = "Wintry",
  315.     ['result'] = "Common",
  316.     ['chance'] = 15
  317.    }
  318.   breedingTable[11] = {
  319.     ['allele1'] = "Marshy",
  320.     ['specialConditions'] = {},
  321.     ['allele2'] = "Forest",
  322.     ['result'] = "Common",
  323.     ['chance'] = 15
  324.    }
  325.   breedingTable[12] = {
  326.     ['allele1'] = "Marshy",
  327.     ['specialConditions'] = {},
  328.     ['allele2'] = "Meadows",
  329.     ['result'] = "Common",
  330.     ['chance'] = 15
  331.    }
  332.   breedingTable[13] = {
  333.     ['allele1'] = "Marshy",
  334.     ['specialConditions'] = {},
  335.     ['allele2'] = "Modest",
  336.     ['result'] = "Common",
  337.     ['chance'] = 15
  338.    }
  339.   breedingTable[14] = {
  340.     ['allele1'] = "Marshy",
  341.     ['specialConditions'] = {},
  342.     ['allele2'] = "Wintry",
  343.     ['result'] = "Common",
  344.     ['chance'] = 15
  345.    }
  346.   breedingTable[15] = {
  347.     ['allele1'] = "Marshy",
  348.     ['specialConditions'] = {},
  349.     ['allele2'] = "Tropical",
  350.     ['result'] = "Common",
  351.     ['chance'] = 15
  352.    }
  353.   breedingTable[16] = {
  354.     ['allele1'] = "Common",
  355.     ['specialConditions'] = {},
  356.     ['allele2'] = "Forest",
  357.     ['result'] = "Cultivated",
  358.     ['chance'] = 12
  359.    }
  360.   breedingTable[17] = {
  361.     ['allele1'] = "Common",
  362.     ['specialConditions'] = {},
  363.     ['allele2'] = "Meadows",
  364.     ['result'] = "Cultivated",
  365.     ['chance'] = 12
  366.    }
  367.   breedingTable[18] = {
  368.     ['allele1'] = "Common",
  369.     ['specialConditions'] = {},
  370.     ['allele2'] = "Modest",
  371.     ['result'] = "Cultivated",
  372.     ['chance'] = 12
  373.    }
  374.   breedingTable[19] = {
  375.     ['allele1'] = "Common",
  376.     ['specialConditions'] = {},
  377.     ['allele2'] = "Wintry",
  378.     ['result'] = "Cultivated",
  379.     ['chance'] = 12
  380.    }
  381.   breedingTable[20] = {
  382.     ['allele1'] = "Common",
  383.     ['specialConditions'] = {},
  384.     ['allele2'] = "Tropical",
  385.     ['result'] = "Cultivated",
  386.     ['chance'] = 12
  387.    }
  388.   breedingTable[21] = {
  389.     ['allele1'] = "Common",
  390.     ['specialConditions'] = {},
  391.     ['allele2'] = "Marshy",
  392.     ['result'] = "Cultivated",
  393.     ['chance'] = 12
  394.    }
  395.   breedingTable[22] = {
  396.     ['allele1'] = "Common",
  397.     ['specialConditions'] = {},
  398.     ['allele2'] = "Cultivated",
  399.     ['result'] = "Noble",
  400.     ['chance'] = 10
  401.    }
  402.   breedingTable[23] = {
  403.     ['allele1'] = "Noble",
  404.     ['specialConditions'] = {},
  405.     ['allele2'] = "Cultivated",
  406.     ['result'] = "Majestic",
  407.     ['chance'] = 8
  408.    }
  409.   breedingTable[24] = {
  410.     ['allele1'] = "Noble",
  411.     ['specialConditions'] = {},
  412.     ['allele2'] = "Majestic",
  413.     ['result'] = "Imperial",
  414.     ['chance'] = 8
  415.    }
  416.   breedingTable[25] = {
  417.     ['allele1'] = "Common",
  418.     ['specialConditions'] = {},
  419.     ['allele2'] = "Cultivated",
  420.     ['result'] = "Diligent",
  421.     ['chance'] = 10
  422.    }
  423.   breedingTable[26] = {
  424.     ['allele1'] = "Diligent",
  425.     ['specialConditions'] = {},
  426.     ['allele2'] = "Cultivated",
  427.     ['result'] = "Unweary",
  428.     ['chance'] = 8
  429.    }
  430.   breedingTable[27] = {
  431.     ['allele1'] = "Diligent",
  432.     ['specialConditions'] = {},
  433.     ['allele2'] = "Unweary",
  434.     ['result'] = "Industrious",
  435.     ['chance'] = 8
  436.    }
  437.   breedingTable[28] = {
  438.     ['allele1'] = "Steadfast",
  439.     ['specialConditions'] = {[1] = "Is restricted to FOREST-like environments."},
  440.     ['allele2'] = "Valiant",
  441.     ['result'] = "Heroic",
  442.     ['chance'] = 6
  443.    }
  444.   breedingTable[29] = {
  445.     ['allele1'] = "Modest",
  446.     ['specialConditions'] = {[1] = "Is restricted to NETHER-like environments."},
  447.     ['allele2'] = "Cultivated",
  448.     ['result'] = "Sinister",
  449.     ['chance'] = 60
  450.    }
  451.   breedingTable[30] = {
  452.     ['allele1'] = "Tropical",
  453.     ['specialConditions'] = {},
  454.     ['allele2'] = "Cultivated",
  455.     ['result'] = "Sinister",
  456.     ['chance'] = 60
  457.    }
  458.   breedingTable[31] = {
  459.     ['allele1'] = "Sinister",
  460.     ['specialConditions'] = {},
  461.     ['allele2'] = "Cultivated",
  462.     ['result'] = "Fiendish",
  463.     ['chance'] = 40
  464.    }
  465.   breedingTable[32] = {
  466.     ['allele1'] = "Sinister",
  467.     ['specialConditions'] = {},
  468.     ['allele2'] = "Modest",
  469.     ['result'] = "Fiendish",
  470.     ['chance'] = 40
  471.    }
  472.   breedingTable[33] = {
  473.     ['allele1'] = "Sinister",
  474.     ['specialConditions'] = {},
  475.     ['allele2'] = "Tropical",
  476.     ['result'] = "Fiendish",
  477.     ['chance'] = 40
  478.    }
  479.   breedingTable[34] = {
  480.     ['allele1'] = "Sinister",
  481.     ['specialConditions'] = {},
  482.     ['allele2'] = "Fiendish",
  483.     ['result'] = "Demonic",
  484.     ['chance'] = 25
  485.    }
  486.   breedingTable[35] = {
  487.     ['allele1'] = "Modest",
  488.     ['specialConditions'] = {
  489.       [1] = "Temperature between WARM and HOT.",
  490.       [2] = "Humidity ARID required.",
  491.       },
  492.     ['allele2'] = "Sinister",
  493.     ['result'] = "Frugal",
  494.     ['chance'] = 16
  495.    }
  496.   breedingTable[36] = {
  497.     ['allele1'] = "Modest",
  498.     ['specialConditions'] = {},
  499.     ['allele2'] = "Fiendish",
  500.     ['result'] = "Frugal",
  501.     ['chance'] = 10
  502.    }
  503.   breedingTable[37] = {
  504.     ['allele1'] = "Modest",
  505.     ['specialConditions'] = {},
  506.     ['allele2'] = "Frugal",
  507.     ['result'] = "Austere",
  508.     ['chance'] = 8
  509.    }
  510.   breedingTable[38] = {
  511.     ['allele1'] = "Austere",
  512.     ['specialConditions'] = {},
  513.     ['allele2'] = "Tropical",
  514.     ['result'] = "Exotic",
  515.     ['chance'] = 12
  516.    }
  517.   breedingTable[39] = {
  518.     ['allele1'] = "Exotic",
  519.     ['specialConditions'] = {},
  520.     ['allele2'] = "Tropical",
  521.     ['result'] = "Edenic",
  522.     ['chance'] = 8
  523.    }
  524.   breedingTable[40] = {
  525.     ['allele1'] = "Industrious",
  526.     ['specialConditions'] = {[1] = "Temperature between ICY and COLD."},
  527.     ['allele2'] = "Wintry",
  528.     ['result'] = "Icy",
  529.     ['chance'] = 12
  530.    }
  531.   breedingTable[41] = {
  532.     ['allele1'] = "Icy",
  533.     ['specialConditions'] = {},
  534.     ['allele2'] = "Wintry",
  535.     ['result'] = "Glacial",
  536.     ['chance'] = 8
  537.    }
  538.   breedingTable[42] = {
  539.     ['allele1'] = "Meadows",
  540.     ['specialConditions'] = {},
  541.     ['allele2'] = "Forest",
  542.     ['result'] = "Leporine",
  543.     ['chance'] = 10
  544.    }
  545.   breedingTable[43] = {
  546.     ['allele1'] = "Wintry",
  547.     ['specialConditions'] = {},
  548.     ['allele2'] = "Forest",
  549.     ['result'] = "Merry",
  550.     ['chance'] = 10
  551.    }
  552.   breedingTable[44] = {
  553.     ['allele1'] = "Wintry",
  554.     ['specialConditions'] = {},
  555.     ['allele2'] = "Meadows",
  556.     ['result'] = "Tipsy",
  557.     ['chance'] = 10
  558.    }
  559.   breedingTable[45] = {
  560.     ['allele1'] = "Sinister",
  561.     ['specialConditions'] = {},
  562.     ['allele2'] = "Common",
  563.     ['result'] = "Tricky",
  564.     ['chance'] = 10
  565.    }
  566.   breedingTable[46] = {
  567.     ['allele1'] = "Meadows",
  568.     ['specialConditions'] = {[1] = "Is restricted to PLAINS-like environments."},
  569.     ['allele2'] = "Diligent",
  570.     ['result'] = "Rural",
  571.     ['chance'] = 12
  572.    }
  573.   breedingTable[47] = {
  574.     ['allele1'] = "Monastic",
  575.     ['specialConditions'] = {},
  576.     ['allele2'] = "Austere",
  577.     ['result'] = "Secluded",
  578.     ['chance'] = 12
  579.    }
  580.   breedingTable[48] = {
  581.     ['allele1'] = "Monastic",
  582.     ['specialConditions'] = {},
  583.     ['allele2'] = "Secluded",
  584.     ['result'] = "Hermitic",
  585.     ['chance'] = 8
  586.    }
  587.   breedingTable[49] = {
  588.     ['allele1'] = "Hermitic",
  589.     ['specialConditions'] = {},
  590.     ['allele2'] = "Ender",
  591.     ['result'] = "Spectral",
  592.     ['chance'] = 4
  593.    }
  594.   breedingTable[50] = {
  595.     ['allele1'] = "Spectral",
  596.     ['specialConditions'] = {},
  597.     ['allele2'] = "Ender",
  598.     ['result'] = "Phantasmal",
  599.     ['chance'] = 2
  600.    }
  601.   breedingTable[51] = {
  602.     ['allele1'] = "Monastic",
  603.     ['specialConditions'] = {},
  604.     ['allele2'] = "Demonic",
  605.     ['result'] = "Vindictive",
  606.     ['chance'] = 4
  607.    }
  608.   breedingTable[52] = {
  609.     ['allele1'] = "Demonic",
  610.     ['specialConditions'] = {},
  611.     ['allele2'] = "Vindictive",
  612.     ['result'] = "Vengeful",
  613.     ['chance'] = 8
  614.    }
  615.   breedingTable[53] = {
  616.     ['allele1'] = "Monastic",
  617.     ['specialConditions'] = {},
  618.     ['allele2'] = "Vindictive",
  619.     ['result'] = "Vengeful",
  620.     ['chance'] = 8
  621.    }
  622.   breedingTable[54] = {
  623.     ['allele1'] = "Vengeful",
  624.     ['specialConditions'] = {},
  625.     ['allele2'] = "Vindictive",
  626.     ['result'] = "Avenging",
  627.     ['chance'] = 4
  628.    }
  629.   breedingTable[55] = {
  630.     ['allele1'] = "Meadows",
  631.     ['specialConditions'] = {},
  632.     ['allele2'] = "Modest",
  633.     ['result'] = "Arid",
  634.     ['chance'] = 10
  635.    }
  636.   breedingTable[56] = {
  637.     ['allele1'] = "Arid",
  638.     ['specialConditions'] = {},
  639.     ['allele2'] = "Common",
  640.     ['result'] = "Barren",
  641.     ['chance'] = 8
  642.    }
  643.   breedingTable[57] = {
  644.     ['allele1'] = "Arid",
  645.     ['specialConditions'] = {},
  646.     ['allele2'] = "Barren",
  647.     ['result'] = "Desolate",
  648.     ['chance'] = 8
  649.    }
  650.   breedingTable[58] = {
  651.     ['allele1'] = "Barren",
  652.     ['specialConditions'] = {},
  653.     ['allele2'] = "Forest",
  654.     ['result'] = "Gnawing",
  655.     ['chance'] = 15
  656.    }
  657.   breedingTable[59] = {
  658.     ['allele1'] = "Desolate",
  659.     ['specialConditions'] = {},
  660.     ['allele2'] = "Modest",
  661.     ['result'] = "Decaying",
  662.     ['chance'] = 15
  663.    }
  664.   breedingTable[60] = {
  665.     ['allele1'] = "Desolate",
  666.     ['specialConditions'] = {},
  667.     ['allele2'] = "Frugal",
  668.     ['result'] = "Skeletal",
  669.     ['chance'] = 15
  670.    }
  671.   breedingTable[61] = {
  672.     ['allele1'] = "Desolate",
  673.     ['specialConditions'] = {},
  674.     ['allele2'] = "Austere",
  675.     ['result'] = "Creepy",
  676.     ['chance'] = 15
  677.    }
  678.   breedingTable[62] = {
  679.     ['allele1'] = "Gnawing",
  680.     ['specialConditions'] = {},
  681.     ['allele2'] = "Common",
  682.     ['result'] = "Decomposing",
  683.     ['chance'] = 15
  684.    }
  685.   breedingTable[63] = {
  686.     ['allele1'] = "Rocky",
  687.     ['specialConditions'] = {},
  688.     ['allele2'] = "Diligent",
  689.     ['result'] = "Tolerant",
  690.     ['chance'] = 15
  691.    }
  692.   breedingTable[64] = {
  693.     ['allele1'] = "Rocky",
  694.     ['specialConditions'] = {},
  695.     ['allele2'] = "Tolerant",
  696.     ['result'] = "Robust",
  697.     ['chance'] = 15
  698.    }
  699.   breedingTable[65] = {
  700.     ['allele1'] = "Imperial",
  701.     ['specialConditions'] = {},
  702.     ['allele2'] = "Robust",
  703.     ['result'] = "Resilient",
  704.     ['chance'] = 15
  705.    }
  706.   breedingTable[66] = {
  707.     ['allele1'] = "Resilient",
  708.     ['specialConditions'] = {},
  709.     ['allele2'] = "Meadows",
  710.     ['result'] = "Rusty",
  711.     ['chance'] = 5
  712.    }
  713.   breedingTable[67] = {
  714.     ['allele1'] = "Resilient",
  715.     ['specialConditions'] = {},
  716.     ['allele2'] = "Forest",
  717.     ['result'] = "Corroded",
  718.     ['chance'] = 5
  719.    }
  720.   breedingTable[68] = {
  721.     ['allele1'] = "Resilient",
  722.     ['specialConditions'] = {},
  723.     ['allele2'] = "Marshy",
  724.     ['result'] = "Tarnished",
  725.     ['chance'] = 5
  726.    }
  727.   breedingTable[69] = {
  728.     ['allele1'] = "Resilient",
  729.     ['specialConditions'] = {},
  730.     ['allele2'] = "Unweary",
  731.     ['result'] = "Leaden",
  732.     ['chance'] = 5
  733.    }
  734.   breedingTable[70] = {
  735.     ['allele1'] = "Resilient",
  736.     ['specialConditions'] = {},
  737.     ['allele2'] = "Unweary",
  738.     ['result'] = "Lustered",
  739.     ['chance'] = 10
  740.    }
  741.   breedingTable[71] = {
  742.     ['allele1'] = "Rusty",
  743.     ['specialConditions'] = {},
  744.     ['allele2'] = "Imperial",
  745.     ['result'] = "Shining",
  746.     ['chance'] = 2
  747.    }
  748.   breedingTable[72] = {
  749.     ['allele1'] = "Corroded",
  750.     ['specialConditions'] = {},
  751.     ['allele2'] = "Imperial",
  752.     ['result'] = "Glittering",
  753.     ['chance'] = 2
  754.    }
  755.   breedingTable[73] = {
  756.     ['allele1'] = "Glittering",
  757.     ['specialConditions'] = {},
  758.     ['allele2'] = "Shining",
  759.     ['result'] = "Valuable",
  760.     ['chance'] = 2
  761.    }
  762.   breedingTable[74] = {
  763.     ['allele1'] = "Resilient",
  764.     ['specialConditions'] = {},
  765.     ['allele2'] = "Water",
  766.     ['result'] = "Lapis",
  767.     ['chance'] = 5
  768.    }
  769.   breedingTable[75] = {
  770.     ['allele1'] = "Lapis",
  771.     ['specialConditions'] = {},
  772.     ['allele2'] = "Noble",
  773.     ['result'] = "Emerald",
  774.     ['chance'] = 5
  775.    }
  776.   breedingTable[76] = {
  777.     ['allele1'] = "Emerald",
  778.     ['specialConditions'] = {},
  779.     ['allele2'] = "Austere",
  780.     ['result'] = "Ruby",
  781.     ['chance'] = 5
  782.    }
  783.   breedingTable[77] = {
  784.     ['allele1'] = "Emerald",
  785.     ['specialConditions'] = {},
  786.     ['allele2'] = "Ocean",
  787.     ['result'] = "Sapphire",
  788.     ['chance'] = 5
  789.    }
  790.   breedingTable[78] = {
  791.     ['allele1'] = "Lapis",
  792.     ['specialConditions'] = {},
  793.     ['allele2'] = "Imperial",
  794.     ['result'] = "Diamond",
  795.     ['chance'] = 5
  796.    }
  797.   breedingTable[79] = {
  798.     ['allele1'] = "Austere",
  799.     ['specialConditions'] = {},
  800.     ['allele2'] = "Rocky",
  801.     ['result'] = "Unstable",
  802.     ['chance'] = 5
  803.    }
  804.   breedingTable[80] = {
  805.     ['allele1'] = "Unstable",
  806.     ['specialConditions'] = {},
  807.     ['allele2'] = "Rusty",
  808.     ['result'] = "Nuclear",
  809.     ['chance'] = 5
  810.    }
  811.   breedingTable[81] = {
  812.     ['allele1'] = "Nuclear",
  813.     ['specialConditions'] = {},
  814.     ['allele2'] = "Glittering",
  815.     ['result'] = "Radioactive",
  816.     ['chance'] = 5
  817.    }
  818.   breedingTable[82] = {
  819.     ['allele1'] = "Noble",
  820.     ['specialConditions'] = {},
  821.     ['allele2'] = "Diligent",
  822.     ['result'] = "Ancient",
  823.     ['chance'] = 10
  824.    }
  825.   breedingTable[83] = {
  826.     ['allele1'] = "Ancient",
  827.     ['specialConditions'] = {},
  828.     ['allele2'] = "Noble",
  829.     ['result'] = "Primeval",
  830.     ['chance'] = 8
  831.    }
  832.   breedingTable[84] = {
  833.     ['allele1'] = "Primeval",
  834.     ['specialConditions'] = {},
  835.     ['allele2'] = "Majestic",
  836.     ['result'] = "Prehistoric",
  837.     ['chance'] = 8
  838.    }
  839.   breedingTable[85] = {
  840.     ['allele1'] = "Prehistoric",
  841.     ['specialConditions'] = {},
  842.     ['allele2'] = "Imperial",
  843.     ['result'] = "Relic",
  844.     ['chance'] = 8
  845.    }
  846.   breedingTable[86] = {
  847.     ['allele1'] = "Primeval",
  848.     ['specialConditions'] = {},
  849.     ['allele2'] = "Growing",
  850.     ['result'] = "Fossilised",
  851.     ['chance'] = 8
  852.    }
  853.   breedingTable[87] = {
  854.     ['allele1'] = "Primeval",
  855.     ['specialConditions'] = {},
  856.     ['allele2'] = "Fungal",
  857.     ['result'] = "Resinous",
  858.     ['chance'] = 8
  859.    }
  860.   breedingTable[88] = {
  861.     ['allele1'] = "Primeval",
  862.     ['specialConditions'] = {},
  863.     ['allele2'] = "Ocean",
  864.     ['result'] = "Oily",
  865.     ['chance'] = 8
  866.    }
  867.   breedingTable[89] = {
  868.     ['allele1'] = "Primeval",
  869.     ['specialConditions'] = {},
  870.     ['allele2'] = "Boggy",
  871.     ['result'] = "Preserved",
  872.     ['chance'] = 8
  873.    }
  874.   breedingTable[90] = {
  875.     ['allele1'] = "Oily",
  876.     ['specialConditions'] = {},
  877.     ['allele2'] = "Industrious",
  878.     ['result'] = "Distilled",
  879.     ['chance'] = 8
  880.    }
  881.   breedingTable[91] = {
  882.     ['allele1'] = "Oily",
  883.     ['specialConditions'] = {},
  884.     ['allele2'] = "Distilled",
  885.     ['result'] = "Refined",
  886.     ['chance'] = 8
  887.    }
  888.   breedingTable[92] = {
  889.     ['allele1'] = "Refined",
  890.     ['specialConditions'] = {},
  891.     ['allele2'] = "Fossilised",
  892.     ['result'] = "Tarry",
  893.     ['chance'] = 8
  894.    }
  895.   breedingTable[93] = {
  896.     ['allele1'] = "Refined",
  897.     ['specialConditions'] = {},
  898.     ['allele2'] = "Resinous",
  899.     ['result'] = "Elastic",
  900.     ['chance'] = 8
  901.    }
  902.   breedingTable[94] = {
  903.     ['allele1'] = "Water",
  904.     ['specialConditions'] = {},
  905.     ['allele2'] = "Common",
  906.     ['result'] = "River",
  907.     ['chance'] = 10
  908.    }
  909.   breedingTable[95] = {
  910.     ['allele1'] = "Water",
  911.     ['specialConditions'] = {
  912. [1] = "Hive needs to be in Ocean",
  913.                             },
  914.     ['allele2'] = "Diligent",
  915.     ['result'] = "Ocean",
  916.     ['chance'] = 10
  917.    }
  918.   breedingTable[96] = {
  919.     ['allele1'] = "Ebony",
  920.     ['specialConditions'] = {},
  921.     ['allele2'] = "Ocean",
  922.     ['result'] = "Stained",
  923.     ['chance'] = 8
  924.    }
  925.   breedingTable[97] = {
  926.     ['allele1'] = "Diligent",
  927.     ['specialConditions'] = {},
  928.     ['allele2'] = "Forest",
  929.     ['result'] = "Growing",
  930.     ['chance'] = 10
  931.    }
  932.   breedingTable[98] = {
  933.     ['allele1'] = "Growing",
  934.     ['specialConditions'] = {},
  935.     ['allele2'] = "Rural",
  936.     ['result'] = "Thriving",
  937.     ['chance'] = 10
  938.    }
  939.   breedingTable[99] = {
  940.     ['allele1'] = "Thriving",
  941.     ['specialConditions'] = {},
  942.     ['allele2'] = "Growing",
  943.     ['result'] = "Blooming",
  944.     ['chance'] = 8
  945.    }
  946.   breedingTable[100] = {
  947.      ['allele1'] = "Valiant",
  948.      ['specialConditions'] = {},
  949.      ['allele2'] = "Diligent",
  950.      ['result'] = "Sweetened",
  951.      ['chance'] = 15
  952.     }
  953.   breedingTable[101] = {
  954.      ['allele1'] = "Sweetened",
  955.      ['specialConditions'] = {},
  956.      ['allele2'] = "Diligent",
  957.      ['result'] = "Sugary",
  958.      ['chance'] = 15
  959.     }
  960.   breedingTable[102] = {
  961.      ['allele1'] = "Sugary",
  962.      ['specialConditions'] = {},
  963.      ['allele2'] = "Forest",
  964.      ['result'] = "Ripening",
  965.      ['chance'] = 5
  966.     }
  967.   breedingTable[103] = {
  968.      ['allele1'] = "Ripening",
  969.      ['specialConditions'] = {},
  970.      ['allele2'] = "Rural",
  971.      ['result'] = "Fruity",
  972.      ['chance'] = 5
  973.     }
  974.   breedingTable[104] = {
  975.      ['allele1'] = "Cultivated",
  976.      ['specialConditions'] = {},
  977.      ['allele2'] = "Rural",
  978.      ['result'] = "Farmed",
  979.      ['chance'] = 10
  980.     }
  981.   breedingTable[105] = {
  982.      ['allele1'] = "Rural",
  983.      ['specialConditions'] = {},
  984.      ['allele2'] = "Water",
  985.      ['result'] = "Bovine",
  986.      ['chance'] = 10
  987.     }
  988.   breedingTable[106] = {
  989.      ['allele1'] = "Tropical",
  990.      ['specialConditions'] = {},
  991.      ['allele2'] = "Rural",
  992.      ['result'] = "Caffeinated",
  993.      ['chance'] = 10
  994.     }
  995.   breedingTable[107] = {
  996.      ['allele1'] = "Common",
  997.      ['specialConditions'] = {},
  998.      ['allele2'] = "Marshy",
  999.      ['result'] = "Damp",
  1000.      ['chance'] = 10
  1001.     }
  1002.   breedingTable[108] = {
  1003.      ['allele1'] = "Damp",
  1004.      ['specialConditions'] = {},
  1005.      ['allele2'] = "Marshy",
  1006.      ['result'] = "Boggy",
  1007.      ['chance'] = 8
  1008.     }
  1009.   breedingTable[109] = {
  1010.      ['allele1'] = "Boggy",
  1011.      ['specialConditions'] = {},
  1012.      ['allele2'] = "Damp",
  1013.      ['result'] = "Fungal",
  1014.      ['chance'] = 8
  1015.     }
  1016.   breedingTable[110] = {
  1017.      ['allele1'] = "Water",
  1018.      ['specialConditions'] = {},
  1019.      ['allele2'] = "Forest",
  1020.      ['result'] = "Common",
  1021.      ['chance'] = 15
  1022.     }
  1023.   breedingTable[111] = {
  1024.      ['allele1'] = "Water",
  1025.      ['specialConditions'] = {},
  1026.      ['allele2'] = "Meadows",
  1027.      ['result'] = "Common",
  1028.      ['chance'] = 15
  1029.     }
  1030.   breedingTable[112] = {
  1031.      ['allele1'] = "Water",
  1032.      ['specialConditions'] = {},
  1033.      ['allele2'] = "Modest",
  1034.      ['result'] = "Common",
  1035.      ['chance'] = 15
  1036.     }
  1037.   breedingTable[113] = {
  1038.      ['allele1'] = "Water",
  1039.      ['specialConditions'] = {},
  1040.      ['allele2'] = "Tropical",
  1041.      ['result'] = "Common",
  1042.      ['chance'] = 15
  1043.     }
  1044.   breedingTable[114] = {
  1045.      ['allele1'] = "Water",
  1046.      ['specialConditions'] = {},
  1047.      ['allele2'] = "Marshy",
  1048.      ['result'] = "Common",
  1049.      ['chance'] = 15
  1050.     }
  1051.   breedingTable[115] = {
  1052.      ['allele1'] = "Water",
  1053.      ['specialConditions'] = {},
  1054.      ['allele2'] = "Wintry",
  1055.      ['result'] = "Common",
  1056.      ['chance'] = 15
  1057.     }
  1058.   breedingTable[116] = {
  1059.      ['allele1'] = "Water",
  1060.      ['specialConditions'] = {},
  1061.      ['allele2'] = "Rocky",
  1062.      ['result'] = "Common",
  1063.      ['chance'] = 15
  1064.     }
  1065.   breedingTable[117] = {
  1066.      ['allele1'] = "Water",
  1067.      ['specialConditions'] = {},
  1068.      ['allele2'] = "Embittered",
  1069.      ['result'] = "Common",
  1070.      ['chance'] = 15
  1071.     }
  1072.   breedingTable[118] = {
  1073.      ['allele1'] = "Rocky",
  1074.      ['specialConditions'] = {},
  1075.      ['allele2'] = "Forest",
  1076.      ['result'] = "Common",
  1077.      ['chance'] = 15
  1078.     }
  1079.   breedingTable[119] = {
  1080.      ['allele1'] = "Rocky",
  1081.      ['specialConditions'] = {},
  1082.      ['allele2'] = "Meadows",
  1083.      ['result'] = "Common",
  1084.      ['chance'] = 15
  1085.     }
  1086.   breedingTable[120] = {
  1087.      ['allele1'] = "Rocky",
  1088.      ['specialConditions'] = {},
  1089.      ['allele2'] = "Modest",
  1090.      ['result'] = "Common",
  1091.      ['chance'] = 15
  1092.     }
  1093.   breedingTable[121] = {
  1094.      ['allele1'] = "Rocky",
  1095.      ['specialConditions'] = {},
  1096.      ['allele2'] = "Tropical",
  1097.      ['result'] = "Common",
  1098.      ['chance'] = 15
  1099.     }
  1100.   breedingTable[122] = {
  1101.      ['allele1'] = "Rocky",
  1102.      ['specialConditions'] = {},
  1103.      ['allele2'] = "Marshy",
  1104.      ['result'] = "Common",
  1105.      ['chance'] = 15
  1106.     }
  1107.   breedingTable[123] = {
  1108.      ['allele1'] = "Rocky",
  1109.      ['specialConditions'] = {},
  1110.      ['allele2'] = "Wintry",
  1111.      ['result'] = "Common",
  1112.      ['chance'] = 15
  1113.     }
  1114.   breedingTable[124] = {
  1115.      ['allele1'] = "Rocky",
  1116.      ['specialConditions'] = {},
  1117.      ['allele2'] = "Embittered",
  1118.      ['result'] = "Common",
  1119.      ['chance'] = 15
  1120.     }
  1121.   breedingTable[125] = {
  1122.      ['allele1'] = "Water",
  1123.      ['specialConditions'] = {},
  1124.      ['allele2'] = "Common",
  1125.      ['result'] = "Cultivated",
  1126.      ['chance'] = 12
  1127.     }
  1128.   breedingTable[126] = {
  1129.      ['allele1'] = "Rocky",
  1130.      ['specialConditions'] = {},
  1131.      ['allele2'] = "Common",
  1132.      ['result'] = "Cultivated",
  1133.      ['chance'] = 12
  1134.     }
  1135.   breedingTable[127] = {
  1136.      ['allele1'] = "Embittered",
  1137.      ['specialConditions'] = {},
  1138.      ['allele2'] = "Sinister",
  1139.      ['result'] = "Furious",
  1140.      ['chance'] = 10
  1141.     }
  1142.   breedingTable[128] = {
  1143.      ['allele1'] = "Embittered",
  1144.      ['specialConditions'] = {},
  1145.      ['allele2'] = "Furious",
  1146.      ['result'] = "Volcanic",
  1147.      ['chance'] = 6
  1148.     }
  1149.   breedingTable[129] = {
  1150.      ['allele1'] = "Sinister",
  1151.      ['specialConditions'] = {},
  1152.      ['allele2'] = "Tropical",
  1153.      ['result'] = "Malicious",
  1154.      ['chance'] = 10
  1155.     }
  1156.   breedingTable[130] = {
  1157.      ['allele1'] = "Malicious",
  1158.      ['specialConditions'] = {},
  1159.      ['allele2'] = "Tropical",
  1160.      ['result'] = "Infectious",
  1161.      ['chance'] = 8
  1162.     }
  1163.   breedingTable[131] = {
  1164.      ['allele1'] = "Malicious",
  1165.      ['specialConditions'] = {},
  1166.      ['allele2'] = "Infectious",
  1167.      ['result'] = "Virulent",
  1168.      ['chance'] = 8
  1169.     }
  1170.   breedingTable[132] = {
  1171.      ['allele1'] = "Water",
  1172.      ['specialConditions'] = {},
  1173.      ['allele2'] = "Exotic",
  1174.      ['result'] = "Viscous",
  1175.      ['chance'] = 10
  1176.     }
  1177.   breedingTable[133] = {
  1178.      ['allele1'] = "Viscous",
  1179.      ['specialConditions'] = {},
  1180.      ['allele2'] = "Exotic",
  1181.      ['result'] = "Glutinous",
  1182.      ['chance'] = 8
  1183.     }
  1184.   breedingTable[134] = {
  1185.      ['allele1'] = "Viscous",
  1186.      ['specialConditions'] = {},
  1187.      ['allele2'] = "Glutinous",
  1188.      ['result'] = "Sticky",
  1189.      ['chance'] = 8
  1190.     }
  1191.   breedingTable[135] = {
  1192.      ['allele1'] = "Virulent",
  1193.      ['specialConditions'] = {},
  1194.      ['allele2'] = "Sticky",
  1195.      ['result'] = "Corrosive",
  1196.      ['chance'] = 10
  1197.     }
  1198.   breedingTable[136] = {
  1199.      ['allele1'] = "Corrosive",
  1200.      ['specialConditions'] = {},
  1201.      ['allele2'] = "Fiendish",
  1202.      ['result'] = "Caustic",
  1203.      ['chance'] = 8
  1204.     }
  1205.   breedingTable[137] = {
  1206.      ['allele1'] = "Corrosive",
  1207.      ['specialConditions'] = {},
  1208.      ['allele2'] = "Caustic",
  1209.      ['result'] = "Acidic",
  1210.      ['chance'] = 4
  1211.     }
  1212.   breedingTable[138] = {
  1213.      ['allele1'] = "Cultivated",
  1214.      ['specialConditions'] = {},
  1215.      ['allele2'] = "Valiant",
  1216.      ['result'] = "Excited",
  1217.      ['chance'] = 10
  1218.     }
  1219.   breedingTable[139] = {
  1220.      ['allele1'] = "Excited",
  1221.      ['specialConditions'] = {},
  1222.      ['allele2'] = "Valiant",
  1223.      ['result'] = "Energetic",
  1224.      ['chance'] = 8
  1225.     }
  1226.   breedingTable[140] = {
  1227.      ['allele1'] = "Wintry",
  1228.      ['specialConditions'] = {},
  1229.      ['allele2'] = "Diligent",
  1230.      ['result'] = "Frigid",
  1231.      ['chance'] = 10
  1232.     }
  1233.   breedingTable[141] = {
  1234.      ['allele1'] = "Ocean",
  1235.      ['specialConditions'] = {},
  1236.      ['allele2'] = "Frigid",
  1237.      ['result'] = "Absolute",
  1238.      ['chance'] = 10
  1239.     }
  1240.   breedingTable[142] = {
  1241.      ['allele1'] = "Tolerant",
  1242.      ['specialConditions'] = {},
  1243.      ['allele2'] = "Sinister",
  1244.      ['result'] = "Shadowed",
  1245.      ['chance'] = 10
  1246.     }
  1247.   breedingTable[143] = {
  1248.      ['allele1'] = "Shadowed",
  1249.      ['specialConditions'] = {},
  1250.      ['allele2'] = "Embittered",
  1251.      ['result'] = "Darkened",
  1252.      ['chance'] = 8
  1253.     }
  1254.   breedingTable[144] = {
  1255.      ['allele1'] = "Shadowed",
  1256.      ['specialConditions'] = {},
  1257.      ['allele2'] = "Darkened",
  1258.      ['result'] = "Abyssal",
  1259.      ['chance'] = 8
  1260.     }
  1261.   breedingTable[145] = {
  1262.      ['allele1'] = "Forest",
  1263.      ['specialConditions'] = {},
  1264.      ['allele2'] = "Valiant",
  1265.      ['result'] = "Maroon",
  1266.      ['chance'] = 5
  1267.     }
  1268.   breedingTable[146] = {
  1269.      ['allele1'] = "Meadows",
  1270.      ['specialConditions'] = {},
  1271.      ['allele2'] = "Valiant",
  1272.      ['result'] = "Saffron",
  1273.      ['chance'] = 5
  1274.     }
  1275.   breedingTable[147] = {
  1276.      ['allele1'] = "Water",
  1277.      ['specialConditions'] = {},
  1278.      ['allele2'] = "Valiant",
  1279.      ['result'] = "Prussian",
  1280.      ['chance'] = 5
  1281.     }
  1282.   breedingTable[148] = {
  1283.      ['allele1'] = "Tropical",
  1284.      ['specialConditions'] = {},
  1285.      ['allele2'] = "Valiant",
  1286.      ['result'] = "Natural",
  1287.      ['chance'] = 5
  1288.     }
  1289.   breedingTable[149] = {
  1290.      ['allele1'] = "Rocky",
  1291.      ['specialConditions'] = {},
  1292.      ['allele2'] = "Valiant",
  1293.      ['result'] = "Ebony",
  1294.      ['chance'] = 5
  1295.     }
  1296.   breedingTable[150] = {
  1297.      ['allele1'] = "Wintry",
  1298.      ['specialConditions'] = {},
  1299.      ['allele2'] = "Valiant",
  1300.      ['result'] = "Bleached",
  1301.      ['chance'] = 5
  1302.     }
  1303.   breedingTable[151] = {
  1304.      ['allele1'] = "Marshy",
  1305.      ['specialConditions'] = {},
  1306.      ['allele2'] = "Valiant",
  1307.      ['result'] = "Sepia",
  1308.      ['chance'] = 5
  1309.     }
  1310.   breedingTable[152] = {
  1311.      ['allele1'] = "Maroon",
  1312.      ['specialConditions'] = {},
  1313.      ['allele2'] = "Saffron",
  1314.      ['result'] = "Amber",
  1315.      ['chance'] = 5
  1316.     }
  1317.   breedingTable[153] = {
  1318.      ['allele1'] = "Natural",
  1319.      ['specialConditions'] = {},
  1320.      ['allele2'] = "Prussian",
  1321.      ['result'] = "Turquoise",
  1322.      ['chance'] = 5
  1323.     }
  1324.   breedingTable[154] = {
  1325.      ['allele1'] = "Maroon",
  1326.      ['specialConditions'] = {},
  1327.      ['allele2'] = "Prussian",
  1328.      ['result'] = "Indigo",
  1329.      ['chance'] = 5
  1330.     }
  1331.   breedingTable[155] = {
  1332.      ['allele1'] = "Ebony",
  1333.      ['specialConditions'] = {},
  1334.      ['allele2'] = "Bleached",
  1335.      ['result'] = "Slate",
  1336.      ['chance'] = 5
  1337.     }
  1338.   breedingTable[156] = {
  1339.      ['allele1'] = "Prussian",
  1340.      ['specialConditions'] = {},
  1341.      ['allele2'] = "Bleached",
  1342.      ['result'] = "Azure",
  1343.      ['chance'] = 5
  1344.     }
  1345.   breedingTable[157] = {
  1346.      ['allele1'] = "Maroon",
  1347.      ['specialConditions'] = {},
  1348.      ['allele2'] = "Bleached",
  1349.      ['result'] = "Lavender",
  1350.      ['chance'] = 5
  1351.     }
  1352.   breedingTable[158] = {
  1353.      ['allele1'] = "Natural",
  1354.      ['specialConditions'] = {},
  1355.      ['allele2'] = "Bleached",
  1356.      ['result'] = "Lime",
  1357.      ['chance'] = 5
  1358.     }
  1359.   breedingTable[159] = {
  1360.      ['allele1'] = "Indigo",
  1361.      ['specialConditions'] = {},
  1362.      ['allele2'] = "Lavender",
  1363.      ['result'] = "Fuchsia",
  1364.      ['chance'] = 5
  1365.     }
  1366.   breedingTable[160] = {
  1367.      ['allele1'] = "Slate",
  1368.      ['specialConditions'] = {},
  1369.      ['allele2'] = "Bleached",
  1370.      ['result'] = "Ashen",
  1371.      ['chance'] = 5
  1372.     }
  1373.   breedingTable[161] = {
  1374.      ['allele1'] = "Furious",
  1375.      ['specialConditions'] = {},
  1376.      ['allele2'] = "Excited",
  1377.      ['result'] = "Glowering",
  1378.      ['chance'] = 5
  1379.     }
  1380.   breedingTable[162] = {
  1381.      ['allele1'] = "Austere",
  1382.      ['specialConditions'] = {},
  1383.      ['allele2'] = "Desolate",
  1384.      ['result'] = "Hazardous",
  1385.      ['chance'] = 5
  1386.     }
  1387.   breedingTable[163] = {
  1388.      ['allele1'] = "Ender",
  1389.      ['specialConditions'] = {},
  1390.      ['allele2'] = "Relic",
  1391.      ['result'] = "Jaded",
  1392.      ['chance'] = 2
  1393.     }
  1394.   breedingTable[164] = {
  1395.      ['allele1'] = "Austere",
  1396.      ['specialConditions'] = {},
  1397.      ['allele2'] = "Excited",
  1398.      ['result'] = "Celebratory",
  1399.      ['chance'] = 5
  1400.     }
  1401.   breedingTable[165] = {
  1402.      ['allele1'] = "Secluded",
  1403.      ['specialConditions'] = {},
  1404.      ['allele2'] = "Ender",
  1405.      ['result'] = "Abnormal",
  1406.      ['chance'] = 5
  1407.     }
  1408.   breedingTable[166] = {
  1409.      ['allele1'] = "Abnormal",
  1410.      ['specialConditions'] = {},
  1411.      ['allele2'] = "Hermitic",
  1412.      ['result'] = "Spatial",
  1413.      ['chance'] = 5
  1414.     }
  1415.   breedingTable[167] = {
  1416.      ['allele1'] = "Spatial",
  1417.      ['specialConditions'] = {},
  1418.      ['allele2'] = "Spectral",
  1419.      ['result'] = "Quantum",
  1420.      ['chance'] = 5
  1421.     }
  1422.   breedingTable[168] = {
  1423.      ['allele1'] = "Mystical",
  1424.      ['specialConditions'] = {},
  1425.      ['allele2'] = "Forest",
  1426.      ['result'] = "Common",
  1427.      ['chance'] = 15
  1428.     }
  1429.   breedingTable[169] = {
  1430.      ['allele1'] = "Mystical",
  1431.      ['specialConditions'] = {},
  1432.      ['allele2'] = "Meadows",
  1433.      ['result'] = "Common",
  1434.      ['chance'] = 15
  1435.     }
  1436.   breedingTable[170] = {
  1437.      ['allele1'] = "Mystical",
  1438.      ['specialConditions'] = {},
  1439.      ['allele2'] = "Modest",
  1440.      ['result'] = "Common",
  1441.      ['chance'] = 15
  1442.     }
  1443.   breedingTable[171] = {
  1444.      ['allele1'] = "Mystical",
  1445.      ['specialConditions'] = {},
  1446.      ['allele2'] = "Wintry",
  1447.      ['result'] = "Common",
  1448.      ['chance'] = 15
  1449.     }
  1450.   breedingTable[172] = {
  1451.      ['allele1'] = "Mystical",
  1452.      ['specialConditions'] = {},
  1453.      ['allele2'] = "Tropical",
  1454.      ['result'] = "Common",
  1455.      ['chance'] = 15
  1456.     }
  1457.   breedingTable[173] = {
  1458.      ['allele1'] = "Mystical",
  1459.      ['specialConditions'] = {},
  1460.      ['allele2'] = "Marshy",
  1461.      ['result'] = "Common",
  1462.      ['chance'] = 15
  1463.     }
  1464.   breedingTable[174] = {
  1465.      ['allele1'] = "Mystical",
  1466.      ['specialConditions'] = {},
  1467.      ['allele2'] = "Rocky",
  1468.      ['result'] = "Common",
  1469.      ['chance'] = 15
  1470.     }
  1471.   breedingTable[175] = {
  1472.      ['allele1'] = "Mystical",
  1473.      ['specialConditions'] = {},
  1474.      ['allele2'] = "Water",
  1475.      ['result'] = "Common",
  1476.      ['chance'] = 15
  1477.     }
  1478.   breedingTable[176] = {
  1479.      ['allele1'] = "Mystical",
  1480.      ['specialConditions'] = {},
  1481.      ['allele2'] = "Embittered",
  1482.      ['result'] = "Common",
  1483.      ['chance'] = 15
  1484.     }
  1485.   breedingTable[177] = {
  1486.      ['allele1'] = "Mystical",
  1487.      ['specialConditions'] = {},
  1488.      ['allele2'] = "Common",
  1489.      ['result'] = "Cultivated",
  1490.      ['chance'] = 12
  1491.     }
  1492.   breedingTable[178] = {
  1493.      ['allele1'] = "Mystical",
  1494.      ['specialConditions'] = {},
  1495.      ['allele2'] = "Cultivated",
  1496.      ['result'] = "Eldritch",
  1497.      ['chance'] = 12
  1498.     }
  1499.   breedingTable[179] = {
  1500.      ['allele1'] = "Sorcerous",
  1501.      ['specialConditions'] = {},
  1502.      ['allele2'] = "Forest",
  1503.      ['result'] = "Common",
  1504.      ['chance'] = 15
  1505.     }
  1506.   breedingTable[180] = {
  1507.      ['allele1'] = "Sorcerous",
  1508.      ['specialConditions'] = {},
  1509.      ['allele2'] = "Meadows",
  1510.      ['result'] = "Common",
  1511.      ['chance'] = 15
  1512.     }
  1513.   breedingTable[181] = {
  1514.      ['allele1'] = "Sorcerous",
  1515.      ['specialConditions'] = {},
  1516.      ['allele2'] = "Modest",
  1517.      ['result'] = "Common",
  1518.      ['chance'] = 15
  1519.     }
  1520.   breedingTable[182] = {
  1521.      ['allele1'] = "Sorcerous",
  1522.      ['specialConditions'] = {},
  1523.      ['allele2'] = "Wintry",
  1524.      ['result'] = "Common",
  1525.      ['chance'] = 15
  1526.     }
  1527.   breedingTable[183] = {
  1528.      ['allele1'] = "Sorcerous",
  1529.      ['specialConditions'] = {},
  1530.      ['allele2'] = "Tropical",
  1531.      ['result'] = "Common",
  1532.      ['chance'] = 15
  1533.     }
  1534.   breedingTable[184] = {
  1535.      ['allele1'] = "Sorcerous",
  1536.      ['specialConditions'] = {},
  1537.      ['allele2'] = "Marshy",
  1538.      ['result'] = "Common",
  1539.      ['chance'] = 15
  1540.     }
  1541.   breedingTable[185] = {
  1542.      ['allele1'] = "Sorcerous",
  1543.      ['specialConditions'] = {},
  1544.      ['allele2'] = "Rocky",
  1545.      ['result'] = "Common",
  1546.      ['chance'] = 15
  1547.     }
  1548.   breedingTable[186] = {
  1549.      ['allele1'] = "Sorcerous",
  1550.      ['specialConditions'] = {},
  1551.      ['allele2'] = "Water",
  1552.      ['result'] = "Common",
  1553.      ['chance'] = 15
  1554.     }
  1555.   breedingTable[187] = {
  1556.      ['allele1'] = "Sorcerous",
  1557.      ['specialConditions'] = {},
  1558.      ['allele2'] = "Embittered",
  1559.      ['result'] = "Common",
  1560.      ['chance'] = 15
  1561.     }
  1562.   breedingTable[188] = {
  1563.      ['allele1'] = "Sorcerous",
  1564.      ['specialConditions'] = {},
  1565.      ['allele2'] = "Common",
  1566.      ['result'] = "Cultivated",
  1567.      ['chance'] = 12
  1568.     }
  1569.   breedingTable[189] = {
  1570.      ['allele1'] = "Sorcerous",
  1571.      ['specialConditions'] = {},
  1572.      ['allele2'] = "Cultivated",
  1573.      ['result'] = "Eldritch",
  1574.      ['chance'] = 12
  1575.     }
  1576.   breedingTable[190] = {
  1577.      ['allele1'] = "Unusual",
  1578.      ['specialConditions'] = {},
  1579.      ['allele2'] = "Forest",
  1580.      ['result'] = "Common",
  1581.      ['chance'] = 15
  1582.     }
  1583.   breedingTable[191] = {
  1584.      ['allele1'] = "Unusual",
  1585.      ['specialConditions'] = {},
  1586.      ['allele2'] = "Meadows",
  1587.      ['result'] = "Common",
  1588.      ['chance'] = 15
  1589.     }
  1590.   breedingTable[192] = {
  1591.      ['allele1'] = "Unusual",
  1592.      ['specialConditions'] = {},
  1593.      ['allele2'] = "Modest",
  1594.      ['result'] = "Common",
  1595.      ['chance'] = 15
  1596.     }
  1597.   breedingTable[193] = {
  1598.      ['allele1'] = "Unusual",
  1599.      ['specialConditions'] = {},
  1600.      ['allele2'] = "Wintry",
  1601.      ['result'] = "Common",
  1602.      ['chance'] = 15
  1603.     }
  1604.   breedingTable[194] = {
  1605.      ['allele1'] = "Unusual",
  1606.      ['specialConditions'] = {},
  1607.      ['allele2'] = "Tropical",
  1608.      ['result'] = "Common",
  1609.      ['chance'] = 15
  1610.     }
  1611.   breedingTable[195] = {
  1612.      ['allele1'] = "Unusual",
  1613.      ['specialConditions'] = {},
  1614.      ['allele2'] = "Marshy",
  1615.      ['result'] = "Common",
  1616.      ['chance'] = 15
  1617.     }
  1618.   breedingTable[196] = {
  1619.      ['allele1'] = "Unusual",
  1620.      ['specialConditions'] = {},
  1621.      ['allele2'] = "Rocky",
  1622.      ['result'] = "Common",
  1623.      ['chance'] = 15
  1624.     }
  1625.   breedingTable[197] = {
  1626.      ['allele1'] = "Unusual",
  1627.      ['specialConditions'] = {},
  1628.      ['allele2'] = "Water",
  1629.      ['result'] = "Common",
  1630.      ['chance'] = 15
  1631.     }
  1632.   breedingTable[198] = {
  1633.      ['allele1'] = "Unusual",
  1634.      ['specialConditions'] = {},
  1635.      ['allele2'] = "Embittered",
  1636.      ['result'] = "Common",
  1637.      ['chance'] = 15
  1638.     }
  1639.   breedingTable[199] = {
  1640.      ['allele1'] = "Unusual",
  1641.      ['specialConditions'] = {},
  1642.      ['allele2'] = "Common",
  1643.      ['result'] = "Cultivated",
  1644.      ['chance'] = 12
  1645.     }
  1646.   breedingTable[200] = {
  1647.      ['allele1'] = "Unusual",
  1648.      ['specialConditions'] = {},
  1649.      ['allele2'] = "Cultivated",
  1650.      ['result'] = "Eldritch",
  1651.      ['chance'] = 12
  1652.     }
  1653.   breedingTable[201] = {
  1654.      ['allele1'] = "Attuned",
  1655.      ['specialConditions'] = {},
  1656.      ['allele2'] = "Forest",
  1657.      ['result'] = "Common",
  1658.      ['chance'] = 15
  1659.     }
  1660.   breedingTable[202] = {
  1661.      ['allele1'] = "Attuned",
  1662.      ['specialConditions'] = {},
  1663.      ['allele2'] = "Meadows",
  1664.      ['result'] = "Common",
  1665.      ['chance'] = 15
  1666.     }
  1667.   breedingTable[203] = {
  1668.      ['allele1'] = "Attuned",
  1669.      ['specialConditions'] = {},
  1670.      ['allele2'] = "Modest",
  1671.      ['result'] = "Common",
  1672.      ['chance'] = 15
  1673.     }
  1674.   breedingTable[204] = {
  1675.      ['allele1'] = "Attuned",
  1676.      ['specialConditions'] = {},
  1677.      ['allele2'] = "Wintry",
  1678.      ['result'] = "Common",
  1679.      ['chance'] = 15
  1680.     }
  1681.   breedingTable[205] = {
  1682.      ['allele1'] = "Attuned",
  1683.      ['specialConditions'] = {},
  1684.      ['allele2'] = "Tropical",
  1685.      ['result'] = "Common",
  1686.      ['chance'] = 15
  1687.     }
  1688.   breedingTable[206] = {
  1689.      ['allele1'] = "Attuned",
  1690.      ['specialConditions'] = {},
  1691.      ['allele2'] = "Marshy",
  1692.      ['result'] = "Common",
  1693.      ['chance'] = 15
  1694.     }
  1695.   breedingTable[207] = {
  1696.      ['allele1'] = "Attuned",
  1697.      ['specialConditions'] = {},
  1698.      ['allele2'] = "Rocky",
  1699.      ['result'] = "Common",
  1700.      ['chance'] = 15
  1701.     }
  1702.   breedingTable[208] = {
  1703.      ['allele1'] = "Attuned",
  1704.      ['specialConditions'] = {},
  1705.      ['allele2'] = "Water",
  1706.      ['result'] = "Common",
  1707.      ['chance'] = 15
  1708.     }
  1709.   breedingTable[209] = {
  1710.      ['allele1'] = "Attuned",
  1711.      ['specialConditions'] = {},
  1712.      ['allele2'] = "Embittered",
  1713.      ['result'] = "Common",
  1714.      ['chance'] = 15
  1715.     }
  1716.   breedingTable[210] = {
  1717.      ['allele1'] = "Attuned",
  1718.      ['specialConditions'] = {},
  1719.      ['allele2'] = "Common",
  1720.      ['result'] = "Cultivated",
  1721.      ['chance'] = 12
  1722.     }
  1723.   breedingTable[211] = {
  1724.      ['allele1'] = "Attuned",
  1725.      ['specialConditions'] = {},
  1726.      ['allele2'] = "Cultivated",
  1727.      ['result'] = "Eldritch",
  1728.      ['chance'] = 12
  1729.     }
  1730.   breedingTable[212] = {
  1731.      ['allele1'] = "Cultivated",
  1732.      ['specialConditions'] = {},
  1733.      ['allele2'] = "Eldritch",
  1734.      ['result'] = "Esoteric",
  1735.      ['chance'] = 10
  1736.     }
  1737.   breedingTable[213] = {
  1738.      ['allele1'] = "Eldritch",
  1739.      ['specialConditions'] = {},
  1740.      ['allele2'] = "Esoteric",
  1741.      ['result'] = "Mysterious",
  1742.      ['chance'] = 8
  1743.     }
  1744.   breedingTable[214] = {
  1745.      ['allele1'] = "Esoteric",
  1746.      ['specialConditions'] = {},
  1747.      ['allele2'] = "Mysterious",
  1748.      ['result'] = "Arcane",
  1749.      ['chance'] = 8
  1750.     }
  1751.   breedingTable[215] = {
  1752.      ['allele1'] = "Cultivated",
  1753.      ['specialConditions'] = {},
  1754.      ['allele2'] = "Eldritch",
  1755.      ['result'] = "Charmed",
  1756.      ['chance'] = 10
  1757.     }
  1758.   breedingTable[216] = {
  1759.      ['allele1'] = "Eldritch",
  1760.      ['specialConditions'] = {},
  1761.      ['allele2'] = "Charmed",
  1762.      ['result'] = "Enchanted",
  1763.      ['chance'] = 8
  1764.     }
  1765.   breedingTable[217] = {
  1766.      ['allele1'] = "Charmed",
  1767.      ['specialConditions'] = {},
  1768.      ['allele2'] = "Enchanted",
  1769.      ['result'] = "Supernatural",
  1770.      ['chance'] = 8
  1771.     }
  1772.   breedingTable[218] = {
  1773.      ['allele1'] = "Arcane",
  1774.      ['specialConditions'] = {},
  1775.      ['allele2'] = "Supernatural",
  1776.      ['result'] = "Ethereal",
  1777.      ['chance'] = 7
  1778.     }
  1779.   breedingTable[219] = {
  1780.      ['allele1'] = "Supernatural",
  1781.      ['specialConditions'] = {[1] = "Requires a foundation of Oak Leaves"},
  1782.      ['allele2'] = "Ethereal",
  1783.      ['result'] = "Windy",
  1784.      ['chance'] = 14
  1785.     }
  1786.   breedingTable[220] = {
  1787.      ['allele1'] = "Supernatural",
  1788.      ['specialConditions'] = {[1] = "Requires a foundation of Water"},
  1789.      ['allele2'] = "Ethereal",
  1790.      ['result'] = "Watery",
  1791.      ['chance'] = 14
  1792.     }
  1793.   breedingTable[221] = {
  1794.      ['allele1'] = "Supernatural",
  1795.      ['specialConditions'] = {[1] = "Requires a foundation of Bricks"},
  1796.      ['allele2'] = "Ethereal",
  1797.      ['result'] = "Earthen",
  1798.      ['chance'] = 100
  1799.     }
  1800.   breedingTable[222] = {
  1801.      ['allele1'] = "Supernatural",
  1802.      ['specialConditions'] = {[1] = "Requires a foundation of Lava"},
  1803.      ['allele2'] = "Ethereal",
  1804.      ['result'] = "Firey",
  1805.      ['chance'] = 14
  1806.     }
  1807.   breedingTable[223] = {
  1808.      ['allele1'] = "Ethereal",
  1809.      ['specialConditions'] = {},
  1810.      ['allele2'] = "Attuned",
  1811.      ['result'] = "Aware",
  1812.      ['chance'] = 10
  1813.     }
  1814.   breedingTable[224] = {
  1815.      ['allele1'] = "Ethereal",
  1816.      ['specialConditions'] = {},
  1817.      ['allele2'] = "Aware",
  1818.      ['result'] = "Spirit",
  1819.      ['chance'] = 8
  1820.     }
  1821.   breedingTable[225] = {
  1822.      ['allele1'] = "Attuned",
  1823.      ['specialConditions'] = {},
  1824.      ['allele2'] = "Aware",
  1825.      ['result'] = "Spirit",
  1826.      ['chance'] = 8
  1827.     }
  1828.   breedingTable[226] = {
  1829.      ['allele1'] = "Aware",
  1830.      ['specialConditions'] = {},
  1831.      ['allele2'] = "Spirit",
  1832.      ['result'] = "Soul",
  1833.      ['chance'] = 7
  1834.     }
  1835.   breedingTable[227] = {
  1836.      ['allele1'] = "Monastic",
  1837.      ['specialConditions'] = {},
  1838.      ['allele2'] = "Arcane",
  1839.      ['result'] = "Pupil",
  1840.      ['chance'] = 10
  1841.     }
  1842.   breedingTable[228] = {
  1843.      ['allele1'] = "Arcane",
  1844.      ['specialConditions'] = {},
  1845.      ['allele2'] = "Pupil",
  1846.      ['result'] = "Scholarly",
  1847.      ['chance'] = 8
  1848.     }
  1849.   breedingTable[229] = {
  1850.      ['allele1'] = "Pupil",
  1851.      ['specialConditions'] = {},
  1852.      ['allele2'] = "Scholarly",
  1853.      ['result'] = "Savant",
  1854.      ['chance'] = 6
  1855.     }
  1856.   breedingTable[230] = {
  1857.      ['allele1'] = "Imperial",
  1858.      ['specialConditions'] = {},
  1859.      ['allele2'] = "Ethereal",
  1860.      ['result'] = "Timely",
  1861.      ['chance'] = 8
  1862.     }
  1863.   breedingTable[231] = {
  1864.      ['allele1'] = "Imperial",
  1865.      ['specialConditions'] = {},
  1866.      ['allele2'] = "Timely",
  1867.      ['result'] = "Lordly",
  1868.      ['chance'] = 8
  1869.     }
  1870.   breedingTable[232] = {
  1871.      ['allele1'] = "Timely",
  1872.      ['specialConditions'] = {},
  1873.      ['allele2'] = "Lordly",
  1874.      ['result'] = "Doctoral",
  1875.      ['chance'] = 7
  1876.     }
  1877.   breedingTable[233] = {
  1878.      ['allele1'] = "Infernal",
  1879.      ['specialConditions'] = {[1] = "Occurs within a Nether biome"},
  1880.      ['allele2'] = "Eldritch",
  1881.      ['result'] = "Hateful",
  1882.      ['chance'] = 9
  1883.     }
  1884.   breedingTable[234] = {
  1885.      ['allele1'] = "Infernal",
  1886.      ['specialConditions'] = {},
  1887.      ['allele2'] = "Hateful",
  1888.      ['result'] = "Spiteful",
  1889.      ['chance'] = 7
  1890.     }
  1891.   breedingTable[235] = {
  1892.      ['allele1'] = "Demonic",
  1893.      ['specialConditions'] = {},
  1894.      ['allele2'] = "Spiteful",
  1895.      ['result'] = "Withering",
  1896.      ['chance'] = 6
  1897.     }
  1898.   breedingTable[236] = {
  1899.      ['allele1'] = "Modest",
  1900.      ['specialConditions'] = {},
  1901.      ['allele2'] = "Eldritch",
  1902.      ['result'] = "Skulking",
  1903.      ['chance'] = 12
  1904.     }
  1905.   breedingTable[237] = {
  1906.      ['allele1'] = "Tropical",
  1907.      ['specialConditions'] = {},
  1908.      ['allele2'] = "Skulking",
  1909.      ['result'] = "Spidery",
  1910.      ['chance'] = 10
  1911.     }
  1912.   breedingTable[238] = {
  1913.      ['allele1'] = "Skulking",
  1914.      ['specialConditions'] = {},
  1915.      ['allele2'] = "Ethereal",
  1916.      ['result'] = "Ghastly",
  1917.      ['chance'] = 9
  1918.     }
  1919.   breedingTable[239] = {
  1920.      ['allele1'] = "Skulking",
  1921.      ['specialConditions'] = {},
  1922.      ['allele2'] = "Hateful",
  1923.      ['result'] = "Smouldering",
  1924.      ['chance'] = 7
  1925.     }
  1926.   breedingTable[240] = {
  1927.      ['allele1'] = "Ethereal",
  1928.      ['specialConditions'] = {},
  1929.      ['allele2'] = "Oblivion",
  1930.      ['result'] = "Nameless",
  1931.      ['chance'] = 10
  1932.     }
  1933.   breedingTable[241] = {
  1934.      ['allele1'] = "Oblivion",
  1935.      ['specialConditions'] = {},
  1936.      ['allele2'] = "Nameless",
  1937.      ['result'] = "Abandoned",
  1938.      ['chance'] = 8
  1939.     }
  1940.   breedingTable[242] = {
  1941.      ['allele1'] = "Nameless",
  1942.      ['specialConditions'] = {},
  1943.      ['allele2'] = "Abandoned",
  1944.      ['result'] = "Forlorn",
  1945.      ['chance'] = 6
  1946.     }
  1947.   breedingTable[243] = {
  1948.      ['allele1'] = "Imperial",
  1949.      ['specialConditions'] = {[1] = "Occurs within a End biome"},
  1950.      ['allele2'] = "Abandoned",
  1951.      ['result'] = "Draconic",
  1952.      ['chance'] = 6
  1953.     }
  1954.   breedingTable[244] = {
  1955.      ['allele1'] = "Unusual",
  1956.      ['specialConditions'] = {},
  1957.      ['allele2'] = "Eldritch",
  1958.      ['result'] = "Mutable",
  1959.      ['chance'] = 12
  1960.     }
  1961.   breedingTable[245] = {
  1962.      ['allele1'] = "Unusual",
  1963.      ['specialConditions'] = {},
  1964.      ['allele2'] = "Mutable",
  1965.      ['result'] = "Transmuting",
  1966.      ['chance'] = 9
  1967.     }
  1968.   breedingTable[246] = {
  1969.      ['allele1'] = "Unusual",
  1970.      ['specialConditions'] = {},
  1971.      ['allele2'] = "Mutable",
  1972.      ['result'] = "Crumbling",
  1973.      ['chance'] = 9
  1974.     }
  1975.   breedingTable[247] = {
  1976.      ['allele1'] = "Mystical",
  1977.      ['specialConditions'] = {},
  1978.      ['allele2'] = "Mutable",
  1979.      ['result'] = "Invisible",
  1980.      ['chance'] = 15
  1981.     }
  1982.   breedingTable[248] = {
  1983.      ['allele1'] = "Industrious",
  1984.      ['specialConditions'] = {[1] = "Requires a foundation of Copper Block"},
  1985.      ['allele2'] = "Meadows",
  1986.      ['result'] = "Cuprum",
  1987.      ['chance'] = 12
  1988.     }
  1989.   breedingTable[249] = {
  1990.      ['allele1'] = "Industrious",
  1991.      ['specialConditions'] = {[1] = "Requires a foundation of Tin Block"},
  1992.      ['allele2'] = "Forest",
  1993.      ['result'] = "Stannum",
  1994.      ['chance'] = 12
  1995.     }
  1996.   breedingTable[250] = {
  1997.      ['allele1'] = "Common",
  1998.      ['specialConditions'] = {[1] = "Requires a foundation of Block of Iron"},
  1999.      ['allele2'] = "Industrious",
  2000.      ['result'] = "Ferrous",
  2001.      ['chance'] = 12
  2002.     }
  2003.   breedingTable[251] = {
  2004.      ['allele1'] = "Stannum",
  2005.      ['specialConditions'] = {[1] = "Requires a foundation of Lead Block"},
  2006.      ['allele2'] = "Common",
  2007.      ['result'] = "Plumbum",
  2008.      ['chance'] = 10
  2009.     }
  2010.   breedingTable[252] = {
  2011.      ['allele1'] = "Imperial",
  2012.      ['specialConditions'] = {[1] = "Requires a foundation of Block of Silver"},
  2013.      ['allele2'] = "Modest",
  2014.      ['result'] = "Argentum",
  2015.      ['chance'] = 8
  2016.     }
  2017.   breedingTable[253] = {
  2018.      ['allele1'] = "Imperial",
  2019.      ['specialConditions'] = {[1] = "Requires a foundation of Block of Gold"},
  2020.      ['allele2'] = "Plumbum",
  2021.      ['result'] = "Auric",
  2022.      ['chance'] = 8
  2023.     }
  2024.   breedingTable[254] = {
  2025.      ['allele1'] = "Industrious",
  2026.      ['specialConditions'] = {[1] = "Requires a foundation of Block of Ardite"},
  2027.      ['allele2'] = "Infernal",
  2028.      ['result'] = "Ardite",
  2029.      ['chance'] = 9
  2030.     }
  2031.   breedingTable[255] = {
  2032.      ['allele1'] = "Imperial",
  2033.      ['specialConditions'] = {[1] = "Requires a foundation of Block of Cobalt"},
  2034.      ['allele2'] = "Infernal",
  2035.      ['result'] = "Cobalt",
  2036.      ['chance'] = 9
  2037.     }
  2038.   breedingTable[256] = {
  2039.      ['allele1'] = "Ardite",
  2040.      ['specialConditions'] = {[1] = "Requires a foundation of Block of Manyullyn"},
  2041.      ['allele2'] = "Cobalt",
  2042.      ['result'] = "Manyullyn",
  2043.      ['chance'] = 9
  2044.     }
  2045.   breedingTable[257] = {
  2046.      ['allele1'] = "Austere",
  2047.      ['specialConditions'] = {[1] = "Requires a foundation of Block of Diamond"},
  2048.      ['allele2'] = "Auric",
  2049.      ['result'] = "Diamandi",
  2050.      ['chance'] = 7
  2051.     }
  2052.   breedingTable[258] = {
  2053.      ['allele1'] = "Austere",
  2054.      ['specialConditions'] = {[1] = "Requires a foundation of Block of Emerald"},
  2055.      ['allele2'] = "Argentum",
  2056.      ['result'] = "Esmeraldi",
  2057.      ['chance'] = 6
  2058.     }
  2059.   breedingTable[259] = {
  2060.      ['allele1'] = "Rural",
  2061.      ['specialConditions'] = {[1] = "Requires a foundation of Apatite Ore"},
  2062.      ['allele2'] = "Cuprum",
  2063.      ['result'] = "Apatine",
  2064.      ['chance'] = 12
  2065.     }
  2066.   breedingTable[260] = {
  2067.      ['allele1'] = "Windy",
  2068.      ['specialConditions'] = {[1] = "Requires a foundation of Air Crystal Cluster"},
  2069.      ['allele2'] = "Windy",
  2070.      ['result'] = "Aer",
  2071.      ['chance'] = 8
  2072.     }
  2073.   breedingTable[261] = {
  2074.      ['allele1'] = "Firey",
  2075.      ['specialConditions'] = {[1] = "Requires a foundation of Fire Crystal Cluster"},
  2076.      ['allele2'] = "Firey",
  2077.      ['result'] = "Ignis",
  2078.      ['chance'] = 8
  2079.     }
  2080.   breedingTable[262] = {
  2081.      ['allele1'] = "Watery",
  2082.      ['specialConditions'] = {[1] = "Requires a foundation of Water Crystal Cluster"},
  2083.      ['allele2'] = "Watery",
  2084.      ['result'] = "Aqua",
  2085.      ['chance'] = 8
  2086.     }
  2087.   breedingTable[263] = {
  2088.      ['allele1'] = "Earthen",
  2089.      ['specialConditions'] = {[1] = "Requires a foundation of Earth Crystal Cluster"},
  2090.      ['allele2'] = "Earthen",
  2091.      ['result'] = "Solum",
  2092.      ['chance'] = 8
  2093.     }
  2094.   breedingTable[264] = {
  2095.      ['allele1'] = "Ethereal",
  2096.      ['specialConditions'] = {[1] = "Requires a foundation of Order Crystal Cluster"},
  2097.      ['allele2'] = "Arcane",
  2098.      ['result'] = "Ordered",
  2099.      ['chance'] = 8
  2100.     }
  2101.   breedingTable[265] = {
  2102.      ['allele1'] = "Ethereal",
  2103.      ['specialConditions'] = {[1] = "Requires a foundation of Entropy Crystal Cluster"},
  2104.      ['allele2'] = "Supernatural",
  2105.      ['result'] = "Chaotic",
  2106.      ['chance'] = 8
  2107.     }
  2108.   breedingTable[266] = {
  2109.      ['allele1'] = "Skulking",
  2110.      ['specialConditions'] = {},
  2111.      ['allele2'] = "Windy",
  2112.      ['result'] = "Batty",
  2113.      ['chance'] = 9
  2114.     }
  2115.   breedingTable[267] = {
  2116.      ['allele1'] = "Skulking",
  2117.      ['specialConditions'] = {},
  2118.      ['allele2'] = "Pupil",
  2119.      ['result'] = "Brainy",
  2120.      ['chance'] = 9
  2121.     }
  2122.   breedingTable[268] = {
  2123.      ['allele1'] = "Common",
  2124.      ['specialConditions'] = {[1] = "Occurs within a Forest biome"},
  2125.      ['allele2'] = "Skulking",
  2126.      ['result'] = "Poultry",
  2127.      ['chance'] = 12
  2128.     }
  2129.   breedingTable[269] = {
  2130.      ['allele1'] = "Common",
  2131.      ['specialConditions'] = {[1] = "Occurs within a Plains biome"},
  2132.      ['allele2'] = "Skulking",
  2133.      ['result'] = "Beefy",
  2134.      ['chance'] = 12
  2135.     }
  2136.   breedingTable[270] = {
  2137.      ['allele1'] = "Common",
  2138.      ['specialConditions'] = {[1] = "Occurs within a Mountain biome"},
  2139.      ['allele2'] = "Skulking",
  2140.      ['result'] = "Porcine",
  2141.      ['chance'] = 12
  2142.     }
  2143.   breedingTable[271] = {
  2144.      ['allele1'] = "Arcane",
  2145.      ['specialConditions'] = {},
  2146.      ['allele2'] = "Ethereal",
  2147.      ['result'] = "Essence",
  2148.      ['chance'] = 10
  2149.     }
  2150.   breedingTable[272] = {
  2151.      ['allele1'] = "Arcane",
  2152.      ['specialConditions'] = {},
  2153.      ['allele2'] = "Essence",
  2154.      ['result'] = "Quintessential",
  2155.      ['chance'] = 7
  2156.     }
  2157.   breedingTable[273] = {
  2158.      ['allele1'] = "Essence",
  2159.      ['specialConditions'] = {},
  2160.      ['allele2'] = "Windy",
  2161.      ['result'] = "Luft",
  2162.      ['chance'] = 10
  2163.     }
  2164.   breedingTable[274] = {
  2165.      ['allele1'] = "Essence",
  2166.      ['specialConditions'] = {},
  2167.      ['allele2'] = "Earthen",
  2168.      ['result'] = "Erde",
  2169.      ['chance'] = 10
  2170.     }
  2171.   breedingTable[275] = {
  2172.      ['allele1'] = "Essence",
  2173.      ['specialConditions'] = {},
  2174.      ['allele2'] = "Firey",
  2175.      ['result'] = "Feuer",
  2176.      ['chance'] = 10
  2177.     }
  2178.   breedingTable[276] = {
  2179.      ['allele1'] = "Essence",
  2180.      ['specialConditions'] = {},
  2181.      ['allele2'] = "Watery",
  2182.      ['result'] = "Wasser",
  2183.      ['chance'] = 10
  2184.     }
  2185.   breedingTable[277] = {
  2186.      ['allele1'] = "Essence",
  2187.      ['specialConditions'] = {},
  2188.      ['allele2'] = "Ethereal",
  2189.      ['result'] = "Arkanen",
  2190.      ['chance'] = 10
  2191.     }
  2192.   breedingTable[278] = {
  2193.      ['allele1'] = "Windy",
  2194.      ['specialConditions'] = {},
  2195.      ['allele2'] = "Luft",
  2196.      ['result'] = "Blitz",
  2197.      ['chance'] = 8
  2198.     }
  2199.   breedingTable[279] = {
  2200.      ['allele1'] = "Earthen",
  2201.      ['specialConditions'] = {},
  2202.      ['allele2'] = "Erde",
  2203.      ['result'] = "Staude",
  2204.      ['chance'] = 8
  2205.     }
  2206.   breedingTable[280] = {
  2207.      ['allele1'] = "Watery",
  2208.      ['specialConditions'] = {},
  2209.      ['allele2'] = "Wasser",
  2210.      ['result'] = "Eis",
  2211.      ['chance'] = 8
  2212.     }
  2213.   breedingTable[281] = {
  2214.      ['allele1'] = "Skulking",
  2215.      ['specialConditions'] = {},
  2216.      ['allele2'] = "Essence",
  2217.      ['result'] = "Vortex",
  2218.      ['chance'] = 8
  2219.     }
  2220.   breedingTable[282] = {
  2221.      ['allele1'] = "Skulking",
  2222.      ['specialConditions'] = {},
  2223.      ['allele2'] = "Ghastly",
  2224.      ['result'] = "Wight",
  2225.      ['chance'] = 8
  2226.     }
  2227.   breedingTable[283] = {
  2228.      ['allele1'] = "Stannum",
  2229.      ['specialConditions'] = {[1] = "Requires a foundation of Bronze Block"},
  2230.      ['allele2'] = "Cuprum",
  2231.      ['result'] = "Tinker",
  2232.      ['chance'] = 12
  2233.     }
  2234.   breedingTable[284] = {
  2235.      ['allele1'] = "Auric",
  2236.      ['specialConditions'] = {[1] = "Requires a foundation of Electrum Block"},
  2237.      ['allele2'] = "Argentum",
  2238.      ['result'] = "Electrum",
  2239.      ['chance'] = 10
  2240.     }
  2241.   breedingTable[285] = {
  2242.      ['allele1'] = "Ferrous",
  2243.      ['specialConditions'] = {[1] = "Requires a foundation of Ferrous Block"},
  2244.      ['allele2'] = "Esoteric",
  2245.      ['result'] = "Nickel",
  2246.      ['chance'] = 14
  2247.     }
  2248.   breedingTable[286] = {
  2249.      ['allele1'] = "Ferrous",
  2250.      ['specialConditions'] = {[1] = "Requires a foundation of Invar Block"},
  2251.      ['allele2'] = "Nickel",
  2252.      ['result'] = "Invar",
  2253.      ['chance'] = 14
  2254.     }
  2255.   breedingTable[287] = {
  2256.      ['allele1'] = "Nickel",
  2257.      ['specialConditions'] = {[1] = "Requires a foundation of Shiny Block"},
  2258.      ['allele2'] = "Invar",
  2259.      ['result'] = "Platinum",
  2260.      ['chance'] = 10
  2261.     }
  2262.   breedingTable[288] = {
  2263.      ['allele1'] = "Spiteful",
  2264.      ['specialConditions'] = {[1] = "Requires a foundation of Coal Ore"},
  2265.      ['allele2'] = "Stannum",
  2266.      ['result'] = "Carbon",
  2267.      ['chance'] = 12
  2268.     }
  2269.   breedingTable[289] = {
  2270.      ['allele1'] = "Spiteful",
  2271.      ['specialConditions'] = {[1] = "Requires a foundation of Redstone Ore"},
  2272.      ['allele2'] = "Industrious",
  2273.      ['result'] = "Destabilized",
  2274.      ['chance'] = 12
  2275.     }
  2276.   breedingTable[290] = {
  2277.      ['allele1'] = "Smouldering",
  2278.      ['specialConditions'] = {[1] = "Requires a foundation of Glowstone"},
  2279.      ['allele2'] = "Infernal",
  2280.      ['result'] = "Lux",
  2281.      ['chance'] = 12
  2282.     }
  2283.   breedingTable[291] = {
  2284.      ['allele1'] = "Smouldering",
  2285.      ['specialConditions'] = {},
  2286.      ['allele2'] = "Austere",
  2287.      ['result'] = "Dante",
  2288.      ['chance'] = 12
  2289.     }
  2290.   breedingTable[292] = {
  2291.      ['allele1'] = "Dante",
  2292.      ['specialConditions'] = {},
  2293.      ['allele2'] = "Carbon",
  2294.      ['result'] = "Pyro",
  2295.      ['chance'] = 8
  2296.     }
  2297.   breedingTable[293] = {
  2298.      ['allele1'] = "Skulking",
  2299.      ['specialConditions'] = {},
  2300.      ['allele2'] = "Wintry",
  2301.      ['result'] = "Blizzy",
  2302.      ['chance'] = 12
  2303.     }
  2304.   breedingTable[294] = {
  2305.      ['allele1'] = "Blizzy",
  2306.      ['specialConditions'] = {},
  2307.      ['allele2'] = "Icy",
  2308.      ['result'] = "Gelid",
  2309.      ['chance'] = 8
  2310.     }
  2311.   breedingTable[295] = {
  2312.      ['allele1'] = "Platinum",
  2313.      ['specialConditions'] = {},
  2314.      ['allele2'] = "Oblivion",
  2315.      ['result'] = "Winsome",
  2316.      ['chance'] = 12
  2317.     }
  2318.   breedingTable[296] = {
  2319.      ['allele1'] = "Winsome",
  2320.      ['specialConditions'] = {[1] = "Requires a foundation of Enderium Block"},
  2321.      ['allele2'] = "Carbon",
  2322.      ['result'] = "Endearing",
  2323.      ['chance'] = 8
  2324.     }
  2325.   breedingTable[297] = {
  2326.      ['allele1'] = "Energetic",
  2327.      ['specialConditions'] = {},
  2328.      ['allele2'] = "Silicon",
  2329.      ['result'] = "Infinity",
  2330.      ['chance'] = 2
  2331.     }
  2332.   breedingTable[298] = {
  2333.      ['allele1'] = "Excited",
  2334.      ['specialConditions'] = {},
  2335.      ['allele2'] = "Lapis",
  2336.      ['result'] = "Electrotine",
  2337.      ['chance'] = 2
  2338.     }
  2339.   breedingTable[299] = {
  2340.      ['allele1'] = "Skystone",
  2341.      ['specialConditions'] = {},
  2342.      ['allele2'] = "Ferrous",
  2343.      ['result'] = "Silicon",
  2344.      ['chance'] = 17
  2345.     }
  2346.   breedingTable[300] = {
  2347.      ['allele1'] = "Earthen",
  2348.      ['specialConditions'] = {},
  2349.      ['allele2'] = "Windy",
  2350.      ['result'] = "Skystone",
  2351.      ['chance'] = 2
  2352.     }
  2353.   return breedingTable
  2354. end
  2355.  
  2356. -- build mutation graph
  2357. function buildMutationGraph(apiary)
  2358.   local mutations = {}
  2359.   local beeNames = {}
  2360.   function addMutateTo(parent1, parent2, offspring, chance)
  2361.     beeNames[parent1] = true
  2362.     beeNames[parent2] = true
  2363.     beeNames[offspring] = true
  2364.     if mutations[parent1] ~= nil then
  2365.       if mutations[parent1].mutateTo[offspring] ~= nil then
  2366.         mutations[parent1].mutateTo[offspring][parent2] = chance
  2367.       else
  2368.         mutations[parent1].mutateTo[offspring] = {[parent2] = chance}
  2369.       end
  2370.     else
  2371.       mutations[parent1] = {
  2372.         mutateTo = {[offspring]={[parent2] = chance}}
  2373.       }
  2374.     end
  2375.   end
  2376.   for _, parents in pairs(getBeeBreedingData()) do
  2377.     fixParents(parents)
  2378.     addMutateTo(parents.allele1, parents.allele2, parents.result, parents.chance)
  2379.     addMutateTo(parents.allele2, parents.allele1, parents.result, parents.chance)
  2380.   end
  2381.   --getBeeParents = function(name)
  2382.     --return getBeeParents((nameFix[name] or name))
  2383.   --end
  2384.   return mutations, beeNames
  2385. end
  2386.  
  2387. function buildTargetSpeciesList(catalog, apiary)
  2388.   local targetSpeciesList = {}
  2389.   local parentss = getBeeBreedingData()
  2390.   for _, parents in pairs(parentss) do
  2391.     local skip = false
  2392.     for i, ignoreSpecies in ipairs(config.ignoreSpecies) do
  2393.       if parents.result == ignoreSpecies then
  2394.         skip = true
  2395.         break
  2396.       end
  2397.     end
  2398.     if not skip and
  2399.         ( -- skip if reference pair exists
  2400.           catalog.referencePrincessesBySpecies[parents.result] == nil or
  2401.           catalog.referenceDronesBySpecies[parents.result] == nil
  2402.         ) and
  2403.         ( -- princess 1 and drone 2 available
  2404.           catalog.princessesBySpecies[parents.allele1] ~= nil and
  2405.           catalog.dronesBySpecies[parents.allele2] ~= nil
  2406.         ) or
  2407.         ( -- princess 2 and drone 1 available
  2408.           catalog.princessesBySpecies[parents.allele2] ~= nil and
  2409.           catalog.dronesBySpecies[parents.allele1] ~= nil
  2410.         ) then
  2411.       table.insert(targetSpeciesList, parents.result)
  2412.     end
  2413.   end
  2414.   return targetSpeciesList
  2415. end
  2416.  
  2417. -- percent chance of 2 species turning into a target species
  2418. function mutateSpeciesChance(mutations, species1, species2, targetSpecies)
  2419.   local chance = {}
  2420.   if species1 == species2 then
  2421.     chance[species1] = 100
  2422.   else
  2423.     chance[species1] = 50
  2424.     chance[species2] = 50
  2425.   end
  2426.   if mutations[species1] ~= nil then
  2427.     for species, mutates in pairs(mutations[species1].mutateTo) do
  2428.       local mutateChance = mutates[species2]
  2429.       if mutateChance ~= nil then
  2430.         chance[species] = mutateChance
  2431.         chance[species1] = chance[species1] - mutateChance / 2
  2432.         chance[species2] = chance[species2] - mutateChance / 2
  2433.       end
  2434.     end
  2435.   end
  2436.   return chance[targetSpecies] or 0.0
  2437. end
  2438.  
  2439. -- percent chance of 2 bees turning into target species
  2440. function mutateBeeChance(mutations, princess, drone, targetSpecies)
  2441.   if princess.individual.isAnalyzed then
  2442.     if drone.individual.isAnalyzed then
  2443.       return (mutateSpeciesChance(mutations, princess.individual.active.species.name, drone.individual.active.species.name, targetSpecies) / 4
  2444.              +mutateSpeciesChance(mutations, princess.individual.inactive.species.name, drone.individual.active.species.name, targetSpecies) / 4
  2445.              +mutateSpeciesChance(mutations, princess.individual.active.species.name, drone.individual.inactive.species.name, targetSpecies) / 4
  2446.              +mutateSpeciesChance(mutations, princess.individual.inactive.species.name, drone.individual.inactive.species.name, targetSpecies) / 4)
  2447.     end
  2448.   elseif drone.individual.isAnalyzed then
  2449.   else
  2450.     return mutateSpeciesChance(princess.individual.displayName, drone.individual.displayName, targetSpecies)
  2451.   end
  2452. end
  2453.  
  2454. function buildScoring()
  2455.   function makeNumberScorer(trait, default)
  2456.     local function scorer(bee)
  2457.       if bee.individual.isAnalyzed then
  2458.         return (bee.individual.active[trait] + bee.individual.inactive[trait]) / 2
  2459.       else
  2460.         return default
  2461.       end
  2462.     end
  2463.     return scorer
  2464.   end
  2465.  
  2466.   function makeBooleanScorer(trait)
  2467.     local function scorer(bee)
  2468.       if bee.individual.isAnalyzed then
  2469.         return ((bee.individual.active[trait] and 1 or 0) + (bee.individual.inactive[trait] and 1 or 0)) / 2
  2470.       else
  2471.         return 0
  2472.       end
  2473.     end
  2474.     return scorer
  2475.   end
  2476.  
  2477.   function makeTableScorer(trait, default, lookup)
  2478.     local function scorer(bee)
  2479.       if bee.individual.isAnalyzed then
  2480.         return ((lookup[bee.individual.active[trait]] or default) + (lookup[bee.individual.inactive[trait]] or default)) / 2
  2481.       else
  2482.         return default
  2483.       end
  2484.     end
  2485.     return scorer
  2486.   end
  2487.  
  2488.   local scoresTolerance = {
  2489.     ["None"]   = 0,
  2490.     ["Up 1"]   = 1,
  2491.     ["Up 2"]   = 2,
  2492.     ["Up 3"]   = 3,
  2493.     ["Up 4"]   = 4,
  2494.     ["Up 5"]   = 5,
  2495.     ["Down 1"] = 1,
  2496.     ["Down 2"] = 2,
  2497.     ["Down 3"] = 3,
  2498.     ["Down 4"] = 4,
  2499.     ["Down 5"] = 5,
  2500.     ["Both 1"] = 2,
  2501.     ["Both 2"] = 4,
  2502.     ["Both 3"] = 6,
  2503.     ["Both 4"] = 8,
  2504.     ["Both 5"] = 10
  2505.   }
  2506.  
  2507.   local scoresFlowerProvider = {
  2508.     ["None"] = 5,
  2509.     ["Rocks"] = 4,
  2510.     ["Flowers"] = 3,
  2511.     ["Mushroom"] = 2,
  2512.     ["Cacti"] = 1,
  2513.     ["Exotic Flowers"] = 0,
  2514.     ["Jungle"] = 0
  2515.   }
  2516.  
  2517.   return {
  2518.     ["fertility"] = makeNumberScorer("fertility", 1),
  2519.     ["flowering"] = makeNumberScorer("flowering", 1),
  2520.     ["speed"] = makeNumberScorer("speed", 1),
  2521.     ["lifespan"] = makeNumberScorer("lifespan", 1),
  2522.     ["nocturnal"] = makeBooleanScorer("nocturnal"),
  2523.     ["tolerantFlyer"] = makeBooleanScorer("tolerantFlyer"),
  2524.     ["caveDwelling"] = makeBooleanScorer("caveDwelling"),
  2525.     ["effect"] = makeBooleanScorer("effect"),
  2526.     ["temperatureTolerance"] = makeTableScorer("temperatureTolerance", 0, scoresTolerance),
  2527.     ["humidityTolerance"] = makeTableScorer("humidityTolerance", 0, scoresTolerance),
  2528.     ["flowerProvider"] = makeTableScorer("flowerProvider", 0, scoresFlowerProvider),
  2529.     ["territory"] = function(bee)
  2530.       if bee.individual.isAnalyzed then
  2531.         return ((bee.individual.active.territory[1] * bee.individual.active.territory[2] * bee.individual.active.territory[3]) +
  2532.                      (bee.individual.inactive.territory[1] * bee.individual.inactive.territory[2] * bee.individual.inactive.territory[3])) / 2
  2533.       else
  2534.         return 0
  2535.       end
  2536.     end
  2537.   }
  2538. end
  2539.  
  2540. function compareBees(scorers, a, b)
  2541.   for _, trait in ipairs(traitPriority) do
  2542.     local scorer = scorers[trait]
  2543.     if scorer ~= nil then
  2544.       local aScore = scorer(a)
  2545.       local bScore = scorer(b)
  2546.       if aScore ~= bScore then
  2547.         return aScore > bScore
  2548.       end
  2549.     end
  2550.   end
  2551.   return true
  2552. end
  2553.  
  2554. function compareMates(a, b)
  2555.   for i, trait in ipairs(traitPriority) do
  2556.     if a[trait] ~= b[trait] then
  2557.       return a[trait] > b[trait]
  2558.     end
  2559.   end
  2560.   return true
  2561. end
  2562.  
  2563. function betterTraits(scorers, a, b)
  2564.   local traits = {}
  2565.   for _, trait in ipairs(traitPriority) do
  2566.     local scorer = scorers[trait]
  2567.     if scorer ~= nil then
  2568.       local aScore = scorer(a)
  2569.       local bScore = scorer(b)
  2570.       if bScore > aScore then
  2571.         table.insert(traits, trait)
  2572.       end
  2573.     end
  2574.   end
  2575.   return traits
  2576. end
  2577.  
  2578. -- cataloging functions ---------------
  2579.  
  2580. function addBySpecies(beesBySpecies, bee)
  2581.   if bee.individual.isAnalyzed then
  2582.     if beesBySpecies[bee.individual.active.species.name] == nil then
  2583.       beesBySpecies[bee.individual.active.species.name] = {bee}
  2584.     else
  2585.       table.insert(beesBySpecies[bee.individual.active.species.name], bee)
  2586.     end
  2587.     if bee.individual.inactive.species.name ~= bee.individual.active.species.name then
  2588.       if beesBySpecies[bee.individual.inactive.species.name] == nil then
  2589.         beesBySpecies[bee.individual.inactive.species.name] = {bee}
  2590.       else
  2591.         table.insert(beesBySpecies[bee.individual.inactive.species.name], bee)
  2592.       end
  2593.     end
  2594.   else
  2595.     if beesBySpecies[bee.individual.displayName] == nil then
  2596.       beesBySpecies[bee.individual.displayName] = {bee}
  2597.     else
  2598.       table.insert(beesBySpecies[bee.individual.displayName], bee)
  2599.     end
  2600.   end
  2601. end
  2602.  
  2603. function catalogBees(inv, scorers)
  2604.   catalog = {}
  2605.   catalog.princesses = {}
  2606.   catalog.princessesBySpecies = {}
  2607.   catalog.drones = {}
  2608.   catalog.dronesBySpecies = {}
  2609.   catalog.queens = {}
  2610.   catalog.referenceDronesBySpecies = {}
  2611.   catalog.referencePrincessesBySpecies = {}
  2612.   catalog.referencePairBySpecies = {}
  2613.  
  2614.   -- phase 0 -- analyze bees and ditch product
  2615.   inv.condenseItems()
  2616.   logLine(string.format("scanning %d slots", inv.size))
  2617.   if useAnalyzer == true then
  2618.     local analyzeCount = 0
  2619.     local bees = getAllBees(inv)
  2620.     for slot, bee in pairs(bees) do
  2621.       if bee.individual == nil then
  2622.         inv.pushItem(config.chestDir, slot)
  2623.       elseif not bee.individual.isAnalyzed then
  2624.         analyzeBee(inv, slot)
  2625.         analyzeCount = analyzeCount + 1
  2626.       end
  2627.     end
  2628.     logLine(string.format("analyzed %d new bees", analyzeCount))
  2629.   end
  2630.   -- phase 1 -- mark reference bees
  2631.   inv.condenseItems()
  2632.   local referenceBeeCount = 0
  2633.   local referenceDroneCount = 0
  2634.   local referencePrincessCount = 0
  2635.   local isDrone = nil
  2636.   local bees = getAllBees(inv)
  2637.   if useReferenceBees then
  2638.     for slot = 1, #bees do
  2639.       local bee = bees[slot]
  2640.       if bee.individual ~= nil then
  2641.         fixBee(bee)
  2642.         local referenceBySpecies = nil
  2643.         if bee.raw_name == "item.for.beedronege" then -- drones
  2644.           isDrone = true
  2645.           referenceBySpecies = catalog.referenceDronesBySpecies
  2646.         elseif bee.raw_name == "item.for.beeprincessge" then -- princess
  2647.           isDrone = false
  2648.           referenceBySpecies = catalog.referencePrincessesBySpecies
  2649.         else
  2650.           isDrone = nil
  2651.         end
  2652.         if referenceBySpecies ~= nil and bee.individual.isAnalyzed and bee.individual.active.species.name == bee.individual.inactive.species.name then
  2653.           local species = bee.individual.active.species.name
  2654.           if referenceBySpecies[species] == nil or
  2655.               compareBees(scorers, bee, referenceBySpecies[species]) then
  2656.             if referenceBySpecies[species] == nil then
  2657.               referenceBeeCount = referenceBeeCount + 1
  2658.               if isDrone == true then
  2659.                 referenceDroneCount = referenceDroneCount + 1
  2660.               elseif isDrone == false then
  2661.                 referencePrincessCount = referencePrincessCount + 1
  2662.               end
  2663.               if slot ~= referenceBeeCount then
  2664.                 inv.swapStacks(slot, referenceBeeCount)
  2665.               end
  2666.               bee.slot = referenceBeeCount
  2667.             else
  2668.               inv.swapStacks(slot, referenceBySpecies[species].slot)
  2669.               bee.slot = referenceBySpecies[species].slot
  2670.             end
  2671.             referenceBySpecies[species] = bee
  2672.             if catalog.referencePrincessesBySpecies[species] ~= nil and catalog.referenceDronesBySpecies[species] ~= nil then
  2673.               catalog.referencePairBySpecies[species] = true
  2674.             end
  2675.           end
  2676.         end
  2677.       end
  2678.     end
  2679.     logLine(string.format("found %d reference bees, %d princesses, %d drones", referenceBeeCount, referencePrincessCount, referenceDroneCount))
  2680.     log("reference pairs")
  2681.     for species, _ in pairs(catalog.referencePairBySpecies) do
  2682.       log(", ")
  2683.       log(species)
  2684.     end
  2685.     logLine()
  2686.   end
  2687.   -- phase 2 -- ditch obsolete drones
  2688.   bees = getAllBees(inv)
  2689.   local extraDronesBySpecies = {}
  2690.   local ditchSlot = 1
  2691.   for slot = 1 + referenceBeeCount, #bees do
  2692.     local bee = bees[slot]
  2693.     fixBee(bee)
  2694.     bee.slot = slot
  2695.     -- remove analyzed drones where both the active and inactive species have
  2696.     --   a both reference princess and drone
  2697.     if (
  2698.       bee.raw_name == "item.for.beedronege" and
  2699.       bee.individual.isAnalyzed and (
  2700.         catalog.referencePrincessesBySpecies[bee.individual.active.species.name] ~= nil and
  2701.         catalog.referenceDronesBySpecies[bee.individual.active.species.name] ~= nil and
  2702.         catalog.referencePrincessesBySpecies[bee.individual.inactive.species.name] ~= nil and
  2703.         catalog.referenceDronesBySpecies[bee.individual.inactive.species.name] ~= nil
  2704.       )
  2705.     ) then
  2706.       local activeDroneTraits = betterTraits(scorers, catalog.referenceDronesBySpecies[bee.individual.active.species.name], bee)
  2707.       local inactiveDroneTraits = betterTraits(scorers, catalog.referenceDronesBySpecies[bee.individual.inactive.species.name], bee)
  2708.       if #activeDroneTraits > 0 or #inactiveDroneTraits > 0 then
  2709.         -- keep current bee because it has some trait that is better
  2710.         -- manipulate reference bee to have better yet less important attribute
  2711.         -- this ditches more bees while keeping at least one with the attribute
  2712.         -- the cataloging step will fix the manipulation
  2713.         for i, trait in ipairs(activeDroneTraits) do
  2714.           catalog.referenceDronesBySpecies[bee.individual.active.species.name].individual.active[trait] = bee.individual.active[trait]
  2715.           catalog.referenceDronesBySpecies[bee.individual.active.species.name].individual.inactive[trait] = bee.individual.inactive[trait]
  2716.         end
  2717.         for i, trait in ipairs(inactiveDroneTraits) do
  2718.           catalog.referenceDronesBySpecies[bee.individual.inactive.species.name].individual.active[trait] = bee.individual.active[trait]
  2719.           catalog.referenceDronesBySpecies[bee.individual.inactive.species.name].individual.inactive[trait] = bee.individual.inactive[trait]
  2720.         end
  2721.       else
  2722.         -- keep 1 extra drone around if purebreed
  2723.         -- this speeds up breeding by not ditching drones you just breed from reference bees
  2724.         -- when the reference bee drone output is still mutating
  2725.         local ditchDrone = nil
  2726.         if bee.individual.active.species.name == bee.individual.inactive.species.name then
  2727.           if extraDronesBySpecies[bee.individual.active.species.name] == nil then
  2728.             extraDronesBySpecies[bee.individual.active.species.name] = bee
  2729.             bee = nil
  2730.           elseif compareBees(bee, extraDronesBySpecies[bee.individual.active.species.name]) then
  2731.             ditchDrone = extraDronesBySpecies[bee.individual.active.species.name]
  2732.             extraDronesBySpecies[bee.individual.active.species.name] = bee
  2733.             bee = ditchDrone
  2734.           end
  2735.         end
  2736.         -- ditch drone
  2737.         if bee ~= nil then
  2738.           if inv.pushItem(config.chestDir, bee.slot) == 0 then
  2739.             error("ditch chest is full")
  2740.           end
  2741.         end
  2742.       end
  2743.     end
  2744.   end
  2745.   -- phase 3 -- catalog bees
  2746.   bees = getAllBees(inv)
  2747.   for slot, bee in pairs(bees) do
  2748.     fixBee(bee)
  2749.     bee.slot = slot
  2750.     if slot > referenceBeeCount then
  2751.       if bee.raw_name == "item.for.beedronege" then -- drones
  2752.         table.insert(catalog.drones, bee)
  2753.         addBySpecies(catalog.dronesBySpecies, bee)
  2754.       elseif bee.raw_name == "item.for.beeprincessge" then -- princess
  2755.         table.insert(catalog.princesses, bee)
  2756.         addBySpecies(catalog.princessesBySpecies, bee)
  2757.       elseif bee.id == 13339 then -- queens
  2758.         table.insert(catalog.queens, bee)
  2759.       end
  2760.     else
  2761.       if bee.raw_name == "item.for.beedronege" and bee.qty > 1 then
  2762.         table.insert(catalog.drones, bee)
  2763.         addBySpecies(catalog.dronesBySpecies, bee)
  2764.       end
  2765.     end
  2766.   end
  2767.   logLine(string.format("found %d queens, %d princesses, %d drones",
  2768.       #catalog.queens, #catalog.princesses, #catalog.drones))
  2769.   return catalog
  2770. end
  2771.  
  2772. -- interaction functions --------------
  2773.  
  2774. function clearApiary(inv, apiary)
  2775.   local bees = getAllBees(apiary)
  2776.   -- wait for queen to die
  2777.   if (bees[1] ~= nil and bees[1].raw_name == "item.for.beequeenge")
  2778.       or (bees[1] ~= nil and bees[2] ~= nil) then
  2779.     log("waiting for apiary")
  2780.     while true do
  2781.       sleep(5)
  2782.       bees = getAllBees(apiary)
  2783.       if bees[1] == nil then
  2784.         break
  2785.       end
  2786.       log(".")
  2787.     end
  2788.   end
  2789.   logLine()
  2790.   for slot = 3, 9 do
  2791.     local bee = bees[slot]
  2792.     if bee ~= nil then
  2793.       if bee.raw_name == "item.for.beedronege" or bee.raw_name == "item.for.beeprincessge" then
  2794.         apiary.pushItem(config.chestDir, slot, 64)
  2795.       else
  2796.         apiary.pushItem(config.productDir, slot, 64)
  2797.       end
  2798.     end
  2799.   end
  2800. end
  2801.  
  2802. function clearAnalyzer(inv)
  2803.   if not useAnalyzer then
  2804.     return
  2805.   end
  2806.   local bees = getAllBees(inv)
  2807.   if #bees == inv.size then
  2808.     error("chest is full")
  2809.   end
  2810.   for analyzerSlot = 9, 12 do
  2811.     if inv.pullItem(config.analyzerDir, analyzerSlot) == 0 then
  2812.       break
  2813.     end
  2814.   end
  2815. end
  2816.  
  2817. function analyzeBee(inv, slot)
  2818.   clearAnalyzer(inv)
  2819.   log("analyzing bee ")
  2820.   log(slot)
  2821.   log("...")
  2822.   local freeSlot
  2823.   if inv.pushItem(config.analyzerDir, slot, 64, 3) > 0 then
  2824.     while true do
  2825.       -- constantly check in case of inventory manipulation by player
  2826.       local bees = getAllBees(inv)
  2827.       freeSlot = nil
  2828.       for i = 1, inv.size do
  2829.         if bees[i] == nil then
  2830.           freeSlot = i
  2831.           break
  2832.         end
  2833.       end
  2834.       if inv.pullItem(config.analyzerDir, 9) > 0 then
  2835.         break
  2836.       end
  2837.       sleep(1)
  2838.     end
  2839.   else
  2840.     logLine("Missing Analyzer")
  2841.     useAnalyzer = false
  2842.     return nil
  2843.   end
  2844.   local bee = getBeeInSlot(inv, freeSlot)
  2845.   if bee ~= nil then
  2846.     printBee(fixBee(bee))
  2847.   end
  2848.   return freeSlot
  2849. end
  2850.  
  2851. function log_r ( t )  
  2852.     local print_r_cache={}
  2853.     local function sub_print_r(t,indent)
  2854.         if (print_r_cache[tostring(t)]) then
  2855.             logLine(indent.."*"..tostring(t))
  2856.         else
  2857.             print_r_cache[tostring(t)]=true
  2858.             if (type(t)=="table") then
  2859.                 for pos,val in pairs(t) do
  2860.                     if (type(val)=="table") then
  2861.                         logLine(indent.."["..pos.."] => "..tostring(t).." {")
  2862.                         sub_print_r(val,indent..string.rep(" ",string.len(pos)+8))
  2863.                         logLine(indent..string.rep(" ",string.len(pos)+6).."}")
  2864.                     elseif (type(val)=="string") then
  2865.                         logLine(indent.."["..pos..'] => "'..val..'"')
  2866.                     else
  2867.                         logLine(indent.."["..pos.."] => "..tostring(val))
  2868.                     end
  2869.                 end
  2870.             else
  2871.                 logLine(indent..tostring(t))
  2872.             end
  2873.         end
  2874.     end
  2875.     if (type(t)=="table") then
  2876.         logLine(tostring(t).." {")
  2877.         sub_print_r(t,"  ")
  2878.         logLine("}")
  2879.     else
  2880.         sub_print_r(t,"  ")
  2881.     end
  2882.     logLine()
  2883. end
  2884.  
  2885. function breedBees(inv, apiary, princess, drone)
  2886.   log("Breeding bees")
  2887.   clearApiary(inv, apiary)
  2888.   apiary.pullItem(config.chestDir, princess.slot, 1, 1)
  2889.   apiary.pullItem(config.chestDir, drone.slot, 1, 2)
  2890.   clearApiary(inv, apiary)
  2891. end
  2892.  
  2893. function breedQueen(inv, apiary, queen)
  2894.   log("Breeding queen")
  2895.   clearApiary(inv, apiary)
  2896.   apiary.pullItem(config.chestDir, queen.slot, 1, 1)
  2897.   clearApiary(inv, apiary)
  2898. end
  2899.  
  2900. -- selects best pair for target species
  2901. --   or initiates breeding of lower species
  2902.  
  2903. function getBeeParents(targetSpecies)
  2904.   for _, bee in pairs(getBeeBreedingData()) do
  2905.     if bee.result == targetSpecies then
  2906.       return bee
  2907.     end
  2908.   end
  2909.   logLine("Bee parents not found.")
  2910.     return {}
  2911. end
  2912.  
  2913.  
  2914. function selectPair(mutations, scorers, catalog, targetSpecies)
  2915.   logLine("targetting "..targetSpecies)
  2916.   local baseChance = 0
  2917.   if #getBeeParents(targetSpecies) > 0 then
  2918.     local parents = getBeeParents(targetSpecies)[1]
  2919.     baseChance = parents.chance
  2920.     for _, s in ipairs(parents.specialConditions) do
  2921.       logLine("    ", s)
  2922.     end
  2923.   end
  2924.   local mateCombos = choose(catalog.princesses, catalog.drones)
  2925.   local mates = {}
  2926.   local haveReference = (catalog.referencePrincessesBySpecies[targetSpecies] ~= nil and
  2927.       catalog.referenceDronesBySpecies[targetSpecies] ~= nil)
  2928.   for i, v in ipairs(mateCombos) do
  2929.     local chance = mutateBeeChance(mutations, v[1], v[2], targetSpecies) or 0
  2930.     if (not haveReference and chance >= baseChance / 2) or
  2931.         (haveReference and chance > 25) then
  2932.       local newMates = {
  2933.         ["princess"] = v[1],
  2934.         ["drone"] = v[2],
  2935.         ["speciesChance"] = chance
  2936.       }
  2937.       for trait, scorer in pairs(scorers) do
  2938.         newMates[trait] = (scorer(v[1]) + scorer(v[2])) / 2
  2939.       end
  2940.       table.insert(mates, newMates)
  2941.     end
  2942.   end
  2943.   if #mates > 0 then
  2944.     table.sort(mates, compareMates)
  2945.     for i = math.min(#mates, 10), 1, -1 do
  2946.       local parents = mates[i]
  2947.       logLine(beeName(parents.princess), " ", beeName(parents.drone), " ", parents.speciesChance, " ", parents.fertility, " ",
  2948.             parents.flowering, " ", parents.nocturnal, " ", parents.tolerantFlyer, " ", parents.caveDwelling, " ",
  2949.             parents.lifespan, " ", parents.temperatureTolerance, " ", parents.humidityTolerance)
  2950.     end
  2951.     return mates[1]
  2952.   else
  2953.     -- check for reference bees and breed if drone count is 1
  2954.     if catalog.referencePrincessesBySpecies[targetSpecies] ~= nil and
  2955.         catalog.referenceDronesBySpecies[targetSpecies] ~= nil then
  2956.       logLine("Breeding extra drone from reference bees")
  2957.       return {
  2958.         ["princess"] = catalog.referencePrincessesBySpecies[targetSpecies],
  2959.         ["drone"] = catalog.referenceDronesBySpecies[targetSpecies]
  2960.       }
  2961.     end
  2962.     -- attempt lower tier bee
  2963.     local parentss = getBeeParents(targetSpecies)
  2964.     if #parentss > 0 then
  2965.       logLine("lower tier")
  2966.       --print(textutils.serialize(catalog.referencePrincessesBySpecies))
  2967.       table.sort(parentss, function(a, b) return a.chance > b.chance end)
  2968.       local trySpecies = {}
  2969.       for i, parents in ipairs(parentss) do
  2970.         fixParents(parents)
  2971.         if (catalog.referencePairBySpecies[parents.allele2] == nil        -- no reference bee pair
  2972.             or catalog.referenceDronesBySpecies[parents.allele2].qty <= 1 -- no extra reference drone
  2973.             or catalog.princessesBySpecies[parents.allele2] == nil)       -- no converted princess
  2974.             and trySpecies[parents.allele2] == nil then
  2975.           table.insert(trySpecies, parents.allele2)
  2976.           trySpecies[parents.allele2] = true
  2977.         end
  2978.         if (catalog.referencePairBySpecies[parents.allele1] == nil
  2979.             or catalog.referenceDronesBySpecies[parents.allele1].qty <= 1
  2980.             or catalog.princessesBySpecies[parents.allele1] == nil)
  2981.             and trySpecies[parents.allele1] == nil then
  2982.           table.insert(trySpecies, parents.allele1)
  2983.           trySpecies[parents.allele1] = true
  2984.         end
  2985.       end
  2986.       for _, species in ipairs(trySpecies) do
  2987.         local mates = selectPair(mutations, scorers, catalog, species)
  2988.         if mates ~= nil then
  2989.           return mates
  2990.         end
  2991.       end
  2992.     end
  2993.         logLine("No mates found, trying again...")
  2994.     return nil
  2995.   end
  2996. end
  2997.  
  2998. function isPureBred(bee1, bee2, targetSpecies)
  2999.   logLine("Bee 1 is Species: "..bee1.individual.active.species.name)
  3000.   logLine("Bee 2 is Species: "..bee2.individual.active.species.name)
  3001.   logLine("Bee 1 is Sub-Species: "..bee1.individual.inactive.species.name)
  3002.   logLine("Bee 2 is Sub-Species: "..bee2.individual.inactive.species.name)
  3003.   logLine("Target Species: "..targetSpecies)
  3004.   if bee1.individual.isAnalyzed and bee2.individual.isAnalyzed then
  3005.     if bee1.individual.active.species.name == bee1.individual.inactive.species.name and
  3006.         bee2.individual.active.species.name == bee2.individual.inactive.species.name and
  3007.         bee1.individual.active.species.name == bee2.individual.active.species.name and
  3008.         (targetSpecies == nil or bee1.individual.active.species.name == targetSpecies) then
  3009.       return true
  3010.     end
  3011.   elseif bee1.individual.isAnalyzed == false and bee2.individual.isAnalyzed == false then
  3012.     if bee1.individual.displayName == bee2.individual.displayName then
  3013.       return true
  3014.     end
  3015.   end
  3016.   return false
  3017. end
  3018.  
  3019. function breedTargetSpecies(mutations, inv, apiary, scorers, targetSpecies)
  3020.   local catalog = catalogBees(inv, scorers)
  3021.   while true do
  3022.     if #catalog.princesses == 0 then
  3023.       log("Please add more princesses and press [Enter]")
  3024.       io.read("*l")
  3025.       catalog = catalogBees(inv, scorers)
  3026.     elseif #catalog.drones == 0 and next(catalog.referenceDronesBySpecies) == nil then
  3027.       log("Please add more drones and press [Enter]")
  3028.       io.read("*l")
  3029.       catalog = catalogBees(inv, scorers)
  3030.     else
  3031.       local mates = selectPair(mutations, scorers, catalog, targetSpecies)
  3032.       if mates ~= nil then
  3033.         if isPureBred(mates.princess, mates.drone, targetSpecies) then
  3034.           break
  3035.         else
  3036.           breedBees(inv, apiary, mates.princess, mates.drone)
  3037.           catalog = catalogBees(inv, scorers)
  3038.         end
  3039.       else
  3040.         log(string.format("Please add more bee species for %s and press [Enter]"), targetSpecies)
  3041.         io.read("*l")
  3042.         catalog = catalogBees(inv, scorers)
  3043.       end
  3044.     end
  3045.   end
  3046.   logLine("Bees are purebred")
  3047. end
  3048.  
  3049. function breedAllSpecies(mutations, inv, apiary, scorers, speciesList)
  3050.   if #speciesList == 0 then
  3051.     log("Please add more bee species and press [Enter]")
  3052.     io.read("*l")
  3053.   else
  3054.     for i, targetSpecies in ipairs(speciesList) do
  3055.       breedTargetSpecies(mutations, inv, apiary, scorers, targetSpecies)
  3056.     end
  3057.   end
  3058. end
  3059.  
  3060. function main(tArgs)
  3061.   logLine(string.format("openbee version %d.%d.%d", version.major, version.minor, version.patch))
  3062.   local targetSpecies = setPriorities(tArgs)
  3063.   log("priority:")
  3064.   for _, priority in ipairs(traitPriority) do
  3065.     log(" "..priority)
  3066.   end
  3067.   logLine("")
  3068.   local inv, apiary = getPeripherals()
  3069.   inv.size = inv.getInventorySize()
  3070.   local mutations, beeNames = buildMutationGraph(apiary)
  3071.   local scorers = buildScoring()
  3072.   clearApiary(inv, apiary)
  3073.   clearAnalyzer(inv)
  3074.   local catalog = catalogBees(inv, scorers)
  3075.   while #catalog.queens > 0 do
  3076.     breedQueen(inv, apiary, catalog.queens[1])
  3077.     catalog = catalogBees(inv, scorers)
  3078.   end
  3079.   if targetSpecies ~= nil then
  3080.     targetSpecies = tArgs[1]:sub(1,1):upper()..tArgs[1]:sub(2):lower()
  3081.     log_r(beeNames)
  3082.     if beeNames[targetSpecies] == true then
  3083.       breedTargetSpecies(mutations, inv, apiary, scorers, targetSpecies)
  3084.     else
  3085.       logLine(string.format("Species '%s' not found.", targetSpecies))
  3086.     end
  3087.   else
  3088.     while true do
  3089.       breedAllSpecies(mutations, inv, apiary, scorers, buildTargetSpeciesList(catalog, apiary))
  3090.       catalog = catalogBees(inv, scorers)
  3091.     end
  3092.   end
  3093. end
  3094.  
  3095. local logFileName = setupLog()
  3096. local status, err = pcall(main, {...})
  3097. if not status then
  3098.   logLine(err)
  3099. end
  3100. if createLog then
  3101.     print("Log file is "..logFileName)
  3102. end
Add Comment
Please, Sign In to add comment