-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathraw_game_types.lua
182 lines (178 loc) · 8.24 KB
/
raw_game_types.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
local introspection = require("introspection")
local CLASSES = {
-- This is a subset of the StateMemory class containing only necessary fields for TASable screen snapshots.
StateMemory_ScreenSnapshot = {
fields = {
{ type = "SCREEN", name = "screen_next" },
{ type = "int", name = "kali_favor" },
{ type = "int", name = "kali_status" },
{ type = "int", name = "kali_altars_destroyed" },
{ type = "int", name = "kali_gifts" },
{ type = "int", name = "seed" },
{ type = "int", name = "time_total" },
{ type = "int", name = "world" },
{ type = "int", name = "world_next" },
{ type = "int", name = "world_start" },
{ type = "int", name = "level" },
{ type = "int", name = "level_next" },
{ type = "int", name = "level_start" },
{ type = "THEME", name = "theme" },
{ type = "THEME", name = "theme_next" },
{ type = "int", name = "theme_start" },
{ type = "int", name = "shoppie_aggro" },
{ type = "int", name = "shoppie_aggro_next" },
{ type = "int", name = "outposts_spawned" },
{ type = "int", name = "merchant_aggro" },
{ type = "int", name = "kills_npc" },
{ type = "int", name = "level_count" },
{ type = "int", name = "damage_taken" },
{ type = "JOURNAL_FLAG", name = "journal_flags" },
{ type = "int", name = "time_last_level" },
{ type = "int", name = "time_level" },
{ type = "QUEST_FLAG", name = "quest_flags" },
{ type = "int", name = "saved_dogs" },
{ type = "int", name = "saved_cats" },
{ type = "int", name = "saved_hamsters" },
{ type = "int", name = "win_state" },
{ type = "int", name = "money_last_levels" },
{ type = "int", name = "money_shop_total" },
{ type = "QuestsInfo", name = "quests" },
{ type = "int", name = "correct_ushabti" },
{ type = "Items", name = "items" },
{ type = "ENT_TYPE", name = "speedrun_character" },
{ type = "bool", name = "speedrun_activation_trigger" },
{ type = "bool", name = "world2_coffin_spawned" },
{ type = "bool", name = "world4_coffin_spawned" },
{ type = "bool", name = "world6_coffin_spawned" },
{ type = "ENT_TYPE", name = "first_damage_cause" },
{ type = "int", name = "first_damage_world" },
{ type = "int", name = "first_damage_level" },
{ type = "ENT_TYPE", array_size = 99, name = "waddler_storage" },
{ type = "int", array_size = 99, name = "waddler_metadata" },
{ type = "int", name = "journal_progress_sticker_count" },
{ type = "JournalProgressStickerSlot", array_size = 40, name = "journal_progress_sticker_slots" },
{ type = "int", name = "journal_progress_stain_count" },
{ type = "JournalProgressStainSlot", array_size = 30, name = "journal_progress_stain_slots" },
{ type = "int", name = "journal_progress_theme_count" },
{ type = "int", array_size = 9, name = "journal_progress_theme_slots" }
}
},
QuestsInfo = {
fields = {
{ type = "int", name = "yang_state" },
{ type = "int", name = "jungle_sisters_flags" },
{ type = "int", name = "van_horsing_state" },
{ type = "int", name = "sparrow_state" },
{ type = "int", name = "madame_tusk_state" },
{ type = "int", name = "beg_state" }
}
},
Items = {
fields = {
{ type = "int", name = "player_count" },
{ type = "int", name = "saved_pets_count" },
{ type = "ENT_TYPE", array_size = 4, name = "saved_pets" },
{ type = "bool", array_size = 4, name = "is_pet_cursed" },
{ type = "bool", array_size = 4, name = "is_pet_poisoned" },
{ type = "int", name = "leader" },
{ type = "Inventory", array_size = CONST.MAX_PLAYERS, name = "player_inventory" },
{ type = "SelectPlayerSlot", array_size = CONST.MAX_PLAYERS, name = "player_select" }
}
},
Inventory = {
fields = {
{ type = "int", name = "money" },
{ type = "int", name = "bombs" },
{ type = "int", name = "ropes" },
{ type = "int", name = "player_slot" },
{ type = "int", name = "poison_tick_timer" },
{ type = "bool", name = "cursed" },
{ type = "bool", name = "elixir_buff" },
{ type = "int", name = "health" },
{ type = "int", name = "kapala_blood_amount" },
{ type = "int", name = "time_of_death" },
{ type = "ENT_TYPE", name = "held_item" },
{ type = "int", name = "held_item_metadata" },
{ type = "ENT_TYPE", name = "mount_type" },
{ type = "int", name = "mount_metadata" },
{ type = "int", name = "kills_level" },
{ type = "int", name = "kills_total" },
{ type = "int", name = "collected_money_total" },
{ type = "int", name = "collected_money_count" },
{ type = "ENT_TYPE", array_size = 512, name = "collected_money" },
{ type = "int", array_size = 512, name = "collected_money_values" },
{ type = "ENT_TYPE", array_size = 256, name = "killed_enemies" },
{ type = "int", name = "companion_count" },
{ type = "ENT_TYPE", array_size = 8, name = "companions" },
{ type = "ENT_TYPE", array_size = 8, name = "companion_held_items" },
{ type = "int", array_size = 8, name = "companion_held_item_metadatas" },
{ type = "int", array_size = 8, name = "companion_trust" },
{ type = "int", array_size = 8, name = "companion_health" },
{ type = "int", array_size = 8, name = "companion_poison_tick_timers" },
{ type = "bool", array_size = 8, name = "is_companion_cursed" },
{ type = "ENT_TYPE", array_size = 30, name = "acquired_powerups" }
}
},
SelectPlayerSlot = {
fields = {
{ type = "bool", name = "activated" },
{ type = "ENT_TYPE", name = "character" },
{ type = "int", name = "texture" }
}
},
JournalProgressStickerSlot = {
fields = {
{ type = "int", name = "theme" },
{ type = "int", name = "grid_position" },
{ type = "ENT_TYPE", name = "entity_type" },
{ type = "float", name = "x" },
{ type = "float", name = "y" },
{ type = "float", name = "angle" }
}
},
JournalProgressStainSlot = {
fields = {
{ type = "float", name = "x" },
{ type = "float", name = "y" },
{ type = "float", name = "angle" },
{ type = "float", name = "scale" },
{ type = "int", name = "texture_column" },
{ type = "int", name = "texture_row" },
{ type = "int", name = "texture_range" }
}
}
}
local types = {
int = {},
bool = {},
ENT_TYPE = {},
JOURNAL_FLAG = {},
QUEST_FLAG = {},
SCREEN = {},
THEME = {}
}
-- TODO: Consider moving this class restructuring code into the introspection module.
for class_name, class in pairs(CLASSES) do
types[class_name] = class
class.traversal_type = introspection.TRAVERSAL_TYPE.CLASS
if class.fields then
for _, field in ipairs(class.fields) do
if field.is_array or field.array_size then
field.type = {
array_size = field.array_size,
element_type = field.type
}
if field.array_size then
field.type.traversal_type = introspection.TRAVERSAL_TYPE.STRUCTURAL_ARRAY
field.type.name = field.type.element_type.."["..field.array_size.."]"
else
field.type.traversal_type = introspection.TRAVERSAL_TYPE.ARRAY
field.type.name = field.type.element_type.."[]"
end
field.is_array = nil
field.array_size = nil
end
end
end
end
return types