objects/obj_window.lua

1
--[[
2
A simple window object.
3
I coded this after the example 'fireplace' and 'cat' objects but they won't show up in SOO in room d2 or any other.
4
I don't know how to store the window open or not property yet.
5
 
6
by Manole Paul-Sebastian (brokenthorn)
7
]]
8
 
9
classes.obj_window =
10
{
11
	_properties = { name = "window", longname = "a large wooden window", desc = "You look at the large wooden window and you can see almost anything going on outside." };
12
	_parent = nil;	
13
 
14
	kill		=	function (self, e)
15
					e.person:_say("/me tries to break the window");
16
					self:_say("/me is unbreakable. Must be break-proof... Hehee ;)");
17
				end,
18
 
19
	close	=	function (self, e)
20
					e.person:_say("/me tries to close the "..self._properties.name);
21
					self:_say("/me closes with a loud creak!");
22
				end,
23
}
24
 
25
function	classes.obj_window:open(e)
26
				e.person:_say("/me opens the window", false);
27
				self:_say("/me opens quietly");
28
end
29
 
30
classes.obj_window["break"] = classes.obj_window.kill;
31
classes.obj_window.smash = classes.obj_window.kill;