Skip to main content

rm2k/rpg/
lsd.rs

1//! `LSD` structures.
2
3#![allow(clippy::struct_excessive_bools)]
4
5use super::{enums::*, *};
6use crate::{
7    field::{BitArray, DbStr, List, Packed, UnindexedList},
8    lcf_strings, lcf_struct,
9    raw::{EventCommandList, StrList},
10};
11
12lcf_struct! {
13    #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
14    #[cfg_attr(feature = "serde", serde(bound(deserialize = "")))]
15    pub struct SaveTitle<'a> {
16        0x01 timestamp: f64 = 0.0,
17        0x0B hero_name: DbStr<'a>,
18        0x0C hero_level: i32 = 0,
19        0x0D hero_hp: i32 = 0,
20        0x15 face1_name: DbStr<'a>,
21        0x16 face1_id: i32 = 0,
22        0x17 face2_name: DbStr<'a>,
23        0x18 face2_id: i32 = 0,
24        0x19 face3_name: DbStr<'a>,
25        0x1A face3_id: i32 = 0,
26        0x1B face4_name: DbStr<'a>,
27        0x1C face4_id: i32 = 0,
28    }
29}
30
31lcf_strings!(SaveTitle<'a> { hero_name, face1_name, face2_name, face3_name, face4_name });
32
33lcf_struct! {
34    #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
35    #[cfg_attr(feature = "serde", serde(bound(deserialize = "")))]
36    pub struct SaveSystem<'a> {
37        0x01 scene: SaveSystemScene = SaveSystemScene(0), persist,
38        0x0B frame_count: i32 = 0,
39        0x15 graphics_name: DbStr<'a>,
40        0x16 message_stretch: SystemStretch = SystemStretch(0),
41        0x17 font_id: SystemFont = SystemFont(0),
42        0x20 switches: BitArray<'a>, count = 0x1F, persist,
43        0x22 variables: Packed<i32>, count = 0x21, persist,
44        0x29 message_transparent: i32 = 0,
45        0x2A message_position: i32 = 2,
46        0x2B message_prevent_overlap: i32 = 1,
47        0x2C message_continue_events: i32 = 0,
48        0x33 face_name: DbStr<'a>,
49        0x34 face_id: i32 = 0,
50        0x35 face_right: bool = false,
51        0x36 face_flip: bool = false,
52        0x37 event_message_active: bool = false,
53        0x3D music_stopping: bool = false,
54        0x47 title_music: Music<'a>, persist,
55        0x48 battle_music: Music<'a>, persist,
56        0x49 battle_end_music: Music<'a>, persist,
57        0x4A inn_music: Music<'a>, persist,
58        0x4B current_music: Music<'a>, persist,
59        0x4C before_vehicle_music: Music<'a>, persist,
60        0x4D before_battle_music: Music<'a>, persist,
61        0x4E stored_music: Music<'a>, persist,
62        0x4F boat_music: Music<'a>, persist,
63        0x50 ship_music: Music<'a>, persist,
64        0x51 airship_music: Music<'a>, persist,
65        0x52 gameover_music: Music<'a>, persist,
66        0x5B cursor_se: Sound<'a>, persist,
67        0x5C decision_se: Sound<'a>, persist,
68        0x5D cancel_se: Sound<'a>, persist,
69        0x5E buzzer_se: Sound<'a>, persist,
70        0x5F battle_se: Sound<'a>, persist,
71        0x60 escape_se: Sound<'a>, persist,
72        0x61 enemy_attack_se: Sound<'a>, persist,
73        0x62 enemy_damaged_se: Sound<'a>, persist,
74        0x63 actor_damaged_se: Sound<'a>, persist,
75        0x64 dodge_se: Sound<'a>, persist,
76        0x65 enemy_death_se: Sound<'a>, persist,
77        0x66 item_se: Sound<'a>, persist,
78        0x6F transition_out: i8 = -1, persist,
79        0x70 transition_in: i8 = -1, persist,
80        0x71 battle_start_fadeout: i8 = -1, persist,
81        0x72 battle_start_fadein: i8 = -1, persist,
82        0x73 battle_end_fadeout: i8 = -1, persist,
83        0x74 battle_end_fadein: i8 = -1, persist,
84        0x79 teleport_allowed: bool = true,
85        0x7A escape_allowed: bool = true,
86        0x7B save_allowed: bool = true,
87        0x7C menu_allowed: bool = true,
88        0x7D background: DbStr<'a>,
89        0x83 save_count: i32 = 0,
90        0x84 save_slot: i32 = 1,
91        0x8C atb_mode: SaveSystemAtbMode = SaveSystemAtbMode(0), is2k3,
92        0x24 maniac_strings: StrList<'a>,
93        0x2D maniac_message_window_width: i32 = 0,
94        0x2E maniac_message_window_height: i32 = 0,
95        0x2F maniac_message_font_name: DbStr<'a>,
96        0x30 maniac_message_font_size: i32 = 0,
97        0x32 maniac_message_hook_flags: ManiacMessageHookFlags,
98        0x40 maniac_message_face_width: i32 = 48,
99        0x41 maniac_message_face_height: i32 = 48,
100        0x42 maniac_message_hook_common_event_id: i32 = 0,
101        0x43 maniac_message_hook_callback_system_variable: i32 = 0,
102        0x44 maniac_message_hook_callback_system_string_variable: i32 = 0,
103        0x45 maniac_message_hook_callback_user_variable: i32 = 0,
104        0x46 maniac_message_hook_callback_user_string_variable: i32 = 0,
105        0x85 maniac_battle_origin: i32 = 0,
106        0x88 maniac_frameskip: i32 = 0,
107        0x89 maniac_picture_limit: i32 = 0,
108        0x8A maniac_options: Packed<u8>,
109        0x8B maniac_joypad_bindings: Packed<u8>,
110        0x8E maniac_message_spacing_char: i32 = 0,
111        0x8F maniac_message_spacing_line: i32 = 0,
112    }
113}
114
115lcf_strings!(SaveSystem<'a> { graphics_name, face_name, background, maniac_message_font_name });
116
117lcf_struct! {
118    #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
119    pub struct SaveScreen {
120        0x01 tint_finish_red: i32 = 100,
121        0x02 tint_finish_green: i32 = 100,
122        0x03 tint_finish_blue: i32 = 100,
123        0x04 tint_finish_sat: i32 = 100,
124        0x0B tint_current_red: f64 = 100.0,
125        0x0C tint_current_green: f64 = 100.0,
126        0x0D tint_current_blue: f64 = 100.0,
127        0x0E tint_current_sat: f64 = 100.0,
128        0x0F tint_time_left: i32 = 0,
129        0x14 flash_continuous: bool = false,
130        0x15 flash_red: i32 = 0,
131        0x16 flash_green: i32 = 0,
132        0x17 flash_blue: i32 = 0,
133        0x18 flash_current_level: f64 = 0.0,
134        0x19 flash_time_left: i32 = 0,
135        0x1E shake_continuous: bool = false,
136        0x1F shake_strength: i32 = 0,
137        0x20 shake_speed: i32 = 0,
138        0x21 shake_position: i32 = 0,
139        0x22 shake_position_y: i32 = 0,
140        0x23 shake_time_left: i32 = 0,
141        0x29 pan_x: i32 = 0,
142        0x2A pan_y: i32 = 0,
143        0x2B battleanim_id: i32 = 0,
144        0x2C battleanim_target: i32 = 0,
145        0x2D battleanim_frame: i32 = 0,
146        0x2E battleanim_active: bool = false,
147        0x2F battleanim_global: bool = false,
148        0x30 weather: i32 = 0,
149        0x31 weather_strength: i32 = 0,
150    }
151}
152
153lcf_struct! {
154    #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
155    #[cfg_attr(feature = "serde", serde(bound(deserialize = "")))]
156    pub struct SavePicture<'a> indexed {
157        0x01 name: DbStr<'a>,
158        0x02 start_x: f64 = 0.0,
159        0x03 start_y: f64 = 0.0,
160        0x04 current_x: f64 = 0.0,
161        0x05 current_y: f64 = 0.0,
162        0x06 fixed_to_map: bool = false,
163        0x07 current_magnify: f64 = 100.0,
164        0x08 current_top_trans: f64 = 0.0,
165        0x09 use_transparent_color: bool = false,
166        0x0B current_red: f64 = 100.0,
167        0x0C current_green: f64 = 100.0,
168        0x0D current_blue: f64 = 100.0,
169        0x0E current_sat: f64 = 100.0,
170        0x0F effect_mode: SavePictureEffect = SavePictureEffect(0),
171        0x10 current_effect_power: f64 = 0.0,
172        0x12 current_bot_trans: f64 = 0.0,
173        0x13 spritesheet_cols: i32 = 1, is2k3,
174        0x14 spritesheet_rows: i32 = 1, is2k3,
175        0x15 spritesheet_frame: i32 = 0, is2k3,
176        0x16 spritesheet_speed: i32 = 0, is2k3,
177        0x17 frames: i32 = 0, is2k3,
178        0x18 spritesheet_play_once: bool = false, is2k3,
179        0x19 map_layer: SavePictureMapLayer = SavePictureMapLayer(7),
180        0x1A battle_layer: SavePictureBattleLayer = SavePictureBattleLayer(0),
181        0x1B flags: SavePictureFlags = SavePictureFlags { erase_on_map_change: true, affected_by_flash: true, affected_by_shake: true, ..SavePictureFlags::DEFAULT },
182        0x1F finish_x: f64 = 0.0,
183        0x20 finish_y: f64 = 0.0,
184        0x21 finish_magnify: i32 = 100,
185        0x22 finish_top_trans: i32 = 0,
186        0x23 finish_bot_trans: i32 = 0,
187        0x29 finish_red: i32 = 100,
188        0x2A finish_green: i32 = 100,
189        0x2B finish_blue: i32 = 100,
190        0x2C finish_sat: i32 = 100,
191        0x2E finish_effect_power: i32 = 0,
192        0x33 time_left: i32 = 0,
193        0x34 current_rotation: f64 = 0.0,
194        0x35 current_waver: i32 = 0,
195        0xC8 easyrpg_flip: SavePictureEasyRpgFlip = SavePictureEasyRpgFlip(0), is2k3,
196        0xC9 easyrpg_blend_mode: i32 = 0, is2k3,
197        0xCA easyrpg_type: i32 = 0, is2k3,
198        0x0A maniac_current_magnify_height: f64 = 100.0,
199        0x1C maniac_image_data: Packed<u8>,
200        0x24 maniac_finish_magnify_height: i32 = 100,
201    }
202}
203
204lcf_strings!(SavePicture<'a> { name });
205
206lcf_struct! {
207    #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
208    #[cfg_attr(feature = "serde", serde(bound(deserialize = "")))]
209    pub struct SavePartyLocation<'a> {
210        0x01 active: bool = true,
211        0x0B map_id: i32 = 0, persist,
212        0x0C position_x: i32 = 0, persist,
213        0x0D position_y: i32 = 0, persist,
214        0x15 direction: i32 = 2, persist,
215        0x16 facing: i32 = 2, persist,
216        0x17 anim_frame: i32 = 1,
217        0x18 transparency: i32 = 0,
218        0x1F remaining_step: i32 = 0,
219        0x20 move_frequency: i32 = 2,
220        0x21 layer: i32 = 1, persist,
221        0x22 overlap_forbidden: bool = false,
222        0x23 animation_type: EventPageAnimType = EventPageAnimType(0), persist,
223        0x24 lock_facing: bool = false,
224        0x25 move_speed: i32 = 4, persist,
225        0x29 move_route: MoveRoute<'a>, persist,
226        0x2A move_route_overwrite: bool = false,
227        0x2B move_route_index: i32 = 0,
228        0x2C move_route_finished: bool = false,
229        0x2E sprite_hidden: bool = false,
230        0x2F move_route_through: bool = false,
231        0x30 anim_paused: i32 = 0,
232        0x33 through: bool = false,
233        0x34 stop_count: i32 = 0,
234        0x35 anim_count: i32 = 0,
235        0x36 max_stop_count: i32 = 0,
236        0x3D jumping: bool = false,
237        0x3E begin_jump_x: i32 = 0,
238        0x3F begin_jump_y: i32 = 0,
239        0x47 pause: bool = false,
240        0x48 flying: bool = false,
241        0x49 sprite_name: DbStr<'a>,
242        0x4A sprite_id: i32 = 0,
243        0x4B processed: bool = false,
244        0x51 flash_red: i32 = -1,
245        0x52 flash_green: i32 = -1,
246        0x53 flash_blue: i32 = -1,
247        0x54 flash_current_level: f64 = 0.0,
248        0x55 flash_time_left: i32 = 0,
249        0xC9 easyrpg_move_failure_count: i32 = 0,
250        0xCA easyrpg_clone_map_id: u32 = 0,
251        0xCB easyrpg_clone_event_id: u32 = 0,
252        0xCC easyrpg_runtime_flags: EasyRpgEventRuntimeFlags,
253        0x65 boarding: bool = false,
254        0x66 aboard: bool = false,
255        0x67 vehicle: SavePartyLocationVehicleType = SavePartyLocationVehicleType(0),
256        0x68 unboarding: bool = false,
257        0x69 preboard_move_speed: i32 = 4,
258        0x6C menu_calling: bool = false,
259        0x6F pan_state: SavePartyLocationPanState = SavePartyLocationPanState(1),
260        0x70 pan_current_x: i32 = 2304,
261        0x71 pan_current_y: i32 = 1792,
262        0x72 pan_finish_x: i32 = 2304,
263        0x73 pan_finish_y: i32 = 1792,
264        0x79 pan_speed: i32 = 16,
265        0x7C total_encounter_rate: i32 = 0,
266        0x7D encounter_calling: bool = false,
267        0x83 map_save_count: i32 = 0,
268        0x84 database_save_count: i32 = 0,
269        0x8D maniac_horizontal_pan_speed: f64 = 0.0,
270        0x8E maniac_vertical_pan_speed: f64 = 0.0,
271    }
272}
273
274lcf_strings!(SavePartyLocation<'a> { sprite_name });
275
276lcf_struct! {
277    #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
278    #[cfg_attr(feature = "serde", serde(bound(deserialize = "")))]
279    pub struct SaveVehicleLocation<'a> {
280        0x01 active: bool = true,
281        0x0B map_id: i32 = 0, persist,
282        0x0C position_x: i32 = 0, persist,
283        0x0D position_y: i32 = 0, persist,
284        0x15 direction: i32 = 2, persist,
285        0x16 facing: i32 = 2, persist,
286        0x17 anim_frame: i32 = 1,
287        0x18 transparency: i32 = 0,
288        0x1F remaining_step: i32 = 0,
289        0x20 move_frequency: i32 = 2,
290        0x21 layer: i32 = 1, persist,
291        0x22 overlap_forbidden: bool = false,
292        0x23 animation_type: EventPageAnimType = EventPageAnimType(0), persist,
293        0x24 lock_facing: bool = false,
294        0x25 move_speed: i32 = 4, persist,
295        0x29 move_route: MoveRoute<'a>, persist,
296        0x2A move_route_overwrite: bool = false,
297        0x2B move_route_index: i32 = 0,
298        0x2C move_route_finished: bool = false,
299        0x2E sprite_hidden: bool = false,
300        0x2F move_route_through: bool = false,
301        0x30 anim_paused: i32 = 0,
302        0x33 through: bool = false,
303        0x34 stop_count: i32 = 0,
304        0x35 anim_count: i32 = 0,
305        0x36 max_stop_count: i32 = 0,
306        0x3D jumping: bool = false,
307        0x3E begin_jump_x: i32 = 0,
308        0x3F begin_jump_y: i32 = 0,
309        0x47 pause: bool = false,
310        0x48 flying: bool = false,
311        0x49 sprite_name: DbStr<'a>,
312        0x4A sprite_id: i32 = 0,
313        0x4B processed: bool = false,
314        0x51 flash_red: i32 = -1,
315        0x52 flash_green: i32 = -1,
316        0x53 flash_blue: i32 = -1,
317        0x54 flash_current_level: f64 = 0.0,
318        0x55 flash_time_left: i32 = 0,
319        0xC9 easyrpg_move_failure_count: i32 = 0,
320        0xCA easyrpg_clone_map_id: u32 = 0,
321        0xCB easyrpg_clone_event_id: u32 = 0,
322        0xCC easyrpg_runtime_flags: EasyRpgEventRuntimeFlags,
323        0x65 vehicle: SaveVehicleLocationVehicleType = SaveVehicleLocationVehicleType(0),
324        0x6A remaining_ascent: i32 = 0,
325        0x6B remaining_descent: i32 = 0,
326        0x6F orig_sprite_name: DbStr<'a>,
327        0x70 orig_sprite_id: i32 = 0,
328    }
329}
330
331lcf_strings!(SaveVehicleLocation<'a> { sprite_name, orig_sprite_name });
332
333lcf_struct! {
334    #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
335    #[cfg_attr(feature = "serde", serde(bound(deserialize = "")))]
336    pub struct SaveActor<'a> indexed {
337        0x01 name: DbStr<'a> = DbStr::from_bytes(b"\x01"), persist,
338        0x02 title: DbStr<'a> = DbStr::from_bytes(b"\x01"), persist,
339        0x0B sprite_name: DbStr<'a>,
340        0x0C sprite_id: i32 = 0,
341        0x0D transparency: i32 = 0,
342        0x15 face_name: DbStr<'a>,
343        0x16 face_id: i32 = 0,
344        0x1F level: i32 = -1,
345        0x20 exp: i32 = -1,
346        0x21 hp_mod: i32 = -1,
347        0x22 sp_mod: i32 = -1,
348        0x29 attack_mod: i32 = 0,
349        0x2A defense_mod: i32 = 0,
350        0x2B spirit_mod: i32 = 0,
351        0x2C agility_mod: i32 = 0,
352        0x34 skills: Packed<i16>, count_persist = 0x33, persist,
353        0x3D equipped: Packed<i16> = Packed(alloc::vec![0i16; 5]), persist,
354        0x47 current_hp: i32 = -1,
355        0x48 current_sp: i32 = -1,
356        0x50 battle_commands: Packed<i32> = Packed(alloc::vec![-1i32; 7]), persist, is2k3,
357        0x52 status: Packed<i16>, count = 0x51, persist,
358        0x53 changed_battle_commands: bool = false,
359        0x5A class_id: i32 = -1,
360        0x5B row: SaveActorRowType = SaveActorRowType(0), is2k3,
361        0x5C two_weapon: bool = false, is2k3,
362        0x5D lock_equipment: bool = false, is2k3,
363        0x5E auto_battle: bool = false, is2k3,
364        0x5F super_guard: bool = false, is2k3,
365        0x60 battler_animation: i32 = 0, is2k3,
366    }
367}
368
369lcf_strings!(SaveActor<'a> { name, title, sprite_name, face_name });
370
371lcf_struct! {
372    #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
373    pub struct SaveInventory {
374        0x02 party: Packed<i16>, count_persist = 0x01, persist,
375        0x0C item_ids: Packed<i16>, count_persist = 0x0B, persist,
376        0x0D item_counts: Packed<u8>, persist,
377        0x0E item_usage: Packed<u8>, persist,
378        0x15 gold: i32 = 0,
379        0x17 timer1_frames: i32 = 0,
380        0x18 timer1_active: bool = false,
381        0x19 timer1_visible: bool = false,
382        0x1A timer1_battle: bool = false,
383        0x1B timer2_frames: i32 = 0,
384        0x1C timer2_active: bool = false,
385        0x1D timer2_visible: bool = false,
386        0x1E timer2_battle: bool = false,
387        0x20 battles: i32 = 0,
388        0x21 defeats: i32 = 0,
389        0x22 escapes: i32 = 0,
390        0x23 victories: i32 = 0,
391        0x29 turns: i32 = 0,
392        0x2A steps: i32 = 0,
393    }
394}
395
396lcf_struct! {
397    #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
398    pub struct SaveTarget indexed {
399        0x01 map_id: i32 = 0,
400        0x02 map_x: i32 = 0,
401        0x03 map_y: i32 = 0,
402        0x04 switch_on: bool = false,
403        0x05 switch_id: i32 = 0,
404    }
405}
406
407lcf_struct! {
408    #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
409    #[cfg_attr(feature = "serde", serde(bound(deserialize = "")))]
410    pub struct SaveEventExecFrame<'a> indexed {
411        0x02 commands: EventCommandList<'a>, size_persist = 0x01, persist,
412        0x0B current_command: i32 = 0,
413        0x0C event_id: i32 = 0,
414        0x0D triggered_by_decision_key: bool = false,
415        0x16 subcommand_path: Packed<u8>, size = 0x15, persist,
416        0x0E maniac_event_info: i32 = 0,
417        0x0F maniac_event_id: i32 = 0,
418        0x10 maniac_event_page_id: i32 = 0,
419        0x11 maniac_loop_info_size: i32 = 0,
420        0x12 maniac_loop_info: Packed<i32>,
421        0xCC easyrpg_runtime_flags: EasyRpgFrameRuntimeFlags,
422    }
423}
424
425lcf_struct! {
426    #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
427    #[cfg_attr(feature = "serde", serde(bound(deserialize = "")))]
428    pub struct SaveEventExecState<'a> {
429        0x01 stack: List<SaveEventExecFrame<'a>>, persist,
430        0x04 show_message: bool = false,
431        0x0B abort_on_escape: bool = false,
432        0x0D wait_movement: bool = false,
433        0x15 keyinput_wait: bool = false,
434        0x16 keyinput_variable: u8 = 0,
435        0x17 keyinput_all_directions: bool = false,
436        0x18 keyinput_decision: i32 = 0,
437        0x19 keyinput_cancel: i32 = 0,
438        0x1A keyinput_2kshift_2k3numbers: i32 = 0,
439        0x1B keyinput_2kdown_2k3operators: i32 = 0,
440        0x1C keyinput_2kleft_2k3shift: i32 = 0,
441        0x1D keyinput_2kright: i32 = 0,
442        0x1E keyinput_2kup: i32 = 0,
443        0x1F wait_time: i32 = 0,
444        0x20 keyinput_time_variable: i32 = 0,
445        0x23 keyinput_2k3down: i32 = 0,
446        0x24 keyinput_2k3left: i32 = 0,
447        0x25 keyinput_2k3right: i32 = 0,
448        0x26 keyinput_2k3up: i32 = 0,
449        0x29 keyinput_timed: bool = false,
450        0x2A wait_key_enter: bool = false,
451        0xC9 easyrpg_active: bool = false,
452        0xCA easyrpg_string: DbStr<'a>,
453        0xCB easyrpg_parameters: Packed<i32>,
454        0xCC easyrpg_runtime_flags: EasyRpgStateRuntimeFlags,
455    }
456}
457
458lcf_strings!(SaveEventExecState<'a> { easyrpg_string });
459
460lcf_struct! {
461    #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
462    #[cfg_attr(feature = "serde", serde(bound(deserialize = "")))]
463    pub struct SaveMapEvent<'a> indexed {
464        0x01 active: bool = true,
465        0x0B map_id: i32 = 0, persist,
466        0x0C position_x: i32 = 0, persist,
467        0x0D position_y: i32 = 0, persist,
468        0x15 direction: i32 = 2, persist,
469        0x16 facing: i32 = 2, persist,
470        0x17 anim_frame: i32 = 1,
471        0x18 transparency: i32 = 0,
472        0x1F remaining_step: i32 = 0,
473        0x20 move_frequency: i32 = 2,
474        0x21 layer: i32 = 1, persist,
475        0x22 overlap_forbidden: bool = false,
476        0x23 animation_type: EventPageAnimType = EventPageAnimType(0), persist,
477        0x24 lock_facing: bool = false,
478        0x25 move_speed: i32 = 4, persist,
479        0x29 move_route: MoveRoute<'a>, persist,
480        0x2A move_route_overwrite: bool = false,
481        0x2B move_route_index: i32 = 0,
482        0x2C move_route_finished: bool = false,
483        0x2E sprite_hidden: bool = false,
484        0x2F move_route_through: bool = false,
485        0x30 anim_paused: i32 = 0,
486        0x33 through: bool = false,
487        0x34 stop_count: i32 = 0,
488        0x35 anim_count: i32 = 0,
489        0x36 max_stop_count: i32 = 0,
490        0x3D jumping: bool = false,
491        0x3E begin_jump_x: i32 = 0,
492        0x3F begin_jump_y: i32 = 0,
493        0x47 pause: bool = false,
494        0x48 flying: bool = false,
495        0x49 sprite_name: DbStr<'a>,
496        0x4A sprite_id: i32 = 0,
497        0x4B processed: bool = false,
498        0x51 flash_red: i32 = -1,
499        0x52 flash_green: i32 = -1,
500        0x53 flash_blue: i32 = -1,
501        0x54 flash_current_level: f64 = 0.0,
502        0x55 flash_time_left: i32 = 0,
503        0xC9 easyrpg_move_failure_count: i32 = 0,
504        0xCA easyrpg_clone_map_id: u32 = 0,
505        0xCB easyrpg_clone_event_id: u32 = 0,
506        0xCC easyrpg_runtime_flags: EasyRpgEventRuntimeFlags,
507        0x65 waiting_execution: bool = false,
508        0x66 original_move_route_index: i32 = 0,
509        0x67 triggered_by_decision_key: bool = false,
510        0x6C parallel_event_execstate: SaveEventExecState<'a>, persist,
511    }
512}
513
514lcf_strings!(SaveMapEvent<'a> { sprite_name });
515
516lcf_struct! {
517    #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
518    #[cfg_attr(feature = "serde", serde(bound(deserialize = "")))]
519    pub struct SaveMapInfo<'a> {
520        0x01 position_x: i32 = 0,
521        0x02 position_y: i32 = 0,
522        0x03 encounter_steps: i32 = -1,
523        0x05 chipset_id: i32 = 0,
524        0x0B events: List<SaveMapEvent<'a>>, persist,
525        0x15 lower_tiles: Packed<u8> = Packed(alloc::vec![0, 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]), persist,
526        0x16 upper_tiles: Packed<u8> = Packed(alloc::vec![0, 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]), persist,
527        0x20 parallax_name: DbStr<'a>,
528        0x21 parallax_horz: bool = false,
529        0x22 parallax_vert: bool = false,
530        0x23 parallax_horz_auto: bool = false,
531        0x24 parallax_horz_speed: i32 = 0,
532        0x25 parallax_vert_auto: bool = false,
533        0x26 parallax_vert_speed: i32 = 0,
534    }
535}
536
537lcf_strings!(SaveMapInfo<'a> { parallax_name });
538
539lcf_struct! {
540    #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
541    #[cfg_attr(feature = "serde", serde(bound(deserialize = "")))]
542    pub struct SaveCommonEvent<'a> indexed {
543        0x01 parallel_event_execstate: SaveEventExecState<'a>, persist,
544    }
545}
546
547lcf_struct! {
548    #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
549    pub struct SavePanorama {
550        0x01 pan_x: i32 = 0,
551        0x02 pan_y: i32 = 0,
552    }
553}
554
555lcf_struct! {
556    #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
557    #[cfg_attr(feature = "serde", serde(bound(deserialize = "")))]
558    pub struct Save<'a> {
559        0x64 title: SaveTitle<'a>,
560        0x65 system: SaveSystem<'a>, persist,
561        0x66 screen: SaveScreen, persist,
562        0x67 pictures: List<SavePicture<'a>>, persist,
563        0x68 party_location: SavePartyLocation<'a>, persist,
564        0x69 boat_location: SaveVehicleLocation<'a>, persist,
565        0x6A ship_location: SaveVehicleLocation<'a>, persist,
566        0x6B airship_location: SaveVehicleLocation<'a>, persist,
567        0x6C actors: List<SaveActor<'a>>, persist,
568        0x6D inventory: SaveInventory, persist,
569        0x6E targets: List<SaveTarget>, persist,
570        0x6F map_info: SaveMapInfo<'a>, persist,
571        0x70 panorama: SavePanorama, persist,
572        0x71 foreground_event_execstate: SaveEventExecState<'a>, persist,
573        0x72 common_events: List<SaveCommonEvent<'a>>, persist,
574        0xC8 easyrpg_data: SaveEasyRpgData<'a>,
575    }
576}
577
578lcf_struct! {
579    #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
580    #[cfg_attr(feature = "serde", serde(bound(deserialize = "")))]
581    pub struct SaveEasyRpgData<'a> {
582        0x01 version: i32 = 0,
583        0x02 codepage: i32 = 0,
584        0x64 windows: List<SaveEasyRpgWindow<'a>>,
585    }
586}
587
588lcf_struct! {
589    #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
590    #[cfg_attr(feature = "serde", serde(bound(deserialize = "")))]
591    pub struct SaveEasyRpgWindow<'a> indexed {
592        0x01 texts: UnindexedList<SaveEasyRpgText<'a>>,
593        0x02 width: i32 = 0,
594        0x03 height: i32 = 0,
595        0x04 system_name: DbStr<'a>,
596        0x05 message_stretch: SystemStretch = SystemStretch(0),
597        0x06 flags: SaveEasyRpgWindowFlags = SaveEasyRpgWindowFlags { draw_frame: true, border_margin: true },
598    }
599}
600
601lcf_strings!(SaveEasyRpgWindow<'a> { system_name });
602
603lcf_struct! {
604    #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
605    #[cfg_attr(feature = "serde", serde(bound(deserialize = "")))]
606    pub struct SaveEasyRpgText<'a> {
607        0x01 text: DbStr<'a>,
608        0x02 position_x: i32 = 0,
609        0x03 position_y: i32 = 0,
610        0x04 font_name: DbStr<'a>,
611        0x05 font_size: i32 = 12,
612        0x06 letter_spacing: i32 = 0,
613        0x07 line_spacing: i32 = 4,
614        0x08 flags: SaveEasyRpgTextFlags = SaveEasyRpgTextFlags { draw_gradient: true, draw_shadow: true, ..SaveEasyRpgTextFlags::DEFAULT },
615    }
616}
617
618lcf_strings!(SaveEasyRpgText<'a> { text, font_name });