forked from github/server
03b2543d30
thought they would be and can be reused. Added HSE4 rules files. Added sorting by Race to the mapper's newfaction list, which might be a bad idea for automated seeding.
26 lines
605 B
Lua
26 lines
605 B
Lua
function write_grails(file)
|
|
grails = {}
|
|
for f in factions() do
|
|
for u in f.units do
|
|
if u:get_item("grail") > 0 then
|
|
if grails[f.id] == nil then
|
|
grails[f.id] = u:get_item("grail")
|
|
else
|
|
grails[f.id] = grails[f.id] + u:get_item("grail")
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
file:write("Parteien mit mehr oder weniger als einem Gral:\n")
|
|
|
|
for k in factions() do
|
|
v = 0
|
|
if grails[k.id] ~= nil then
|
|
v = grails[k.id]
|
|
end
|
|
if v~= 1 then
|
|
file:write("- " .. v .. " Grale: " .. k.name .. " (" .. itoa36(k.id) .. ")\n")
|
|
end
|
|
end
|
|
end
|