changes
This commit is contained in:
@@ -71,20 +71,12 @@ function shuffle(t)
|
||||
return s
|
||||
end
|
||||
|
||||
NilIsZero={
|
||||
__index=function(t,k)
|
||||
return 0
|
||||
end,
|
||||
__newindex=function(t,k,v)
|
||||
if v~=nil and v~=0 then rawset(t,k,v) end
|
||||
end }
|
||||
|
||||
function MakeMap()
|
||||
local rad=6
|
||||
for x=-rad,rad do for y=-rad,rad do if math.random(1,5)==1 then
|
||||
t={class='army',x=x,y=y,z=0,plane='main',graphic='army'}
|
||||
print("Building an army:")
|
||||
pprint(t)
|
||||
-- pprint(t)
|
||||
local nt=tangible.build(t)
|
||||
nt.Count={}
|
||||
setmetatable(nt.Count,NilIsZero)
|
||||
@@ -93,7 +85,7 @@ function MakeMap()
|
||||
nt.Count[type]=nt.Count[type]+math.random(1,3)
|
||||
end end
|
||||
print("Here's what was built:")
|
||||
pprint(nt)
|
||||
-- pprint(nt)
|
||||
end end end
|
||||
end
|
||||
|
||||
@@ -241,7 +233,7 @@ function player.cb_map(actor,place,dialog)
|
||||
end end
|
||||
end
|
||||
end
|
||||
pprint(scratch)
|
||||
-- pprint(scratch)
|
||||
for dy=-rad,rad do for line=0,1 do
|
||||
local lbuf=""
|
||||
for dx=-rad,rad do
|
||||
@@ -258,11 +250,11 @@ function player.cb_map(actor,place,dialog)
|
||||
for dx=-rad,rad do lbuf=lbuf.."----" end
|
||||
lbuf=lbuf.."-"
|
||||
print(lbuf)
|
||||
print("In Player "..tangible.id(actor)..":")
|
||||
-- print("In Player "..tangible.id(actor)..":")
|
||||
for k,v in pairs(actor.Count) do print(" "..k.." "..v) end
|
||||
local lis=tangible.near(actor,0,true,true)
|
||||
for k,v in pairs(lis) do
|
||||
print("In Army "..tangible.id(v)..":")
|
||||
-- print("In Army "..tangible.id(v)..":")
|
||||
for k2,v2 in pairs(v.Count) do print(" "..k2.." "..v2) end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user