objects/obj_oven.lua

changeset 0
cc66ad6b0d75
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/objects/obj_oven.lua	Sat Mar 27 17:43:08 2010 +0000
@@ -0,0 +1,21 @@
+
+classes.obj_oven = { 
+				_properties =	{
+								name = "oven",
+								longname = "an oven",
+								desc = "You see a large oven, with various knobs and switches. It looks quite obvious how to TURN ON though :)"
+							},
+				_parent = "obj_container";
+			};
+			
+classes.obj_oven["turn on"] = function (self, e)
+	if self._properties.power == "on" then e.person:_tell("The oven is already on!"); end
+	self._properties.power = "on";
+	e.person:_action("switches on the oven");
+end
+
+classes.obj_oven["turn off"] = function (self, e)
+	if self._properties.power ~= "on" then e.person:_tell("The oven is already off!"); end
+	self._properties.power = "off";
+	e.person:_action("switches off the oven");
+end

mercurial