Adding initial work on Grue Hunter 2.0
[grue-hunter.git] / objects / lantern.inf
diff --git a/objects/lantern.inf b/objects/lantern.inf
new file mode 100644 (file)
index 0000000..8805f6b
--- /dev/null
@@ -0,0 +1,53 @@
+! This file is part of Grue Hunter.
+!
+! Grue Hunter is free software: you can redistribute it and/or modify it
+! under the terms of the GNU Affero General Public License as published
+! by the Free Software Foundation, either version 3 of the License, or
+! (at your option) any later version.
+!
+! Grue Hunter is distributed in the hope that it will be useful, but
+! WITHOUT ANY WARRANTY; without even the implied warranty of
+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+! Affero General Public License for more details.
+!
+! You should have received a copy of the GNU Affero General Public
+! License along with Grue Hunter. If not, see
+! <https://gnu.org/licenses/>.
+!===================================================================
+Object lantern "copper lantern" backpack
+with   name 'lantern' 'copper' 'lamp' 'light',
+        description [;
+               print "This is an exceptionally beautiful lamp. About 
+               eleven inches high, with a base of about 5 inches or so in diameter 
+               and a large, brass-closed hook at the top. The glass in the lamp has a 
+               fresnel type of design, which is used to distribute light widely. It 
+               appears to have been damaged in your fall and ";
+
+                       if (fuel_left > 0) print "is leaking fuel. ";
+                       else print "all the fuel has leaked out. ";
+
+               print "The words ~Manufactured By The Frobozz Magic 
+               Lantern Company~ are engraved in the base.^^";
+               ],
+
+       time_left,
+       time_out [;
+               if (lantern has on) print "The lantern has run out of fuel and is now off.";
+               fuel_left = 0;
+               give lantern ~on;
+               give lantern ~light;
+               ],
+
+       after [;
+               SwitchOn:
+                       if (fuel_left > 0) give lantern light;
+                       else {
+                               print "The lantern is out of fuel and cannot be turned on. 
+                               Perhaps there is a place to refuel?^";
+                               rtrue;
+                            }
+               SwitchOff:
+                       give lantern ~light;
+               ],
+
+has    switchable;