forked from github/server
require at least 2K peasants in starting regions
This commit is contained in:
parent
cb85eb4b9f
commit
452614307d
1 changed files with 9 additions and 5 deletions
|
@ -3,6 +3,8 @@ local autoseed = {}
|
||||||
-- minimum required resources in the 7-hex neighborhood:
|
-- minimum required resources in the 7-hex neighborhood:
|
||||||
local peasants = 10000
|
local peasants = 10000
|
||||||
local trees = 800
|
local trees = 800
|
||||||
|
-- minimum resources in the region itself:
|
||||||
|
local min_peasants = 2000
|
||||||
-- number of starters per region:
|
-- number of starters per region:
|
||||||
local per_region = 2
|
local per_region = 2
|
||||||
|
|
||||||
|
@ -23,6 +25,7 @@ local function select_regions(regions, peasants, trees)
|
||||||
local sel = {}
|
local sel = {}
|
||||||
for r in regions do
|
for r in regions do
|
||||||
if not r.plane and r.terrain~="ocean" and not r.units() then
|
if not r.plane and r.terrain~="ocean" and not r.units() then
|
||||||
|
if r:get_resource("peasant") >= min_peasants then
|
||||||
sp = score(r, "peasant")
|
sp = score(r, "peasant")
|
||||||
st = score(r, "tree")
|
st = score(r, "tree")
|
||||||
if sp >= peasants then
|
if sp >= peasants then
|
||||||
|
@ -32,6 +35,7 @@ local function select_regions(regions, peasants, trees)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
return sel
|
return sel
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue