changes
This commit is contained in:
@@ -29,13 +29,14 @@ function player.interface(actor, place)
|
||||
gui.menu_item("cb_dropscissor" ,"Drop Scissor")
|
||||
end
|
||||
|
||||
|
||||
function player:cb_conjurerock() self.Count['r']=self.Count['r']+1 end
|
||||
function player:cb_conjurepaper() self.Count['p']=self.Count['p']+1 end
|
||||
function player:cb_conjurescissor() self.Count['s']=self.Count['s']+1 end
|
||||
|
||||
function army.interface(actor,place)
|
||||
if place.owner==actor then gui_menu_item("cb_recruit","Recruit");
|
||||
else gui.menu_item("cb_capture","Capture");
|
||||
else gui.menu_item("cb_fight" ,"Fight");
|
||||
end end
|
||||
|
||||
-- Rock dulls Scissors 3
|
||||
@@ -52,9 +53,9 @@ armytypes={'r','p','s'}
|
||||
armynames={r="Rock Golem",p="Paper Dragon",s="Scissor Beast",l="Fire Lizzard",v="Mr. Spock"}
|
||||
--advantage={ r={ r=1, p=1/2, s=3, l=2, v=1/3 },
|
||||
-- p={ r=2, p=1, s=1/2, l=1/3, v=3 },
|
||||
-- s={ r=1/3, p=2, s=1, l=3, v=1/2 },
|
||||
-- l={ r=1/2, p=3, s=1/3, l=1, v=2 },
|
||||
-- v={ r=3, p=1/3, s=2, l=1/2, v=1 } }
|
||||
-- s={ r=1/3, p=2, s=1, l=3, v=1/2 },
|
||||
-- l={ r=1/2, p=3, s=1/3, l=1, v=2 },
|
||||
-- v={ r=3, p=1/3, s=2, l=1/2, v=1 } }
|
||||
advantage={ r={ r=1, p=1/2, s=2 },
|
||||
p={ r=2, p=1, s=1/2 },
|
||||
s={ r=1/2, p=2, s=1 } }
|
||||
@@ -84,20 +85,24 @@ function army.fight0(ak,ac,dk,dc) -- returns number of attacker casualties, defe
|
||||
|
||||
function army.cb_fight(actor,place,dialog)
|
||||
for ak,ac in pairs(actor.Count) do -- Should randomize the order
|
||||
local enemy
|
||||
local enemyk, enemyc
|
||||
local acas
|
||||
local maxcas=-1
|
||||
local Loss0,Loss1
|
||||
local whichdk, whichdc
|
||||
for dk,dc in pairs(place.Count) do
|
||||
local rem0,rem1=army.fight0(ak,ac,dk,dc)
|
||||
local Loss0=ac-rem0
|
||||
local Loss1=dk-rem1
|
||||
Loss0=ac-rem0
|
||||
Loss1=dc-rem1
|
||||
print("When "..ac.." "..ak.." fight "..dc.." "..dk.." they kill "..Loss1.." and suffer "..Loss0)
|
||||
if Loss1>maxcas then
|
||||
enemy=dk
|
||||
enemyk=dk
|
||||
enemyc=dc
|
||||
maxcas=Loss1
|
||||
acas=Loss1
|
||||
end end
|
||||
if enemy then
|
||||
print("Army "..ak.." kills "..maxcas.." "..dk.." and suffers "..Loss0)
|
||||
if enemyk then
|
||||
print("Army of "..ac.." "..ak.." fights "..enemyc.." "..enemyk..", killing "..Loss1.." and suffering "..Loss0)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -188,14 +193,13 @@ function player.cb_map(actor,place,dialog)
|
||||
local lis=tangible.near(actor,rad,true,false)
|
||||
pprint("cb_map ",lis)
|
||||
for _,t in pairs(lis) do
|
||||
if t~=actor then print(tangible.getclass(t)) end
|
||||
local graphic,plane,x,y,z,facing = tangible.animstate(t)
|
||||
local c=tangible.getclass(t)
|
||||
local dx,dy=tangible.xyz(t)
|
||||
local offset=(dy+rad)*(rad*2+1)+dx+rad
|
||||
local cl=tangible.getclass(t)
|
||||
local kind=t.kind or 'Nil'
|
||||
pprint(t)
|
||||
print("Offset of "..cl.." is "..offset.." kind is "..kind)
|
||||
if not scratch[offset] then scratch[offset]={} end
|
||||
if not scratch[offset].count then scratch[offset].count={} end
|
||||
if not scratch[offset].count[kind] then scratch[offset].count[kind]=0 end
|
||||
@@ -224,11 +228,11 @@ function player.cb_map(actor,place,dialog)
|
||||
for dx=-rad,rad do lbuf=lbuf.."----" end
|
||||
lbuf=lbuf.."-"
|
||||
print(lbuf)
|
||||
print("In Player:")
|
||||
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("Army:")
|
||||
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