Committed gnomino's iceflower patch. Also added placeholder graphics (selfmade, PD...
[supertux.git] / data / scripts / console.nut
1 /**
2  * This script is loaded into the console script interpreter.
3  * You should define shortcuts and helper functions that are usefull for the
4  * console here
5  */
6
7 function flip()
8 {
9         Level.flip_vertically();
10 }
11
12 function finish()
13 {
14         Level.finish(true);
15 }
16
17 function grow()
18 {
19         sector.Tux.add_bonus("grow");
20 }
21
22 function fire()
23 {
24         sector.Tux.add_bonus("fireflower");
25 }
26
27 function ice()
28 {
29         sector.Tux.add_bonus("iceflower");
30 }
31
32 function shrink()
33 {
34         sector.Tux.add_bonus("none");
35 }
36
37 function kill()
38 {
39         sector.Tux.kill(true);
40 }
41
42 function lifeup()
43 {
44         sector.Tux.add_coins(100);
45 }
46
47 /**
48  * Display a list of functions in the roottable (or in the table specified)
49  */
50 function functions(...)
51 {
52         local obj = this;
53         if(vargc == 1)
54                 obj = vargv[0];
55         if(::type(obj) == "instance")
56                 obj = obj.getclass()
57
58         while(obj != null) {
59                 foreach(key, val in obj) {
60                         if(::type(val) == "function")
61                                 println(key);
62                 }
63                 obj = obj.parent;
64         }
65 }
66