Battle monster waves configuration with globals.json

This commit is contained in:
xeon 2024-03-29 15:16:29 +03:00
parent 11dad98c7b
commit 84984f2da6
6 changed files with 2165 additions and 7 deletions

View file

@ -1,3 +1,8 @@
{ {
"lineup": [1309, 1308, 1307, 1315] "lineup": [1309, 1308, 1307, 1315],
"monster_wave_list":
[
[3013010, 3013010],
[3024020]
]
} }

View file

@ -32,4 +32,5 @@ lazy_static! {
#[derive(Deserialize)] #[derive(Deserialize)]
pub struct Globals { pub struct Globals {
pub lineup: Vec<u32>, pub lineup: Vec<u32>,
pub monster_wave_list: Vec<Vec<u32>>,
} }

View file

@ -33,13 +33,20 @@ pub async fn on_start_cocoon_stage_cs_req(
..Default::default() ..Default::default()
}) })
.collect(), .collect(),
monster_wave_list: vec![SceneMonsterWave { monster_wave_list: globals
monster_list: vec![SceneMonsterParam { .monster_wave_list
monster_id: 3013010, .iter()
.map(|monster_list| SceneMonsterWave {
monster_list: monster_list
.iter()
.map(|id| SceneMonsterParam {
monster_id: *id,
..Default::default()
})
.collect(),
..Default::default() ..Default::default()
}], })
..Default::default() .collect(),
}],
..Default::default() ..Default::default()
}), }),
}; };

View file

@ -6,6 +6,7 @@ version.workspace = true
[dependencies] [dependencies]
prost.workspace = true prost.workspace = true
prost-types.workspace = true prost-types.workspace = true
serde.workspace = true
[build-dependencies] [build-dependencies]
prost-build.workspace = true prost-build.workspace = true

View file

@ -5,6 +5,7 @@ pub fn main() {
prost_build::Config::new() prost_build::Config::new()
.out_dir("out/") .out_dir("out/")
.type_attribute(".", "#[derive(serde::Serialize, serde::Deserialize)]")
.compile_protos(&[proto_file], &["."]) .compile_protos(&[proto_file], &["."])
.unwrap(); .unwrap();
} }

File diff suppressed because it is too large Load diff