/usr/share/games/instead/stead/object.lua is in instead-data 1.9.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327  | local function onevent(ev, ...)
	local vv, r
	if stead.api_version >= "1.6.3" then
		vv, r = stead.call(game, ev, ...);
		if r == false then
			return vv, false
		end
		if vv == false then
			return nil, false
		end
		return vv
	end
end
stead.player_action = function(self, what, ...)
	local v,r,obj,vv
	if isXaction(what) then -- already xact
		obj = what
	else
		obj = _G[what];
	end
	if not isXaction(obj) then
		obj = stead.ref(self.where):srch(what);
	end
	if not obj then
		return stead.call(game, 'action', what, ...); --player_do(self, what, ...);
	end
	vv, r = onevent('onact', obj, ...);
	if vv == false then
		return
	end
	if r == false then 
		return vv
	end
	v, r = stead.player_take(self, what, ...);
	if not v and not r then
		v, r = stead.call(obj, 'act', ...);
		if type(vv) == 'string' then
			v = stead.par(stead.space_delim, vv, v);
		end
		if not v and not r then
			v, r = stead.call(game, 'act', obj, ...);
		end
	elseif type(vv) == 'string' then
		v = stead.par(stead.space_delim, vv, v);
	end
	return v, r;
end
stead.player_use = function(self, what, onwhat, ...)
	local obj, obj2, v, vv, r;
	local scene_use_mode = false
	obj = _G[what];
	if isXaction(obj) then -- use xact is act
		return self:action(obj, onwhat, ...)
	end
	obj = self:srch(what); -- in inv?
	if not obj then -- no
		obj = stead.ref(self.where):srch(what); -- in scene?
		if not obj then -- no!
			return game.err, false;
		end
		scene_use_mode = true -- scene_use_mode!
	end
	obj = stead.ref(obj);
	if onwhat == nil then -- only one?
		if scene_use_mode then
			return self:action(what, ...); -- call act
		end
		vv, r = onevent('oninv', obj, ...);
		if vv == false then
			return
		end
		if r == false then
			return vv
		end
		v, r = stead.call(obj, 'inv', ...); -- call inv
		if type(vv) == 'string' then
			v = stead.par(stead.space_delim, vv, v);
		end
		if not v and not r then
			v, r = stead.call(game, 'inv', obj, ...);
		end
		return v, r;
	end
	obj2 = stead.ref(self.where):srch(onwhat); -- in scene?
	if not obj2 then
		obj2 = self:srch(onwhat); -- in inv?
	end
	if not obj2 then
		return game.err, false;
	end
	
	obj2 = stead.ref(obj2)
	if not scene_use_mode or isSceneUse(obj) then
		vv, r = onevent('onuse', obj, obj2, ...);
		if vv == false then
			return
		end
		if r == false then 
			return vv 
		end
		v, r = stead.call(obj, 'use', obj2, ...);
		if type(vv) == 'string' then
			v = stead.par(stead.space_delim, vv, v);
		end
		if r ~= false then
			vv = stead.call(obj2, 'used', obj, ...);
			if type(vv) == 'string' then
				v = stead.par(stead.space_delim, v, vv);
			end
		end
	end
	if v == nil and vv == true and stead.api_version >= "1.7.1" then
		v = true
	end
	if not v then
		v, r = stead.call(game, 'use', obj, obj2, ...);
	end
--	if v == nil and stead.api_version >= "1.3.5" then
--		return true
--	end
	return v
end
stead.vobj_save = function(self, name, h, need)
	local w = stead.deref(self.where)
	local dsc = self.dsc
	
	if need then
		h:write(stead.string.format("%s  = vobj(%s,%s,%s);\n",
			name, 
			stead.tostring(self.nam), 
			stead.tostring(dsc), 
			stead.tostring(w)));
	end
	stead.savemembers(h, self, name, false);
end
stead.vobj_act = function(self, ...)
	local o, r = stead.here():srch(self); -- self.nam
	if stead.ref(o) and stead.ref(o).where then
		return stead.walk(stead.ref(o).where);
	end
	return stead.call(stead.ref(r),'act', self.nam, ...);
end
stead.vobj_used = function(self, ...)
	local o, r = stead.here():srch(self.nam);
	return stead.call(stead.ref(r),'used', self.nam, ...);
