join diamond

This commit is contained in:
ntr 2019-01-14 22:14:40 +11:00
parent ae5f09a5c8
commit 4408f71a9a
2 changed files with 2 additions and 2 deletions

View File

@ -108,11 +108,10 @@ pub fn item_drop(tx: &mut Transaction, account_id: Uuid, mode: GameMode) -> Resu
let log_normal = LogNormal::new(1.0, 1.0);
let num_drops = log_normal.sample(&mut rng).floor() as u16;
let actions = mode_drops(mode);
println!("{:?} drops", num_drops);
for _i in 0..num_drops {
let actions = mode_drops(mode);
let dist = WeightedIndex::new(actions.iter().map(|item| item.1)).unwrap();
let kind = actions[dist.sample(&mut rng)].0;
let item = Item::new(kind, account_id);

View File

@ -254,6 +254,7 @@ fn add_shape(shape: Shape, gr: &mut ZoneGraph, start: NodeIndex, x: i8, y: i8) -
gr.add_edge(bottom, bottom_tip, ());
let side = gr.add_node(Encounter::new("NORMAL", x + 2, y));
gr.add_edge(start, side, ());
gr.add_edge(top, side, ());
gr.add_edge(bottom, side, ());