cape item

This commit is contained in:
Pfauenauge90 2020-04-06 18:11:05 +02:00
parent edc0ba0f75
commit 1af1b1cf35
6 changed files with 37 additions and 30 deletions

View File

@ -5,7 +5,7 @@
), ),
map: { map: {
Short0: ( Short0: (
vox_spec: ("armor.back.short-0", (0.0, 0.0, 0.0)), vox_spec: ("armor.back.short-0", (10.0, 10.0, 10.0)),
color: None color: None
), ),
}, },

View File

@ -104,6 +104,7 @@ pub struct Loadout {
pub hand: Option<Item>, pub hand: Option<Item>,
pub pants: Option<Item>, pub pants: Option<Item>,
pub foot: Option<Item>, pub foot: Option<Item>,
pub back: Option<Item>,
} }
impl From<&CharacterAbility> for CharacterState { impl From<&CharacterAbility> for CharacterState {

View File

@ -184,6 +184,7 @@ impl StateExt for State {
hand: None, hand: None,
pants: None, pants: None,
foot: None, foot: None,
back: None,
} }
} else { } else {
comp::Loadout::default() comp::Loadout::default()

View File

@ -243,6 +243,7 @@ impl<'a> System<'a> for Sys {
foot: Some(assets::load_expect_cloned( foot: Some(assets::load_expect_cloned(
"common.items.armor.foot.leather_0", "common.items.armor.foot.leather_0",
)), )),
back: None,
}, },
comp::Alignment::Enemy => comp::Loadout { comp::Alignment::Enemy => comp::Loadout {
active_item, active_item,
@ -265,6 +266,7 @@ impl<'a> System<'a> for Sys {
foot: Some(assets::load_expect_cloned( foot: Some(assets::load_expect_cloned(
"common.items.armor.foot.plate_0", "common.items.armor.foot.plate_0",
)), )),
back: None,
}, },
_ => comp::Loadout { _ => comp::Loadout {
active_item, active_item,
@ -275,6 +277,7 @@ impl<'a> System<'a> for Sys {
hand: None, hand: None,
pants: None, pants: None,
foot: None, foot: None,
back: None,
}, },
}; };
@ -335,6 +338,7 @@ impl<'a> System<'a> for Sys {
foot: Some(assets::load_expect_cloned( foot: Some(assets::load_expect_cloned(
"common.items.armor.foot.plate_0", "common.items.armor.foot.plate_0",
)), )),
back: None,
}; };
stats.level.set_level(rand::thread_rng().gen_range(30, 35)); stats.level.set_level(rand::thread_rng().gen_range(30, 35));

View File

@ -355,6 +355,7 @@ impl CharSelectionUi {
hand: None, hand: None,
pants: None, pants: None,
foot: None, foot: None,
back: None,
}; };
Some(loadout) Some(loadout)
}, },

View File

@ -12,7 +12,7 @@ use common::{
dragon, fish_medium, fish_small, dragon, fish_medium, fish_small,
humanoid::{Body, BodyType, EyeColor, Eyebrows, Race, Skin}, humanoid::{Body, BodyType, EyeColor, Eyebrows, Race, Skin},
item::{ item::{
armor::{Armor, Belt, Chest, Foot, Hand, Pants, Shoulder}, armor::{Armor, Back, Belt, Chest, Foot, Hand, Pants, Shoulder},
tool::{Tool, ToolKind}, tool::{Tool, ToolKind},
ItemKind, ItemKind,
}, },
@ -255,9 +255,9 @@ pub struct HumArmorPantsSpec(ArmorVoxSpecMap<Pants, ArmorVoxSpec>);
#[derive(Serialize, Deserialize)] #[derive(Serialize, Deserialize)]
pub struct HumArmorFootSpec(ArmorVoxSpecMap<Foot, ArmorVoxSpec>); pub struct HumArmorFootSpec(ArmorVoxSpecMap<Foot, ArmorVoxSpec>);
#[derive(Serialize, Deserialize)] #[derive(Serialize, Deserialize)]
pub struct HumArmorBackSpec(ArmorVoxSpecMap<Foot, ArmorVoxSpec>);
#[derive(Serialize, Deserialize)]
pub struct HumMainWeaponSpec(HashMap<ToolKind, ArmorVoxSpec>); pub struct HumMainWeaponSpec(HashMap<ToolKind, ArmorVoxSpec>);
#[derive(Serialize, Deserialize)]
pub struct HumArmorBackSpec(ArmorVoxSpecMap<Back, ArmorVoxSpec>);
impl Asset for HumArmorShoulderSpec { impl Asset for HumArmorShoulderSpec {
const ENDINGS: &'static [&'static str] = &["ron"]; const ENDINGS: &'static [&'static str] = &["ron"];
@ -606,6 +606,32 @@ impl HumArmorFootSpec {
self.mesh_foot(body, loadout, false) self.mesh_foot(body, loadout, false)
} }
} }
impl HumMainWeaponSpec {
pub fn load_watched(indicator: &mut ReloadIndicator) -> Arc<Self> {
assets::load_watched::<Self>("voxygen.voxel.humanoid_main_weapon_manifest", indicator)
.unwrap()
}
pub fn mesh_main_weapon(&self, item_kind: Option<&ItemKind>) -> Mesh<FigurePipeline> {
let tool_kind = if let Some(ItemKind::Tool(Tool { kind, .. })) = item_kind {
kind
} else {
return Mesh::new();
};
let spec = match self.0.get(tool_kind) {
Some(spec) => spec,
None => {
error!("No hand specification exists for {:?}", tool_kind);
return load_mesh("not_found", Vec3::new(-1.5, -1.5, -7.0));
},
};
let tool_kind_segment = graceful_load_segment(&spec.vox_spec.0);
generate_mesh(&tool_kind_segment, Vec3::from(spec.vox_spec.1))
}
}
impl HumArmorBackSpec { impl HumArmorBackSpec {
pub fn load_watched(indicator: &mut ReloadIndicator) -> Arc<Self> { pub fn load_watched(indicator: &mut ReloadIndicator) -> Arc<Self> {
assets::load_watched::<Self>("voxygen.voxel.humanoid_armor_back_manifest", indicator) assets::load_watched::<Self>("voxygen.voxel.humanoid_armor_back_manifest", indicator)
@ -657,32 +683,6 @@ impl HumArmorBackSpec {
} }
} }
impl HumMainWeaponSpec {
pub fn load_watched(indicator: &mut ReloadIndicator) -> Arc<Self> {
assets::load_watched::<Self>("voxygen.voxel.humanoid_main_weapon_manifest", indicator)
.unwrap()
}
pub fn mesh_main_weapon(&self, item_kind: Option<&ItemKind>) -> Mesh<FigurePipeline> {
let tool_kind = if let Some(ItemKind::Tool(Tool { kind, .. })) = item_kind {
kind
} else {
return Mesh::new();
};
let spec = match self.0.get(tool_kind) {
Some(spec) => spec,
None => {
error!("No hand specification exists for {:?}", tool_kind);
return load_mesh("not_found", Vec3::new(-1.5, -1.5, -7.0));
},
};
let tool_kind_segment = graceful_load_segment(&spec.vox_spec.0);
generate_mesh(&tool_kind_segment, Vec3::from(spec.vox_spec.1))
}
}
// TODO: Inventory // TODO: Inventory
pub fn mesh_glider() -> Mesh<FigurePipeline> { pub fn mesh_glider() -> Mesh<FigurePipeline> {
load_mesh("object.glider", Vec3::new(-26.0, -26.0, -5.0)) load_mesh("object.glider", Vec3::new(-26.0, -26.0, -5.0))