nations
musicmud-2.1.6/data/verbs/nations · 1.2 KB
From the archive musicmud2.1.6.tar.gz
Download the archive « Back to the archive contents
--lua
local nations = function(block)
local n = {}
for i, v in children("nations_zone") do
if (block or not getstr(v, "blockname") and getobj(v, "treatas")==block) or v==block then
n[i] = v
end
end
local m = {}
for i, v in n do
m[getn(n)-i] = v
end
return m
end
local any = nil
local doblock = function(block)
local bname = nil
if %any then
bname = "Neutral"
end
if block then
bname = getstr(block, "blockname")
end
if bname then
send(pl, format("%s : \n\n", bname))
end
for i, v in %nations(block) do
if getobj(v, "start")==owner(v) then
local notes = ""
if getintd(v, "playable", 1)==0 then
notes = " ^r[not playable]^n"
end
if getstr(v, "shortcountry") then
send(pl, format("%-20s %s (%s)%s", getstr(v, "name"), getstr(v, "country"),
getstr(v, "shortcountry"), notes))
else
send(pl, format("%-20s %s%s", getstr(v, "name"), getstr(v, "country"), notes))
end
end
end
send(pl, "\n")
end
startpager(pl)
send(pl, "@@=Defined Nations")
send(pl, "");
for i,v in children("nations_zone") do
if getobj(v, "treatas")==nil and getstr(v, "blockname") then
doblock(v)
any = 1
end
end
doblock(nil)
send(pl, "@@=")
endpager(pl)