diff --git a/assets/common/items/utility/coins.ron b/assets/common/items/utility/coins.ron new file mode 100644 index 0000000000..5f0330bfc0 --- /dev/null +++ b/assets/common/items/utility/coins.ron @@ -0,0 +1,11 @@ +ItemDef( + name: "Coins", + description: "Money can be exchanged for goods and services.", + kind: Utility( + kind: Coins, + ), + amount: 1, + quality: Common, + tags: [], +) + diff --git a/assets/voxygen/item_image_manifest.ron b/assets/voxygen/item_image_manifest.ron index cc393bd835..96f641079d 100644 --- a/assets/voxygen/item_image_manifest.ron +++ b/assets/voxygen/item_image_manifest.ron @@ -971,6 +971,10 @@ ), // Other + Utility(Coins): VoxTrans( + "voxel.object.coins", + (0.0, 0.0, 0.0), (0.0, 0.0, 0.0), 0.6, + ), Utility(Collar): Png( "element.icons.collar", ), diff --git a/assets/voxygen/voxel/object/coins.vox b/assets/voxygen/voxel/object/coins.vox new file mode 100644 index 0000000000..979f564634 --- /dev/null +++ b/assets/voxygen/voxel/object/coins.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:92bcf64578d804cc6a187c892ab845b587c80022ffa3cf91667b0bc5f13d7a7f +size 1244 diff --git a/assets/voxygen/voxel/object_manifest.ron b/assets/voxygen/voxel/object_manifest.ron index d136326373..4e11fead93 100644 --- a/assets/voxygen/voxel/object_manifest.ron +++ b/assets/voxygen/voxel/object_manifest.ron @@ -539,6 +539,16 @@ central: ("armor.empty"), ) ), + Coins: ( + bone0: ( + offset: (0.0, 0.0, 0.0), + central: ("object.coins"), + ), + bone1: ( + offset: (0.0, 0.0, 0.0), + central: ("armor.empty"), + ) + ), CraftingBench: ( bone0: ( offset: (-9.5, -7.0, 0.0), @@ -649,4 +659,4 @@ central: ("armor.empty"), ) ), -}) \ No newline at end of file +}) diff --git a/common/src/comp/body/object.rs b/common/src/comp/body/object.rs index 23b971c08f..8a84786bd2 100644 --- a/common/src/comp/body/object.rs +++ b/common/src/comp/body/object.rs @@ -72,6 +72,7 @@ make_case_elim!( Steak = 62, Crossbow = 63, ArrowTurret = 64, + Coins = 65, } ); @@ -82,7 +83,7 @@ impl Body { } } -pub const ALL_OBJECTS: [Body; 65] = [ +pub const ALL_OBJECTS: [Body; 66] = [ Body::Arrow, Body::Bomb, Body::Scarecrow, @@ -148,6 +149,7 @@ pub const ALL_OBJECTS: [Body; 65] = [ Body::Steak, Body::Crossbow, Body::ArrowTurret, + Body::Coins, ]; impl From for super::Body { @@ -222,6 +224,7 @@ impl Body { Body::Steak => "steak", Body::Crossbow => "crossbow", Body::ArrowTurret => "arrow_turret", + Body::Coins => "coins", } } } diff --git a/common/src/comp/inventory/item/mod.rs b/common/src/comp/inventory/item/mod.rs index cba47ade2a..3ed09f38cd 100644 --- a/common/src/comp/inventory/item/mod.rs +++ b/common/src/comp/inventory/item/mod.rs @@ -47,6 +47,7 @@ pub enum Reagent { #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] pub enum Utility { + Coins, Collar, } diff --git a/server/src/events/inventory_manip.rs b/server/src/events/inventory_manip.rs index 41485b560c..48cc8c0ede 100644 --- a/server/src/events/inventory_manip.rs +++ b/server/src/events/inventory_manip.rs @@ -523,8 +523,13 @@ pub fn handle_inventory(server: &mut Server, entity: EcsEntity, manip: comp::Slo // Drop items for (pos, ori, item) in dropped_items { + // hack: special case coins for now + let body = match item.item_definition_id() { + "common.items.utility.coins" => comp::object::Body::Coins, + _ => comp::object::Body::Pouch, + }; state - .create_object(Default::default(), comp::object::Body::Pouch) + .create_object(Default::default(), body) .with(comp::Pos(pos.0 + *ori.look_dir() + Vec3::unit_z())) .with(item) .with(comp::Vel(Vec3::zero())) diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index 01f13e6687..9060506c1a 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -1290,9 +1290,15 @@ impl Hud { ); let ingame_pos = pos.0 + Vec3::unit_z() * 1.2; + let text = if item.amount() > 1 { + format!("{} x {}", item.amount(), item.name()) + } else { + item.name().to_string() + }; + // Item overitem::Overitem::new( - &item.name(), + &text, &distance, &self.fonts, &global_state.settings.controls,