Skip to content

Commit

Permalink
Add d7 HospitalGachaData db
Browse files Browse the repository at this point in the history
  • Loading branch information
HybridEidolon committed Nov 1, 2023
1 parent 7dd304d commit cf94fcb
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 0 deletions.
1 change: 1 addition & 0 deletions databases-d7/examples/d7db-unpack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ fn main() -> Result<(), anyhow::Error> {
unpack_db::<_, DrinkData>(&mut archive, "drink", &dest)?;
unpack_db::<_, DungeonData>(&mut archive, "dungeon", &dest)?;
unpack_db::<_, EvilityData>(&mut archive, "evility", &dest)?;
unpack_db::<_, HospitalGachaData>(&mut archive, "hospitalgacha", &dest)?;
unpack_db::<_, InnocentAffinityData>(&mut archive, "innocentaffinity", &dest)?;
unpack_db::<_, InnocentData>(&mut archive, "innocent", &dest)?;
unpack_db::<_, ItemData>(&mut archive, "item", &dest)?;
Expand Down
61 changes: 61 additions & 0 deletions databases-d7/src/hospitalgacha.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
use crate::CmlString;
use makaikit_databases_serde::DatabaseRecord;
use serde::{Deserialize, Serialize};

#[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct Complete {
pub r#type: i32,
pub val1: i32,
pub val2: i32,
}

#[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct Info {
pub r#type: i32,
pub val1: i32,
pub val2: i32,

#[serde(rename = "identificationID")]
pub identification_id: i32,

pub rate: i32,
pub is_complete: i32,
}

#[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct HospitalGachaData {
#[serde(rename = "ID")]
pub id: i32,

pub enum_name: String,
pub comment: String,
pub name: CmlString,
pub help: CmlString,
pub consume_point: i32,
pub info: Vec<Info>,
pub info2: Vec<Info>,
pub complete: Complete,
pub complete2: Complete,
pub cond_on_flag: Vec<i32>,
pub cond_off_flag: Vec<i32>,
pub open_flag: i32,
pub on_flag_when_complete: i32,

pub version: i32,
pub region: u32,
pub product: u32,
pub platform: u32,
}

impl DatabaseRecord for HospitalGachaData {
fn database_id(&self) -> i32 {
self.id
}

fn database_enum_name(&self) -> &str {
&self.enum_name
}
}
2 changes: 2 additions & 0 deletions databases-d7/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pub mod doping;
pub mod drink;
pub mod dungeon;
pub mod evility;
pub mod hospitalgacha;
pub mod innocent;
pub mod innocentaffinity;
pub mod item;
Expand Down Expand Up @@ -59,6 +60,7 @@ pub use self::doping::DopingData;
pub use self::drink::DrinkData;
pub use self::dungeon::DungeonData;
pub use self::evility::EvilityData;
pub use self::hospitalgacha::HospitalGachaData;
pub use self::innocent::InnocentData;
pub use self::innocentaffinity::InnocentAffinityData;
pub use self::item::ItemData;
Expand Down
1 change: 1 addition & 0 deletions modloader-d7/src/win.rs
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,7 @@ fn repack_databases() {
repack_database::<_, DrinkData>(&mut archive, "drink");
repack_database::<_, DungeonData>(&mut archive, "dungeon");
repack_database::<_, EvilityData>(&mut archive, "evility");
repack_database::<_, HospitalGachaData>(&mut archive, "hospitalgacha");
repack_database::<_, InnocentAffinityData>(&mut archive, "innocentaffinity");
repack_database::<_, InnocentData>(&mut archive, "innocent");
repack_database::<_, ItemData>(&mut archive, "item");
Expand Down

0 comments on commit cf94fcb

Please sign in to comment.