forked from github/server
fewer units for new players, two players per region
This commit is contained in:
parent
7cf1062650
commit
b7b20bdec6
|
@ -30,38 +30,8 @@ local function seed(r, email, race, lang)
|
|||
for it, num in pairs(items) do
|
||||
u:add_item(it, num)
|
||||
end
|
||||
u = nil
|
||||
skills ={
|
||||
"crossbow",
|
||||
"bow",
|
||||
"building",
|
||||
"trade",
|
||||
"forestry",
|
||||
"catapult",
|
||||
"herbalism",
|
||||
"training",
|
||||
"riding",
|
||||
"armorer",
|
||||
"shipcraft",
|
||||
"melee",
|
||||
"sailing",
|
||||
"polearm",
|
||||
"espionage",
|
||||
"roadwork",
|
||||
"tactics",
|
||||
"stealth",
|
||||
"weaponsmithing",
|
||||
"cartmaking",
|
||||
"taxation",
|
||||
"stamina"
|
||||
}
|
||||
unit.create(f, r, 50):set_skill("entertainment", 15)
|
||||
unit.create(f, r, 5):set_skill("mining", 30)
|
||||
unit.create(f, r, 5):set_skill("quarrying", 30)
|
||||
for _, sk in ipairs(skills) do
|
||||
u = u or unit.create(f, r, 5)
|
||||
if u:set_skill(sk, 15)>0 then u=nil end
|
||||
end
|
||||
return f
|
||||
end
|
||||
|
||||
|
@ -94,11 +64,16 @@ end
|
|||
math.randomseed(os.time())
|
||||
|
||||
local newbs = {}
|
||||
local per_region = 2
|
||||
local num_seeded = 2
|
||||
local start = nil
|
||||
for _, p in ipairs(players) do
|
||||
local index = math.random(#sel)
|
||||
local start = nil
|
||||
while not start or start.units() do
|
||||
start = sel[index]
|
||||
if num_seeded == per_region then
|
||||
while not start or start.units() do
|
||||
local index = math.random(#sel)
|
||||
start = sel[index]
|
||||
end
|
||||
num_seeded = 0
|
||||
end
|
||||
local dupe = false
|
||||
for f in factions() do
|
||||
|
@ -109,6 +84,7 @@ for _, p in ipairs(players) do
|
|||
end
|
||||
end
|
||||
if not dupe then
|
||||
num_seeded = num_seeded + 1
|
||||
f = seed(start, p.email, p.race or "human", p.lang or "de")
|
||||
print("new faction ".. tostring(f) .. " starts in ".. tostring(start))
|
||||
table.insert(newbs, f)
|
||||
|
|
Loading…
Reference in New Issue