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