-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinspect-celeste.lua
90 lines (84 loc) · 1.81 KB
/
inspect-celeste.lua
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
function get_name_of_type(type)
if type == nil then
return "nil"
elseif type == player then
return "player"
elseif type == player_spawn then
return "player_spawn"
elseif type == spring then
return "spring"
elseif type == balloon then
return "baloon"
elseif type == fall_floor then
return "fall_floor"
elseif type == smoke then
return "smoke"
elseif type == fruit then
return "fruit"
elseif type == fly_fruit then
return "fly_fruit"
elseif type == lifeup then
return "lifeup"
elseif type == fake_wall then
return "fake_wall"
elseif type == key then
return "key"
elseif type == chest then
return "chest"
elseif type == platform then
return "platform"
elseif type == message then
return "message"
elseif type == big_chest then
return "big_chest"
elseif type == orb then
return "orb"
elseif type == flag then
return "flag"
elseif type == room_title then
return "room_title"
else
error("unknown type", type)
end
end
function find_object(cb)
if count(objects) == 0 then
return nil
end
for i=1,count(objects) do
local o = objects[i]
if cb(o) then
return o
end
end
return nil
end
function find_player_spawn()
return find_object(function(o) return o.type == player_spawn end)
end
function mark_hair(o)
mark("hair_pos", o.x)
mark("hair_pos", o.y)
end
function mark_player(o)
mark("player_spd", o.spd.x)
mark("player_spd", o.spd.y)
mark("player_rem", o.rem.x)
mark("player_rem", o.rem.y)
end
function mark_everything()
foreach(
objects,
function(o)
if o.hair ~= nil then
foreach(o.hair, mark_hair)
end
if o.type == player then
mark_player(o)
end
end
)
end
function inspect_celeste()
always_print("count(objects)", count(objects))
end