end
stead.vobj_use = function(self, ...)
	local o, r = stead.here():srch(self.nam);
	return stead.call(stead.ref(r),'use', self.nam, ...);
end
function vobj(name, dsc, w)
	return obj{ nam = tostring(name), 
		vobject_type = true,
		dsc = dsc, 
		where = stead.deref(w), 
		act = stead.vobj_act, 
		used = stead.vobj_used, 
		use = stead.vobj_use,
		save = stead.vobj_save };
end
function vway(name, dsc, w)
--	o.object_type = true;
	return  obj{ nam = tostring(name), 
		vobject_type = true,
		dsc = dsc, 
		act = stead.vobj_act, 
		where = stead.deref(w), 
		used = stead.vobj_used,
		use = stead.vobj_use, 
		save = stead.vobj_save };
end
function isVobject(v)
	return (type(v) == 'table') and (v.vobject_type)
end
stead.list_check = function(self, name) -- force using of objects, instead refs
	local i, v, ii;
	for i,v,ii in opairs(self) do
		local o = stead.ref(v);
		if not isObject(o) then 
			error ("No object: "..name.."["..tostring(ii).."]".." ("..tostring(type(v))..")")
			return false
		end
		if (v.auto_allocated and not stead.ref(v.key_name)) -- renew
			or (isObject(stead.deref(v)) and not v._dynamic_type) then -- no named object!
			local n = stead.string.format("%s[%d]", name, ii);
			v = allocator:new(n, n);
			self[ii] = v;
			v.auto_allocated = true;
			for_each(v, n, stead.check_list, isList, stead.deref(v));
		else
			self[ii] = o;
		end
	end
	return true; 
end
stead.list_add = function(self, name, pos)
	local nam = name
	if stead.initialized then
		nam = stead.ref(name);
	end
	if not nam then
		error ("Add wrong object to list: "..tostring(name), 2);
	end
	if self:look(nam) then
		return nil
	end
	self.__modified__ = true;
	if isObject(stead.deref(nam)) then
		nam._dynamic_type = true
	end
	if tonumber(pos) then
		pos = tonumber(pos)
		if pos <= #self then
			stead.table.insert(self, pos, nam);
		else
			self[pos] = nam; -- for spare lists
		end
	else
		stead.table.insert(self, nam);
	end
	return true
end
stead.list_set = function(self, name, pos)
	local nam = name
	local i = tonumber(pos);
	if not i then
		return nil
	end
	if stead.initialized then
		nam = stead.ref(name);
	end
	if not nam then
		error ("Set wrong object in list: "..tostring(name), 2);
	end
	if isObject(stead.deref(nam)) then
		nam._dynamic_type = true
	end
	self.__modified__ = true;
	self[i] = nam; -- for spare lists
	return true
end
stead.list_concat = function(self, other, pos)
	local n,o,ii
	for n,o,ii in opairs(other) do
		o = stead.ref(o);
		if pos == nil then
			self:add(o);
		else 
			self:add(o, pos);
			pos = pos + 1;
		end
	end
end
stead.delim = '|'
stead.list_str = function(self)
	local i, v, vv, o;
	for i,o in opairs(self) do
		o = stead.ref(o);
		if isObject(o) and not isDisabled(o) then
			vv = stead.dispof(o)
			vv = stead.xref(vv, o);
			v = stead.par(stead.delim, v, vv);
		end
	end
	return v;
end
stead.obj_str = function(self)
	local i, v, vv, o;
	if not isObject(self) then
		return
	end
	if isDisabled(self) then
		return 
	end
	for i,o in opairs(self.obj) do
		o = stead.ref(o);
		if isObject(o) and not isDisabled(o) then
			vv = stead.dispof(o)
			vv = stead.xref(vv, o);
			v = stead.par(stead.delim, v, vv, stead.obj_str(o));
		end
	end
	return v;
end
function path(w, wh) -- search in way, disabled too
	if not wh then
		wh = stead.here();
	else
		wh = stead.ref(wh);
	end
	local o = ways(wh):srch(w, true);
	o = stead.ref(o);
	if isRoom(o) then
		return o
	end
	return nil
end
game.lifes = list(game.lifes)
stead:init(); -- reinit ob
-- vim:ts=4
 |