in production.lua
Code: Select all
function StarProperty.cant_build_more_planets(star)
local a,b=StarOrbitRange![star.type]()
for i=a,b
if not star.planets[i]
return false
end
if (star.planets[i].type=='Gas Giant' or star.planets[i].size=='Tiny' or star.planets[i].size=='Small') and (not star.planets[i].empire) --jem
return false
end
end
return true
end
function StarProperty.num_planet_build_sites(star)
local a,b=StarOrbitRange![star.type]()
local rval=0
for i=a,b
if not star.planets[i]
rval+=1
function complete_build_planet_project(planet,report)
clear_current_project(planet)
local push, candidate_slots = pusher {}
local star in planet
local a,b=StarOrbitRange![star.type]()
for i=a,b
if (not star.planets[i]) or (
(star.planets[i].type=='Gas Giant' or star.planets[i].size=='Tiny' or star.planets[i].size=='Small') and (not star.planets[i].empire) ) --jem
push | i
end
end
--print(v2s | star.planets)
if not next | candidate_slots
report.unable_to_complete='No Build Sites'
return
end
local orbit = candidate_slots[ dice_roll(#candidate_slots) ]
local old_planet = star.planets[orbit]
local size='Medium'
if old_planet and star.planets[orbit].type=='Gas Giant' --jem