From b21603c1d77f57797473707b4b2e793a48e23eb9 Mon Sep 17 00:00:00 2001 From: jake Date: Tue, 31 Mar 2020 20:47:49 -0700 Subject: [PATCH 1/3] mag feeding charts --- data/item_stats/mag_feed_table.toml | 632 ++++++++++++++++++++++++++++ data/item_stats/mag_stats.toml | 242 +++++++++++ src/ship/item_stats.rs | 58 +++ 3 files changed, 932 insertions(+) create mode 100644 data/item_stats/mag_feed_table.toml create mode 100644 data/item_stats/mag_stats.toml diff --git a/data/item_stats/mag_feed_table.toml b/data/item_stats/mag_feed_table.toml new file mode 100644 index 0000000..cd69adc --- /dev/null +++ b/data/item_stats/mag_feed_table.toml @@ -0,0 +1,632 @@ +[[feedtable]] + +[feedtable.Monomate] +def = 5 +pow = 40 +dex = 5 +mnd = 0 +iq = 3 +syn = 3 +[feedtable.Dimate] +def = 10 +pow = 45 +dex = 5 +mnd = 0 +iq = 3 +syn = 3 +[feedtable.Trimate] +def = 15 +pow = 50 +dex = 10 +mnd = 0 +iq = 4 +syn = 4 +[feedtable.Monofluid] +def = 5 +pow = 0 +dex = 5 +mnd = 40 +iq = 3 +syn = 3 +[feedtable.Difluid] +def = 10 +pow = 0 +dex = 5 +mnd = 45 +iq = 3 +syn = 3 +[feedtable.Trifluid] +def = 15 +pow = 0 +dex = 10 +mnd = 50 +iq = 4 +syn = 4 +[feedtable.Antidote] +def = 5 +pow = 10 +dex = 40 +mnd = 0 +iq = 3 +syn = 3 +[feedtable.Antiparalysis] +def = 5 +pow = 0 +dex = 44 +mnd = 10 +iq = 3 +syn = 3 +[feedtable.SolAtomizer] +def = 15 +pow = 30 +dex = 15 +mnd = 25 +iq = 1 +syn = 4 +[feedtable.MoonAtomizer] +def = 15 +pow = 25 +dex = 15 +mnd = 30 +iq = 1 +syn = 4 +[feedtable.StarAtomizer] +def = 25 +pow = 25 +dex = 25 +mnd = 25 +iq = 5 +syn = 6 +[[feedtable]] + +[feedtable.Monomate] +def = 5 +pow = 10 +dex = 0 +mnd = -1 +iq = 0 +syn = 0 +[feedtable.Dimate] +def = 6 +pow = 15 +dex = 3 +mnd = -3 +iq = 1 +syn = 2 +[feedtable.Trimate] +def = 12 +pow = 21 +dex = 4 +mnd = -7 +iq = 2 +syn = 3 +[feedtable.Monofluid] +def = 5 +pow = 0 +dex = 0 +mnd = 8 +iq = 0 +syn = 0 +[feedtable.Difluid] +def = 7 +pow = 0 +dex = 3 +mnd = 13 +iq = 1 +syn = 2 +[feedtable.Trifluid] +def = 7 +pow = -7 +dex = 6 +mnd = 19 +iq = 2 +syn = 3 +[feedtable.Antidote] +def = 0 +pow = 5 +dex = 15 +mnd = 0 +iq = 1 +syn = 0 +[feedtable.Antiparalysis] +def = -1 +pow = 0 +dex = 14 +mnd = 5 +iq = 0 +syn = 2 +[feedtable.SolAtomizer] +def = 10 +pow = 11 +dex = 8 +mnd = 0 +iq = 2 +syn = -2 +[feedtable.MoonAtomizer] +def = 9 +pow = 0 +dex = 9 +mnd = 11 +iq = -2 +syn = 3 +[feedtable.StarAtomizer] +def = 14 +pow = 9 +dex = 18 +mnd = 11 +iq = 3 +syn = 4 +[[feedtable]] + +[feedtable.Monomate] +def = 1 +pow = 9 +dex = 0 +mnd = -5 +iq = -1 +syn = 0 +[feedtable.Dimate] +def = 1 +pow = 13 +dex = 0 +mnd = -10 +iq = 0 +syn = 3 +[feedtable.Trimate] +def = 8 +pow = 16 +dex = 2 +mnd = -15 +iq = 1 +syn = 4 +[feedtable.Monofluid] +def = 0 +pow = -5 +dex = 0 +mnd = 9 +iq = -1 +syn = 0 +[feedtable.Difluid] +def = 4 +pow = -10 +dex = 0 +mnd = 13 +iq = 0 +syn = 3 +[feedtable.Trifluid] +def = 6 +pow = -15 +dex = 5 +mnd = 17 +iq = 2 +syn = 3 +[feedtable.Antidote] +def = -5 +pow = 4 +dex = 12 +mnd = -5 +iq = 1 +syn = -1 +[feedtable.Antiparalysis] +def = -5 +pow = -6 +dex = 11 +mnd = 4 +iq = 0 +syn = 0 +[feedtable.SolAtomizer] +def = 0 +pow = 11 +dex = 3 +mnd = -5 +iq = -2 +syn = 4 +[feedtable.MoonAtomizer] +def = 4 +pow = -5 +dex = 0 +mnd = 11 +iq = 1 +syn = -1 +[feedtable.StarAtomizer] +def = 7 +pow = 8 +dex = 6 +mnd = 9 +iq = 2 +syn = 4 +[[feedtable]] + +[feedtable.Monomate] +def = 0 +pow = 3 +dex = 0 +mnd = 0 +iq = -1 +syn = 0 +[feedtable.Dimate] +def = 5 +pow = 7 +dex = 0 +mnd = -5 +iq = 0 +syn = 2 +[feedtable.Trimate] +def = 4 +pow = 14 +dex = 6 +mnd = -10 +iq = 1 +syn = 3 +[feedtable.Monofluid] +def = 0 +pow = 0 +dex = 0 +mnd = 4 +iq = 0 +syn = 0 +[feedtable.Difluid] +def = 4 +pow = -5 +dex = 0 +mnd = 8 +iq = 1 +syn = 0 +[feedtable.Trifluid] +def = 4 +pow = -10 +dex = 3 +mnd = 15 +iq = 2 +syn = 2 +[feedtable.Antidote] +def = 0 +pow = 0 +dex = 7 +mnd = 0 +iq = 3 +syn = -3 +[feedtable.Antiparalysis] +def = -4 +pow = -5 +dex = 20 +mnd = -5 +iq = 0 +syn = 3 +[feedtable.SolAtomizer] +def = -10 +pow = 9 +dex = 6 +mnd = 9 +iq = -2 +syn = 3 +[feedtable.MoonAtomizer] +def = 8 +pow = 5 +dex = -8 +mnd = 7 +iq = 2 +syn = -2 +[feedtable.StarAtomizer] +def = 7 +pow = 7 +dex = 7 +mnd = 7 +iq = 2 +syn = 3 +[[feedtable]] + +[feedtable.Monomate] +def = -5 +pow = 9 +dex = -5 +mnd = 0 +iq = -1 +syn = 2 +[feedtable.Dimate] +def = 0 +pow = 11 +dex = 0 +mnd = -10 +iq = 0 +syn = 2 +[feedtable.Trimate] +def = 4 +pow = 14 +dex = 0 +mnd = -15 +iq = 1 +syn = 0 +[feedtable.Monofluid] +def = -5 +pow = 0 +dex = -6 +mnd = 10 +iq = -1 +syn = 2 +[feedtable.Difluid] +def = 0 +pow = -10 +dex = 0 +mnd = 11 +iq = 0 +syn = 2 +[feedtable.Trifluid] +def = 4 +pow = -15 +dex = 0 +mnd = 15 +iq = 1 +syn = 0 +[feedtable.Antidote] +def = -5 +pow = -5 +dex = 16 +mnd = -5 +iq = -1 +syn = 2 +[feedtable.Antiparalysis] +def = 7 +pow = -3 +dex = 0 +mnd = -3 +iq = 3 +syn = -2 +[feedtable.SolAtomizer] +def = 5 +pow = 21 +dex = -5 +mnd = -20 +iq = -2 +syn = 4 +[feedtable.MoonAtomizer] +def = -5 +pow = -20 +dex = 5 +mnd = 21 +iq = 0 +syn = 3 +[feedtable.StarAtomizer] +def = 4 +pow = 6 +dex = 8 +mnd = 5 +iq = 2 +syn = 3 +[[feedtable]] + +[feedtable.Monomate] +def = -4 +pow = 13 +dex = -5 +mnd = -5 +iq = -1 +syn = 2 +[feedtable.Dimate] +def = 0 +pow = 16 +dex = 0 +mnd = -15 +iq = 1 +syn = 0 +[feedtable.Trimate] +def = 3 +pow = 19 +dex = -2 +mnd = -18 +iq = 0 +syn = 2 +[feedtable.Monofluid] +def = -4 +pow = -5 +dex = -5 +mnd = 13 +iq = -1 +syn = 2 +[feedtable.Difluid] +def = 0 +pow = -15 +dex = 0 +mnd = 16 +iq = 1 +syn = 0 +[feedtable.Trifluid] +def = 3 +pow = -20 +dex = 0 +mnd = 19 +iq = 0 +syn = 2 +[feedtable.Antidote] +def = 5 +pow = -6 +dex = 6 +mnd = -5 +iq = 1 +syn = 0 +[feedtable.Antiparalysis] +def = 0 +pow = -4 +dex = 14 +mnd = -10 +iq = 1 +syn = -1 +[feedtable.SolAtomizer] +def = 4 +pow = 17 +dex = -5 +mnd = -15 +iq = -1 +syn = 4 +[feedtable.MoonAtomizer] +def = -10 +pow = -15 +dex = 5 +mnd = 21 +iq = 0 +syn = 2 +[feedtable.StarAtomizer] +def = 2 +pow = 8 +dex = 3 +mnd = 6 +iq = 2 +syn = 3 +[[feedtable]] + +[feedtable.Monomate] +def = -3 +pow = 9 +dex = -3 +mnd = -4 +iq = 1 +syn = -1 +[feedtable.Dimate] +def = 0 +pow = 11 +dex = 0 +mnd = -10 +iq = 0 +syn = 2 +[feedtable.Trimate] +def = 2 +pow = 15 +dex = 0 +mnd = -16 +iq = 0 +syn = 2 +[feedtable.Monofluid] +def = -3 +pow = -4 +dex = -3 +mnd = 9 +iq = 1 +syn = -1 +[feedtable.Difluid] +def = 0 +pow = -10 +dex = 0 +mnd = 11 +iq = 0 +syn = 2 +[feedtable.Trifluid] +def = -2 +pow = -15 +dex = 0 +mnd = 19 +iq = 0 +syn = 2 +[feedtable.Antidote] +def = 0 +pow = 6 +dex = 9 +mnd = -15 +iq = -1 +syn = 2 +[feedtable.Antiparalysis] +def = 0 +pow = -15 +dex = 9 +mnd = 6 +iq = 3 +syn = -2 +[feedtable.SolAtomizer] +def = 9 +pow = -20 +dex = -5 +mnd = 17 +iq = -1 +syn = 3 +[feedtable.MoonAtomizer] +def = -5 +pow = 20 +dex = 5 +mnd = -20 +iq = 2 +syn = 0 +[feedtable.StarAtomizer] +def = 0 +pow = 11 +dex = 0 +mnd = 11 +iq = 2 +syn = 3 +[[feedtable]] + +[feedtable.Monomate] +def = -4 +pow = 21 +dex = -15 +mnd = -5 +iq = 0 +syn = -1 +[feedtable.Dimate] +def = -1 +pow = 27 +dex = -10 +mnd = -16 +iq = 1 +syn = 0 +[feedtable.Trimate] +def = 5 +pow = 29 +dex = -7 +mnd = -25 +iq = 0 +syn = 2 +[feedtable.Monofluid] +def = -10 +pow = -5 +dex = -10 +mnd = 21 +iq = 0 +syn = -1 +[feedtable.Difluid] +def = -5 +pow = -16 +dex = -5 +mnd = 25 +iq = 1 +syn = 0 +[feedtable.Trifluid] +def = -7 +pow = -25 +dex = 6 +mnd = 29 +iq = 0 +syn = 2 +[feedtable.Antidote] +def = -10 +pow = -10 +dex = 28 +mnd = -10 +iq = 1 +syn = -1 +[feedtable.Antiparalysis] +def = 9 +pow = -18 +dex = 24 +mnd = -15 +iq = -1 +syn = 2 +[feedtable.SolAtomizer] +def = 19 +pow = 18 +dex = -15 +mnd = -20 +iq = 1 +syn = 2 +[feedtable.MoonAtomizer] +def = -15 +pow = -20 +dex = 19 +mnd = 18 +iq = 1 +syn = 2 +[feedtable.StarAtomizer] +def = 3 +pow = 7 +dex = 3 +mnd = 3 +iq = 2 +syn = 4 diff --git a/data/item_stats/mag_stats.toml b/data/item_stats/mag_stats.toml new file mode 100644 index 0000000..19aea11 --- /dev/null +++ b/data/item_stats/mag_stats.toml @@ -0,0 +1,242 @@ +[Mag] +feed_table = 0 + +[Varuna] +feed_table = 1 + +[Mitra] +feed_table = 3 + +[Surya] +feed_table = 3 + +[Vayu] +feed_table = 4 + +[Varaha] +feed_table = 4 + +[Kama] +feed_table = 4 + +[Ushasu] +feed_table = 4 + +[Apsaras] +feed_table = 4 + +[Kumara] +feed_table = 4 + +[Kaitabha] +feed_table = 4 + +[Tapas] +feed_table = 3 + +[Bhirava] +feed_table = 4 + +[Kalki] +feed_table = 1 + +[Rudra] +feed_table = 2 + +[Marutah] +feed_table = 2 + +[Yaksa] +feed_table = 5 + +[Sita] +feed_table = 5 + +[Garuda] +feed_table = 5 + +[Nandin] +feed_table = 5 + +[Ashvinau] +feed_table = 2 + +[Ribhava] +feed_table = 5 + +[Soma] +feed_table = 5 + +[Ila] +feed_table = 5 + +[Durga] +feed_table = 5 + +[Vritra] +feed_table = 1 + +[Namuci] +feed_table = 2 + +[Sumba] +feed_table = 2 + +[Naga] +feed_table = 6 + +[Pitri] +feed_table = 7 + +[Kabanda] +feed_table = 6 + +[Ravana] +feed_table = 6 + +[Marica] +feed_table = 6 + +[Soniti] +feed_table = 7 + +[Preta] +feed_table = 7 + +[Andhaka] +feed_table = 6 + +[Bana] +feed_table = 6 + +[Naraka] +feed_table = 6 + +[Madhu] +feed_table = 6 + +[Churel] +feed_table = 7 + +[Robochao] +feed_table = 7 + +[OpaOpa] +feed_table = 7 + +[Pian] +feed_table = 7 + +[Chao] +feed_table = 7 + +[ChuChu] +feed_table = 7 + +[KapuKapu] +feed_table = 7 + +[AngelsWing] +feed_table = 7 + +[DevilsWing] +feed_table = 7 + +[Elenor] +feed_table = 7 + +[Mark3] +feed_table = 7 + +[MasterSystem] +feed_table = 7 + +[Genesis] +feed_table = 7 + +[SegaSaturn] +feed_table = 7 + +[Dreamcast] +feed_table = 7 + +[Hamburger] +feed_table = 7 + +[PanzersTail] +feed_table = 7 + +[DevilsTail] +feed_table = 7 + +[Deva] +feed_table = 5 + +[Rati] +feed_table = 6 + +[Savitri] +feed_table = 7 + +[Rukmin] +feed_table = 5 + +[Pushan] +feed_table = 6 + +[Diwari] +feed_table = 7 + +[Sato] +feed_table = 5 + +[Bhima] +feed_table = 6 + +[Nidra] +feed_table = 7 + +[GeungSi] +feed_table = 7 + +[Tellusis] +feed_table = 7 + +[StrikerUnit] +feed_table = 7 + +[Pioneer] +feed_table = 7 + +[Puyo] +feed_table = 7 + +[Moro] +feed_table = 7 + +[Rappy] +feed_table = 7 + +[Yahoo] +feed_table = 7 + +[GaelGiel] +feed_table = 7 + +[Agastya] +feed_table = 7 + +[CellOfMag0503] +feed_table = 7 + +[CellOfMag0504] +feed_table = 7 + +[CellOfMag0505] +feed_table = 7 + +[CellOfMag0506] +feed_table = 7 + +[CellOfMag0507] +feed_table = 7 diff --git a/src/ship/item_stats.rs b/src/ship/item_stats.rs index ff3f95f..a46f63c 100644 --- a/src/ship/item_stats.rs +++ b/src/ship/item_stats.rs @@ -6,6 +6,8 @@ use std::io::Read; use crate::entity::item::armor::ArmorType; use crate::entity::item::shield::ShieldType; use crate::entity::item::unit::UnitType; +use crate::entity::item::mag::MagType; +use crate::entity::item::tool::ToolType; fn load_data_file(path: &str) -> T { @@ -62,6 +64,26 @@ pub struct UnitStats { pub modifier: u32, } +#[derive(Debug, Copy, Clone, Serialize, Deserialize)] +pub struct MagStats { + pub feed_table: u32, +} + +#[derive(Debug, Copy, Clone, Serialize, Deserialize)] +pub struct MagFeedStats { + def: i8, + pow: i8, + dex: i8, + mnd: i8, + iq: i8, + syn: i8, +} + +#[derive(Debug)] +pub struct MagFeedTable(HashMap); + +#[derive(Debug)] +pub struct MagFeedTables(Vec); pub fn armor_stats() -> HashMap { let armor_stats: HashMap = load_data_file("data/item_stats/armor_stats.toml"); @@ -87,6 +109,28 @@ pub fn unit_stats() -> BTreeMap { }).collect() } +pub fn mag_stats() -> HashMap { + let mag_stats: BTreeMap = load_data_file("data/item_stats/mag_stats.toml"); + mag_stats.iter() + .inspect(|k| println!("{:?}", k)) + .map(|(name, stats)| { + (name.parse().unwrap(), *stats) + }).collect() +} + +pub fn mag_feed_tables() -> MagFeedTables { + let mag_feed_tables: BTreeMap>> = load_data_file("data/item_stats/mag_feed_table.toml"); + + MagFeedTables(mag_feed_tables.get("feedtable").unwrap().into_iter() + .map(|feed_table| { + MagFeedTable(feed_table.into_iter() + .map(|(tool, feed_stats)| { + (tool.parse().unwrap(), *feed_stats) + }).collect()) + }).collect()) +} + + #[cfg(test)] mod test { use super::*; @@ -108,4 +152,18 @@ mod test { let ustat = unit_stats(); assert!(ustat.get(&UnitType::ElfArm).unwrap().stars == 5); } + + #[test] + fn test_mag_stats() { + let mstats = mag_stats(); + assert!(mstats[&MagType::Sato].feed_table== 5); + assert!(mstats[&MagType::Nidra].feed_table == 7); + } + + #[test] + fn test_mag_feed_tables() { + let mfeed = mag_feed_tables(); + assert!(mfeed.0[7].0[&ToolType::Monomate].pow == 21); + assert!(mfeed.0[5].0[&ToolType::MoonAtomizer].syn== 2); + } } From 7e7920d1f5ac241c8051ece2c595f1f9e3a4c6d9 Mon Sep 17 00:00:00 2001 From: jake Date: Tue, 31 Mar 2020 21:00:16 -0700 Subject: [PATCH 2/3] remove weird non-mags --- data/item_stats/mag_stats.toml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/data/item_stats/mag_stats.toml b/data/item_stats/mag_stats.toml index 19aea11..46cef36 100644 --- a/data/item_stats/mag_stats.toml +++ b/data/item_stats/mag_stats.toml @@ -225,18 +225,3 @@ feed_table = 7 [Agastya] feed_table = 7 - -[CellOfMag0503] -feed_table = 7 - -[CellOfMag0504] -feed_table = 7 - -[CellOfMag0505] -feed_table = 7 - -[CellOfMag0506] -feed_table = 7 - -[CellOfMag0507] -feed_table = 7 From 8d86cf308882ad7f395c067995faf8e2bb3fb8eb Mon Sep 17 00:00:00 2001 From: jake Date: Tue, 31 Mar 2020 21:15:01 -0700 Subject: [PATCH 3/3] mag naming --- data/item_stats/mag_stats.toml | 2 +- src/entity/item/mag.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/data/item_stats/mag_stats.toml b/data/item_stats/mag_stats.toml index 46cef36..dae1905 100644 --- a/data/item_stats/mag_stats.toml +++ b/data/item_stats/mag_stats.toml @@ -145,7 +145,7 @@ feed_table = 7 [Elenor] feed_table = 7 -[Mark3] +[MarkIII] feed_table = 7 [MasterSystem] diff --git a/src/entity/item/mag.rs b/src/entity/item/mag.rs index 7aa9583..fc9fc5e 100644 --- a/src/entity/item/mag.rs +++ b/src/entity/item/mag.rs @@ -69,7 +69,7 @@ pub enum MagType { Sato, Bhima, Nidra, - Geungsi, + GeungSi, Tellusis, StrikerUnit, Pioneer, @@ -150,7 +150,7 @@ impl MagType { MagType::Sato => [0x02, 0x3F, 0x00], MagType::Bhima => [0x02, 0x40, 0x00], MagType::Nidra => [0x02, 0x41, 0x00], - MagType::Geungsi => [0x02, 0x42, 0x00], + MagType::GeungSi => [0x02, 0x42, 0x00], MagType::Tellusis => [0x02, 0x44, 0x00], MagType::StrikerUnit => [0x02, 0x45, 0x00], MagType::Pioneer => [0x02, 0x46, 0x00],