forked from NathanSnail/wand_eval_tree
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgun_meta.lua
More file actions
309 lines (244 loc) · 6.9 KB
/
Copy pathgun_meta.lua
File metadata and controls
309 lines (244 loc) · 6.9 KB
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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
---@diagnostic disable: unused-local
---@meta
---@class action
---@field action fun(recursion: integer, iter: integer): integer
---@field id string
---@field name string
---@field description string
---@field sprite string
---@field type integer
---@field recursive boolean
---@field spawn_level string
---@field spawn_probability string
---@field spawn_requires_flag string
---@field spawn_manual_unlock boolean?
---@field max_uses integer?
---@field custom_xml_file string?
---@field ai_never_uses boolean?
---@field never_unlimited boolean?
---@field is_dangerous_blast boolean?
---@field sound_loop_tag string?
---@field mana number?
---@field sprite_unidentified string?
---@field deck_index integer
---@alias state table<string, any>
ACTION_TYPE_PROJECTILE = 0
ACTION_TYPE_STATIC_PROJECTILE = 1
ACTION_TYPE_MODIFIER = 2
ACTION_TYPE_DRAW_MANY = 3
ACTION_TYPE_MATERIAL = 4
ACTION_TYPE_OTHER = 5
ACTION_TYPE_UTILITY = 6
ACTION_TYPE_PASSIVE = 7
---@type action[]
actions = {}
---@type table<string, fun()>
extra_modifiers = {}
ACTION_DRAW_RELOAD_TIME_INCREASE = 0
ACTION_MANA_DRAIN_DEFAULT = 10
ACTION_UNIDENTIFIED_SPRITE_DEFAULT = "data/ui_gfx/gun_actions/unidentified.png"
reflecting = false
---@type action?
current_action = nil
first_shot = true
reloading = false
start_reload = false
got_projectiles = false
state_from_game = nil
---@type action[]
discarded = {}
---@type action[]
deck = {}
---@type action[]
hand = {}
---@type state
c = {}
current_projectile = nil
current_reload_time = 0
--technically fake idc
---@type state
shot_effects = {}
---@type string[]
active_extra_modifiers = {}
mana = 0.0
state_shuffled = false
state_cards_drawn = 0
state_discarded_action = false
state_destroyed_action = false
playing_permanent_card = false
use_game_log = false
---@class gun
---@field reload_time integer
---@type gun
---@diagnostic disable-next-line: missing-fields
gun = {}
---@type integer
current_reload_time = gun.reload_time
-- setup additional card-related variables
dont_draw_actions = false
force_stop_draws = false
shot_structure = {}
recursion_limit = 2
-- action effect reflection stuff
---@param state state
function reset_modifiers(state) end
---@param state state
function register_action(state) end
---@param effects state
function register_gunshoteffects(effects) end
--- call this when current action changes
---@param action action
function set_current_action(action) end
---@param source action
---@param target action
function clone_action(source, target) end
---@param text string
function debug_print(text) end
---@param t action[]
function debug_print_action_table(t) end
function debug_print_deck() end
function debug_print_discarded() end
function debug_print_hand() end
-- various utilities
---@param num_of_cards_to_draw integer
---@return shot_ref
function create_shot(num_of_cards_to_draw) end
---@param shot shot_ref
---@param instant_reload_if_empty boolean
function draw_shot(shot, instant_reload_if_empty) end
--- helper functions. actions may call these ---
function order_deck() end
---@param action action
function play_action(action) end
---@param instant_reload_if_empty boolean
---@return boolean
function draw_action(instant_reload_if_empty) end
---@param action action
function handle_mana_addition(action) end
---@param how_many integer
---@param instant_reload_if_empty boolean
function draw_actions(how_many, instant_reload_if_empty) end
---@param entity_filename string
function add_projectile(entity_filename) end
---@param entity_filename string
---@param delay_frames integer
---@param action_draw_count integer
function add_projectile_trigger_timer(entity_filename, delay_frames, action_draw_count) end
---@param entity_filename string
---@param action_draw_count integer
function add_projectile_trigger_hit_world(entity_filename, action_draw_count) end
---@param entity_filename string
---@param action_draw_count integer
function add_projectile_trigger_death(entity_filename, action_draw_count) end
---@param name string
function baab_instruction(name) end
function move_discarded_to_deck() end
function move_hand_to_discarded() end
---@param data action
---@param rec_ integer
---@return integer
function check_recursion(data, rec_) end
--- exported functions. called by the C++ code -------------------------------------
-- call this to do one shot (or round, or turn)
---@type shot_ref?
root_shot = nil
---@param current_mana number
function _start_shot(current_mana) end
---@param can_reload_at_end boolean
function _draw_actions_for_shot(can_reload_at_end) end
---@return number
function _handle_reload() end
function _set_gun() end
function _set_gun2() end
-- this can be used to build a new deck
---@param use_game_log_ boolean
function _clear_deck(use_game_log_) end
-- this can be used to build a new deck
---@param action_id string
---@param inventoryitem_id integer
---@param uses_remaining integer
---@param is_identified boolean
function _add_card_to_deck(action_id, inventoryitem_id, uses_remaining, is_identified) end
---@param action_id string
function _play_permanent_card(action_id) end
---@param inventoryitem_id integer
---@param uses_remaining integer
function _change_action_uses_remaining(inventoryitem_id, uses_remaining) end
---@param name string
function _add_extra_modifier_to_shot(name) end
-- slot durabilities (in shots). -1 means infinite --
---@param current_slot_count integer
---@return integer
function _get_gun_slot_durability_default(current_slot_count) end
---@param current_slot_count any
---@return integer
function _get_gun_slot_durability_infinite(current_slot_count) end
function ConfigGunActionInfo_ReadToLua(
action_id,
action_name,
action_description,
action_sprite_filename,
action_unidentified_sprite_filename,
action_type,
action_spawn_level,
action_spawn_probability,
action_spawn_requires_flag,
action_spawn_manual_unlock,
action_max_uses,
custom_xml_file,
action_mana_drain,
action_is_dangerous_blast,
action_draw_many_count,
action_ai_never_uses,
action_never_unlimited,
state_shuffled,
state_cards_drawn,
state_discarded_action,
state_destroyed_action,
fire_rate_wait,
speed_multiplier,
child_speed_multiplier,
dampening,
explosion_radius,
spread_degrees,
pattern_degrees,
screenshake,
recoil,
damage_melee_add,
damage_projectile_add,
damage_electricity_add,
damage_fire_add,
damage_explosion_add,
damage_ice_add,
damage_slice_add,
damage_healing_add,
damage_curse_add,
damage_drill_add,
damage_null_all,
damage_critical_chance,
damage_critical_multiplier,
explosion_damage_to_materials,
knockback_force,
reload_time,
lightning_count,
material,
material_amount,
trail_material,
trail_material_amount,
bounces,
gravity,
light,
blood_count_multiplier,
gore_particles,
ragdoll_fx,
friendly_fire,
physics_impulse_coeff,
lifetime_add,
sprite,
extra_entities,
game_effect_entities,
sound_loop_tag,
projectile_file
)
end
function ConfigGun_ReadToLua(actions_per_round, shuffle_deck_when_empty, reload_time, deck_capacity) end