|
1 |
|
2 classes.obj_oven = { |
|
3 _properties = { |
|
4 name = "oven", |
|
5 longname = "an oven", |
|
6 desc = "You see a large oven, with various knobs and switches. It looks quite obvious how to TURN ON though :)" |
|
7 }, |
|
8 _parent = "obj_container"; |
|
9 }; |
|
10 |
|
11 classes.obj_oven["turn on"] = function (self, e) |
|
12 if self._properties.power == "on" then e.person:_tell("The oven is already on!"); end |
|
13 self._properties.power = "on"; |
|
14 e.person:_action("switches on the oven"); |
|
15 end |
|
16 |
|
17 classes.obj_oven["turn off"] = function (self, e) |
|
18 if self._properties.power ~= "on" then e.person:_tell("The oven is already off!"); end |
|
19 self._properties.power = "off"; |
|
20 e.person:_action("switches off the oven"); |
|
21 end |