Fixed rebase

This commit is contained in:
Joshua Barretto 2020-11-15 01:45:48 +00:00
parent 1864f4626c
commit 29a8e8c359
2 changed files with 6 additions and 3 deletions

View File

@ -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)

View File

@ -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,