knock
musicmud-2.1.6/data/verbs/knock · 598 B
From the archive musicmud2.1.6.tar.gz
Download the archive « Back to the archive contents
--lua
local world = match(pl, arg)
if getn(world)>1 then
send(pl, "You can only knock one thing at once.")
return
end
local obj = world[1]
if !obj then
send(pl, "Knock what?")
return
end
if obj == pl then
send(pl, "You can't knock yourself.")
return
end
if getflag(obj, flag.CanOpen) and state(obj)==0 then
if getflag(obj, flag.Plural) then
send(pl, "They're open.")
else
send(pl, "It's open.")
end
return
end
act(pl, "%#1 %[knocks/knock] %a.", obj)
local other = getobj(obj, "other")
if other then
act(other, "%#1 %[is/are] knocked from the other side.")
end