Merge branch 'crafting_stations_in_site2_towns' into 'master'

add crafting stations to workshop in site2 towns

See merge request veloren/veloren!3174
This commit is contained in:
Joshua Barretto 2022-02-03 17:16:30 +00:00
commit ac13d07443

View File

@ -1,5 +1,8 @@
use super::*;
use crate::Land;
use crate::{
util::{RandomField, Sampler},
Land,
};
use common::terrain::{Block, BlockKind, SpriteKind};
use rand::prelude::*;
use vek::*;
@ -108,5 +111,27 @@ impl Structure for Workshop {
);
}
}
for dir in CARDINALS {
for d in 0..3 {
let position = center + dir * (3 + d * 2);
let mut stations = vec![
SpriteKind::CraftingBench,
SpriteKind::Forge,
SpriteKind::SpinningWheel,
SpriteKind::TanningRack,
SpriteKind::CookingPot,
SpriteKind::Cauldron,
SpriteKind::Loom,
SpriteKind::Anvil,
SpriteKind::DismantlingBench,
];
if !stations.is_empty() {
let cr_station = stations.swap_remove(
RandomField::new(0).get(position.with_z(base)) as usize % stations.len(),
);
painter.sprite(position.with_z(base), cr_station);
}
}
}
}
}