mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Fixed rebase
This commit is contained in:
parent
1864f4626c
commit
29a8e8c359
@ -8,6 +8,7 @@ use common::{
|
||||
terrain::TerrainGrid,
|
||||
store::Id,
|
||||
LoadoutBuilder,
|
||||
comp::item::tool::AbilityMap,
|
||||
};
|
||||
|
||||
pub struct Entity {
|
||||
@ -34,7 +35,7 @@ impl Entity {
|
||||
comp::humanoid::Body::random_with(&mut self.rng(PERM_BODY), &species).into()
|
||||
}
|
||||
|
||||
pub fn get_loadout(&self) -> comp::Loadout {
|
||||
pub fn get_loadout(&self, ability_map: &AbilityMap) -> comp::Loadout {
|
||||
let mut rng = self.rng(PERM_LOADOUT);
|
||||
let main_tool = comp::Item::new_from_asset_expect((&[
|
||||
"common.items.weapons.sword.wood_sword",
|
||||
@ -62,7 +63,7 @@ impl Entity {
|
||||
let pants = Some(comp::Item::new_from_asset_expect("common.items.npc_armor.pants.leather_blue_0"));
|
||||
let shoulder = Some(comp::Item::new_from_asset_expect("common.items.armor.shoulder.leather_0"));
|
||||
|
||||
LoadoutBuilder::build_loadout(self.get_body(), comp::Alignment::Npc, Some(main_tool), false)
|
||||
LoadoutBuilder::build_loadout(self.get_body(), comp::Alignment::Npc, Some(main_tool), false, ability_map)
|
||||
.back(back)
|
||||
.lantern(lantern)
|
||||
.chest(chest)
|
||||
|
@ -22,6 +22,7 @@ impl<'a> System<'a> for Sys {
|
||||
ReadStorage<'a, comp::Pos>,
|
||||
ReadStorage<'a, RtSimEntity>,
|
||||
WriteStorage<'a, comp::Agent>,
|
||||
ReadExpect<'a, comp::item::tool::AbilityMap>,
|
||||
);
|
||||
|
||||
fn run(
|
||||
@ -36,6 +37,7 @@ impl<'a> System<'a> for Sys {
|
||||
positions,
|
||||
rtsim_entities,
|
||||
mut agents,
|
||||
ability_map,
|
||||
): Self::SystemData,
|
||||
) {
|
||||
let rtsim = &mut *rtsim;
|
||||
@ -95,7 +97,7 @@ impl<'a> System<'a> for Sys {
|
||||
pos: comp::Pos(spawn_pos),
|
||||
stats: comp::Stats::new("Traveller [rt]".to_string(), body),
|
||||
health: comp::Health::new(body, 10),
|
||||
loadout: entity.get_loadout(),
|
||||
loadout: entity.get_loadout(&ability_map),
|
||||
body,
|
||||
agent: Some(comp::Agent::new(None, true, &body)),
|
||||
alignment: comp::Alignment::Npc,
|
||||
|
Loading…
Reference in New Issue
Block a user