Adding initial work on Grue Hunter 2.0
[grue-hunter.git] / objects / lantern.inf
1 ! This file is part of Grue Hunter.
2 !
3 ! Grue Hunter is free software: you can redistribute it and/or modify it
4 ! under the terms of the GNU Affero General Public License as published
5 ! by the Free Software Foundation, either version 3 of the License, or
6 ! (at your option) any later version.
7 !
8 ! Grue Hunter is distributed in the hope that it will be useful, but
9 ! WITHOUT ANY WARRANTY; without even the implied warranty of
10 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 ! Affero General Public License for more details.
12 !
13 ! You should have received a copy of the GNU Affero General Public
14 ! License along with Grue Hunter. If not, see
15 ! <https://gnu.org/licenses/>.
16 !===================================================================
17 Object  lantern "copper lantern" backpack
18 with    name 'lantern' 'copper' 'lamp' 'light',
19         description [;
20                 print "This is an exceptionally beautiful lamp. About 
21                 eleven inches high, with a base of about 5 inches or so in diameter 
22                 and a large, brass-closed hook at the top. The glass in the lamp has a 
23                 fresnel type of design, which is used to distribute light widely. It 
24                 appears to have been damaged in your fall and ";
25
26                         if (fuel_left > 0) print "is leaking fuel. ";
27                         else print "all the fuel has leaked out. ";
28
29                 print "The words ~Manufactured By The Frobozz Magic 
30                 Lantern Company~ are engraved in the base.^^";
31                 ],
32
33         time_left,
34         time_out [;
35                 if (lantern has on) print "The lantern has run out of fuel and is now off.";
36                 fuel_left = 0;
37                 give lantern ~on;
38                 give lantern ~light;
39                 ],
40
41         after [;
42                 SwitchOn:
43                         if (fuel_left > 0) give lantern light;
44                         else {
45                                 print "The lantern is out of fuel and cannot be turned on. 
46                                 Perhaps there is a place to refuel?^";
47                                 rtrue;
48                              }
49                 SwitchOff:
50                         give lantern ~light;
51                 ],
52
53 has     switchable;