luminol_data/rmxp/
system.rs

1// Copyright (C) 2024 Melody Madeline Lyons
2//
3// This file is part of Luminol.
4//
5// Luminol is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// Luminol is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with Luminol.  If not, see <http://www.gnu.org/licenses/>.
17pub use crate::{
18    id_alox, id_serde, id_vec_alox, id_vec_serde, nil_padded_alox, nil_padded_serde,
19    optional_id_alox, optional_id_serde, optional_path_alox, optional_path_serde, rpg::AudioFile,
20    Path,
21};
22
23#[derive(Default, Debug)]
24#[derive(serde::Deserialize, serde::Serialize)]
25#[derive(alox_48::Deserialize, alox_48::Serialize)]
26#[serde(default)] // ??? rmxp???
27#[marshal(default)]
28#[marshal(class = "RPG::System")]
29pub struct System {
30    pub magic_number: i32,
31    #[serde(with = "id_vec_serde")]
32    #[marshal(with = "id_vec_alox")]
33    pub party_members: Vec<usize>,
34    pub elements: Vec<String>,
35    #[marshal(with = "nil_padded_alox")]
36    #[serde(with = "nil_padded_serde")]
37    pub switches: Vec<String>,
38    #[marshal(with = "nil_padded_alox")]
39    #[serde(with = "nil_padded_serde")]
40    pub variables: Vec<String>,
41
42    #[serde(with = "optional_path_serde")]
43    #[marshal(with = "optional_path_alox")]
44    pub windowskin_name: Path,
45    #[serde(with = "optional_path_serde")]
46    #[marshal(with = "optional_path_alox")]
47    pub title_name: Path,
48    #[serde(with = "optional_path_serde")]
49    #[marshal(with = "optional_path_alox")]
50    pub gameover_name: Path,
51    #[serde(with = "optional_path_serde")]
52    #[marshal(with = "optional_path_alox")]
53    pub battle_transition: Path,
54    pub title_bgm: AudioFile,
55    pub battle_bgm: AudioFile,
56    pub battle_end_me: AudioFile,
57    pub gameover_me: AudioFile,
58    pub cursor_se: AudioFile,
59    pub decision_se: AudioFile,
60    pub cancel_se: AudioFile,
61    pub buzzer_se: AudioFile,
62    pub equip_se: AudioFile,
63    pub shop_se: AudioFile,
64    pub save_se: AudioFile,
65    pub load_se: AudioFile,
66    pub battle_start_se: AudioFile,
67    pub escape_se: AudioFile,
68    pub actor_collapse_se: AudioFile,
69    pub enemy_collapse_se: AudioFile,
70    pub words: Words,
71    #[serde(skip)]
72    // #[marshal(skip)]
73    pub test_battlers: alox_48::Value,
74    #[serde(with = "optional_id_serde")]
75    #[marshal(with = "optional_id_alox")]
76    pub test_troop_id: Option<usize>,
77    #[serde(with = "id_serde")]
78    #[marshal(with = "id_alox")]
79    pub start_map_id: usize,
80    pub start_x: i32,
81    pub start_y: i32,
82    #[serde(with = "optional_path_serde")]
83    #[marshal(with = "optional_path_alox")]
84    pub battleback_name: Path,
85    #[serde(with = "optional_path_serde")]
86    #[marshal(with = "optional_path_alox")]
87    pub battler_name: Path,
88    pub battler_hue: i32,
89    pub edit_map_id: usize,
90
91    #[marshal(skip)]
92    #[serde(skip)]
93    pub modified: bool,
94}
95
96#[derive(Default, Debug, serde::Deserialize, serde::Serialize)]
97#[derive(alox_48::Deserialize, alox_48::Serialize)]
98#[marshal(class = "RPG::System::Words")]
99#[serde(default)]
100pub struct Words {
101    gold: String,
102    hp: String,
103    sp: String,
104    str: String,
105    dex: String,
106    agi: String,
107    int: String,
108    atk: String,
109    pdef: String,
110    mdef: String,
111    weapon: String,
112    armor1: String,
113    armor2: String,
114    armor3: String,
115    armor4: String,
116    attack: String,
117    skill: String,
118    guard: String,
119    item: String,
120    equip: String,
121}
122
123#[derive(Default, Debug, serde::Deserialize, serde::Serialize)]
124#[derive(alox_48::Deserialize, alox_48::Serialize)]
125#[marshal(class = "RPG::System::TestBattler")]
126pub struct TestBattler {
127    level: i32,
128
129    #[serde(with = "id_serde")]
130    #[marshal(with = "id_alox")]
131    actor_id: usize,
132    #[serde(with = "optional_id_serde")]
133    #[marshal(with = "optional_id_alox")]
134    weapon_id: Option<usize>,
135    #[serde(with = "optional_id_serde")]
136    #[marshal(with = "optional_id_alox")]
137    armor1_id: Option<usize>,
138    #[serde(with = "optional_id_serde")]
139    #[marshal(with = "optional_id_alox")]
140    armor2_id: Option<usize>,
141    #[serde(with = "optional_id_serde")]
142    #[marshal(with = "optional_id_alox")]
143    armor3_id: Option<usize>,
144    #[serde(with = "optional_id_serde")]
145    #[marshal(with = "optional_id_alox")]
146    armor4_id: Option<usize>,
147}