fix test; add tusk, crest, pincer

This commit is contained in:
Christof Petig 2022-07-10 17:22:49 +02:00
parent 8c5901516e
commit 5ee72f8a5e
2 changed files with 27 additions and 21 deletions

View File

@ -30,8 +30,11 @@
(4.0, Item("common.items.crafting_ing.hide.animal_hide")),
// Mob Drops
(0.10, Item("common.items.crafting_ing.animal_misc.long_tusk")),
(0.15, Item("common.items.crafting_ing.animal_misc.elegant_crest")),
(0.15, Item("common.items.crafting_ing.animal_misc.grim_eyeball")),
(0.15, Item("common.items.crafting_ing.animal_misc.icy_fang")),
(0.2, Item("common.items.crafting_ing.animal_misc.strong_pincer")),
(0.5, Item("common.items.crafting_ing.animal_misc.raptor_feather")),
(1.2, Item("common.items.crafting_ing.animal_misc.claw")),
(2.5, Item("common.items.crafting_ing.animal_misc.fur")),

View File

@ -906,7 +906,7 @@ impl TradePricing {
#[cfg(test)]
fn print_sorted(&self) {
use crate::comp::item::{armor, ItemKind, MaterialStatManifest};
use crate::comp::item::armor; //, ItemKind, MaterialStatManifest};
println!("Item, ForSale, Amount, Good, Quality, Deal, Unit,");
@ -968,27 +968,30 @@ impl TradePricing {
},
) in sorted.iter()
{
let it = Item::new_from_item_definition_id(
Item::new_from_item_definition_id(
item_id.as_ref(),
AbilityMap::load(),
MaterialStatManifest::load(),
);
//let price = mat_use.iter().map(|(amount, _good)| *amount).sum::<f32>();
let prob = 1.0 / pricesum;
let (info, unit) = more_information(&it, prob);
let materials = mat_use
.iter()
.fold(String::new(), |agg, i| agg + &format!("{:?}.", i.1));
println!(
"{:?}, {}, {:>4.2}, {}, {:?}, {}, {},",
&item_id,
if *can_sell { "yes" } else { "no" },
pricesum,
materials,
it.quality(),
info,
unit,
);
&AbilityMap::load().read(),
&MaterialStatManifest::load().read(),
)
.ok()
.map(|it| {
//let price = mat_use.iter().map(|(amount, _good)| *amount).sum::<f32>();
let prob = 1.0 / pricesum;
let (info, unit) = more_information(&it, prob);
let materials = mat_use
.iter()
.fold(String::new(), |agg, i| agg + &format!("{:?}.", i.1));
println!(
"{:?}, {}, {:>4.2}, {}, {:?}, {}, {},",
&item_id,
if *can_sell { "yes" } else { "no" },
pricesum,
materials,
it.quality(),
info,
unit,
);
});
}
}
}