mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
cape item
This commit is contained in:
parent
771baaaae5
commit
7f97fbac0b
@ -5,7 +5,7 @@
|
||||
),
|
||||
map: {
|
||||
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
|
||||
),
|
||||
},
|
||||
|
@ -104,6 +104,7 @@ pub struct Loadout {
|
||||
pub hand: Option<Item>,
|
||||
pub pants: Option<Item>,
|
||||
pub foot: Option<Item>,
|
||||
pub back: Option<Item>,
|
||||
}
|
||||
|
||||
impl From<&CharacterAbility> for CharacterState {
|
||||
|
@ -184,6 +184,7 @@ impl StateExt for State {
|
||||
hand: None,
|
||||
pants: None,
|
||||
foot: None,
|
||||
back: None,
|
||||
}
|
||||
} else {
|
||||
comp::Loadout::default()
|
||||
|
@ -243,6 +243,7 @@ impl<'a> System<'a> for Sys {
|
||||
foot: Some(assets::load_expect_cloned(
|
||||
"common.items.armor.foot.leather_0",
|
||||
)),
|
||||
back: None,
|
||||
},
|
||||
comp::Alignment::Enemy => comp::Loadout {
|
||||
active_item,
|
||||
@ -265,6 +266,7 @@ impl<'a> System<'a> for Sys {
|
||||
foot: Some(assets::load_expect_cloned(
|
||||
"common.items.armor.foot.plate_0",
|
||||
)),
|
||||
back: None,
|
||||
},
|
||||
_ => comp::Loadout {
|
||||
active_item,
|
||||
@ -275,6 +277,7 @@ impl<'a> System<'a> for Sys {
|
||||
hand: None,
|
||||
pants: None,
|
||||
foot: None,
|
||||
back: None,
|
||||
},
|
||||
};
|
||||
|
||||
@ -335,6 +338,7 @@ impl<'a> System<'a> for Sys {
|
||||
foot: Some(assets::load_expect_cloned(
|
||||
"common.items.armor.foot.plate_0",
|
||||
)),
|
||||
back: None,
|
||||
};
|
||||
|
||||
stats.level.set_level(rand::thread_rng().gen_range(30, 35));
|
||||
|
@ -355,6 +355,7 @@ impl CharSelectionUi {
|
||||
hand: None,
|
||||
pants: None,
|
||||
foot: None,
|
||||
back: None,
|
||||
};
|
||||
Some(loadout)
|
||||
},
|
||||
|
@ -12,7 +12,7 @@ use common::{
|
||||
dragon, fish_medium, fish_small,
|
||||
humanoid::{Body, BodyType, EyeColor, Eyebrows, Race, Skin},
|
||||
item::{
|
||||
armor::{Armor, Belt, Chest, Foot, Hand, Pants, Shoulder},
|
||||
armor::{Armor, Back, Belt, Chest, Foot, Hand, Pants, Shoulder},
|
||||
tool::{Tool, ToolKind},
|
||||
ItemKind,
|
||||
},
|
||||
@ -255,9 +255,9 @@ pub struct HumArmorPantsSpec(ArmorVoxSpecMap<Pants, ArmorVoxSpec>);
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct HumArmorFootSpec(ArmorVoxSpecMap<Foot, ArmorVoxSpec>);
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct HumArmorBackSpec(ArmorVoxSpecMap<Foot, ArmorVoxSpec>);
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct HumMainWeaponSpec(HashMap<ToolKind, ArmorVoxSpec>);
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct HumArmorBackSpec(ArmorVoxSpecMap<Back, ArmorVoxSpec>);
|
||||
|
||||
impl Asset for HumArmorShoulderSpec {
|
||||
const ENDINGS: &'static [&'static str] = &["ron"];
|
||||
@ -606,6 +606,32 @@ impl HumArmorFootSpec {
|
||||
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 {
|
||||
pub fn load_watched(indicator: &mut ReloadIndicator) -> Arc<Self> {
|
||||
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
|
||||
pub fn mesh_glider() -> Mesh<FigurePipeline> {
|
||||
load_mesh("object.glider", Vec3::new(-26.0, -26.0, -5.0))
|
||||
|
Loading…
Reference in New Issue
Block a user