z_mirror/Krastorio2

git clone https://git.raiguard.me/z_mirror/Krastorio2

Caleb HeuerImplement resource restrictions system (#683)a78c1675

k2so-fixes
463 B11 linesraw
1-- Unlock rare metal technologies if the player has already mined rare metals.
2for _, force in pairs(game.forces) do
3  for _, surface in pairs(game.surfaces) do
4    local item_stats = force.get_item_production_statistics(surface)
5    if item_stats.get_output_count("kr-rare-metal-ore") > 0 then
6      force.technologies["kr-rare-metal-mining"].researched = true
7      force.technologies["kr-rare-metal-processing"].researched = true
8      break
9    end
10  end
11end