mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
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:
commit
ac13d07443
@ -1,5 +1,8 @@
|
|||||||
use super::*;
|
use super::*;
|
||||||
use crate::Land;
|
use crate::{
|
||||||
|
util::{RandomField, Sampler},
|
||||||
|
Land,
|
||||||
|
};
|
||||||
use common::terrain::{Block, BlockKind, SpriteKind};
|
use common::terrain::{Block, BlockKind, SpriteKind};
|
||||||
use rand::prelude::*;
|
use rand::prelude::*;
|
||||||
use vek::*;
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user