diff --git a/src/ship/drops/mod.rs b/src/ship/drops/mod.rs index 9887e7e..b76d740 100644 --- a/src/ship/drops/mod.rs +++ b/src/ship/drops/mod.rs @@ -113,18 +113,10 @@ pub struct DropTable { impl DropTable { pub fn new(episode: Episode, difficulty: Difficulty, section_id: SectionID) -> DropTable { - let mut path = PathBuf::from("data/drops/"); - path.push(episode.to_string()); - path.push(difficulty.to_string().to_lowercase()); - path.push(section_id.to_string().to_lowercase()); - path.push("grind_rate.toml"); - let mut f = File::open(path).unwrap(); - let mut s = String::new(); - f.read_to_string(&mut s); - let monster_stats = toml::from_str(&s).unwrap(); + let monster_stats: HashMap = load_data_file(episode, difficulty, section_id, "monster_dar.toml"); DropTable { - monster_stats: monster_stats, + monster_stats: monster_stats.into_iter().map(|(m, s)| (m.parse().unwrap(), s)).collect(), rare_table: RareDropTable::new(episode, difficulty, section_id), weapon_table: GenericWeaponTable::new(episode, difficulty, section_id), armor_table: GenericArmorTable::new(episode, difficulty, section_id),