File: console.nut

package info (click to toggle)
supertux 0.6.3-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 264,124 kB
  • sloc: cpp: 113,426; ansic: 9,654; sh: 4,483; cs: 1,296; makefile: 407; yacc: 398; python: 382; lisp: 285; objc: 248; csh: 219; lex: 140; perl: 118; xml: 53; ruby: 36
file content (102 lines) | stat: -rw-r--r-- 1,344 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/**
 * This script is loaded into the console script interpreter.
 * You should define shortcuts and helper functions that are useful for the
 * console here
 */

function flip()
{
	Level.flip_vertically();
}

function finish()
{
	Level.finish(true);
}

function edit()
{
	Level.edit(true);
}

function play()
{
	Level.edit(false);
}

function worldmapfinish()
{
	foreach(world in state.worlds) {
		foreach(levelname, level in world.levels) {
			level.solved = true;
		}
	}
	load_state();
}

function grow()
{
	sector.Tux.add_bonus("grow");
}

function make_invincible()
{
      sector.Tux.make_invincible();
}

function fire()
{
	sector.Tux.add_bonus("fireflower");
}

function ice()
{
	sector.Tux.add_bonus("iceflower");
}

function air()
{
	sector.Tux.add_bonus("airflower");
}

function earth()
{
	sector.Tux.add_bonus("earthflower");
}

function shrink()
{
	sector.Tux.kill(false);
}

function kill()
{
	sector.Tux.kill(true);
}

function lifeup()
{
	sector.Tux.add_coins(100);
}

function none()
{
	sector.Tux.set_bonus("none");
}

/**
 * Display a list of functions in the roottable (or in the table specified)
 */
function functions(...)
{
	local obj = this;
	if(vargv.len() == 1)
		obj = vargv[0];
	if(::type(obj) == "instance")
		obj = obj.getclass()

	foreach(key, val in obj) {
		if(::type(val) == "function")
			println(key);
	}
}