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