forked from github/server
fewer units for new players, two players per region
This commit is contained in:
parent
4e67c4ac3f
commit
6672251b2d
|
@ -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,12 +64,17 @@ 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
|
||||
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
|
||||
if f.email==p.email then
|
||||
|
@ -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