Add shield item

This commit is contained in:
timokoesters 2020-03-16 13:40:14 +01:00
parent 4195273cf9
commit 1279f70184
5 changed files with 16 additions and 4 deletions

View File

@ -0,0 +1,10 @@
Item(
name: "A Shield",
description: "Legends tell this item is useless.",
kind: Tool (
ToolData (
kind: Shield,
equip_time_millis: 400,
)
),
)

View File

@ -29,7 +29,7 @@
),
Tool(Shield): VoxTrans(
"voxel.weapon.shield.wood-0",
(0.0, 9.0, 0.0), (-90.0, 90.0, 0.0), 2.4,
(0.0, 0.0, 0.0), (-90.0, 90.0, 0.0), 2.4,
),
Utility(Collar): VoxTrans(
"element.icons.collar",

View File

@ -83,7 +83,7 @@ impl ToolData {
recover_duration: Duration::from_millis(300),
base_damage: 70,
}],
Shield => vec![],
Shield => vec![BasicBlock],
Debug(kind) => match kind {
DebugKind::Boost => vec![
CharacterAbility::Boost {

View File

@ -25,7 +25,9 @@ impl CharacterBehavior for Data {
handle_move(&data, &mut update);
if !data.physics.on_ground || !data.inputs.secondary.is_pressed() {
if !data.physics.on_ground
|| !(data.inputs.secondary.is_pressed() || data.inputs.primary.is_pressed())
{
attempt_wield(data, &mut update);
}
update

View File

@ -632,7 +632,7 @@ pub fn mesh_main(item_kind: Option<&ItemKind>) -> Mesh<FigurePipeline> {
ToolKind::Axe => ("weapon.axe.rusty_2h", Vec3::new(-1.5, -5.0, -4.0)),
ToolKind::Hammer => ("weapon.hammer.rusty_2h", Vec3::new(-2.5, -5.5, -4.0)),
ToolKind::Dagger => ("weapon.hammer.rusty_2h", Vec3::new(-2.5, -5.5, -4.0)),
ToolKind::Shield => ("weapon.axe.rusty_2h", Vec3::new(-2.5, -6.5, -2.0)),
ToolKind::Shield => ("weapon.shield.wood-0", Vec3::new(-2.5, -6.5, -2.0)),
ToolKind::Bow => ("weapon.bow.simple-bow", Vec3::new(-1.0, -6.0, -2.0)),
ToolKind::Staff => ("weapon.staff.wood-fire", Vec3::new(-1.0, -6.0, -3.0)),
ToolKind::Debug(_) => ("weapon.debug_wand", Vec3::new(-1.5, -9.5, -4.0)),