From 9aab296264627461986d2fb45ec5c30ef171c66b Mon Sep 17 00:00:00 2001 From: scott-c Date: Tue, 11 Aug 2020 19:52:15 +0800 Subject: [PATCH 1/3] Add firework item --- assets/common/items/utility/firework.ron | 7 +++++++ assets/common/loot_table.ron | 1 + assets/common/recipe_book.ron | 1 + assets/voxygen/item_image_manifest.ron | 4 ++++ common/src/comp/body/object.rs | 5 ++++- common/src/comp/inventory/item/mod.rs | 1 + common/src/comp/misc.rs | 1 + server/src/events/inventory_manip.rs | 17 +++++++++++++---- server/src/sys/object.rs | 23 +++++++++++++++++++---- voxygen/src/scene/figure/load.rs | 1 + 10 files changed, 52 insertions(+), 9 deletions(-) create mode 100644 assets/common/items/utility/firework.ron diff --git a/assets/common/items/utility/firework.ron b/assets/common/items/utility/firework.ron new file mode 100644 index 0000000000..a33bf47fae --- /dev/null +++ b/assets/common/items/utility/firework.ron @@ -0,0 +1,7 @@ +Item( + name: "Firework", + description: "Label: Outdoor use only!\n\n", + kind: Throwable( + kind: Firework, + ), +) diff --git a/assets/common/loot_table.ron b/assets/common/loot_table.ron index 4d0a7e98bf..f39443ba4a 100644 --- a/assets/common/loot_table.ron +++ b/assets/common/loot_table.ron @@ -9,6 +9,7 @@ (0.4, "common.items.ore.velorite"), (0.6, "common.items.ore.veloritefrag"), (0.1, "common.items.consumable.potion_minor"), + (1.0, "common.items.utility.firework"), (0.01, "common.items.utility.collar"), (0.01, "common.items.utility.bomb_pile"), (0.1, "common.items.utility.bomb"), diff --git a/assets/common/recipe_book.ron b/assets/common/recipe_book.ron index cda3378172..0637d439fc 100644 --- a/assets/common/recipe_book.ron +++ b/assets/common/recipe_book.ron @@ -6,6 +6,7 @@ "potion_m": (("common.items.consumable.potion_med", 1), [("common.items.consumable.potion_minor", 2), ("common.items.ore.veloritefrag", 4)]), "collar_basic": (("common.items.utility.collar", 1), [("common.items.crafting_ing.leather_scraps", 5), ("common.items.crafting_ing.shiny_gem", 1)]), "bomb_coconut": (("common.items.utility.bomb", 1), [("common.items.crafting_ing.stones", 10), ("common.items.food.coconut", 2), ("common.items.ore.veloritefrag", 2), ("common.items.crafting_tools.mortar_pestle", 0)]), + "firework": (("common.items.utility.firework", 1), [("common.items.crafting_ing.twigs", 1), ("common.items.crafting_ing.stones", 1), ("common.items.food.coconut", 2), ("common.items.ore.veloritefrag", 10), ("common.items.crafting_tools.mortar_pestle", 0)]), "apple_shroom_curry": (("common.items.food.apple_mushroom_curry", 1), [("common.items.food.mushroom", 10), ("common.items.food.coconut", 1), ("common.items.food.apple", 5), ("common.items.crafting_tools.mortar_pestle", 0)]), "apples_stick": (("common.items.food.apple_stick", 1),[("common.items.crafting_ing.twigs", 1), ("common.items.food.apple", 3)]), "mushroom_stick": (("common.items.food.mushroom_stick", 1),[("common.items.crafting_ing.twigs", 1), ("common.items.food.mushroom", 5)]), diff --git a/assets/voxygen/item_image_manifest.ron b/assets/voxygen/item_image_manifest.ron index 51a2014214..3101fd660d 100644 --- a/assets/voxygen/item_image_manifest.ron +++ b/assets/voxygen/item_image_manifest.ron @@ -1110,6 +1110,10 @@ "voxel.object.bomb", (0.0, 0.5, 0.0), (-50.0, 40.0, 20.0), 0.8, ), + Throwable(Firework): VoxTrans( + "voxel.object.firework", + (0.0, 0.5, 0.0), (-50.0, 40.0, 20.0), 0.8, + ), Throwable(TrainingDummy): VoxTrans( "voxel.object.training_dummy", (0.0, -1.0, 0.0), (-50.0, 40.0, 20.0), 0.8, diff --git a/common/src/comp/body/object.rs b/common/src/comp/body/object.rs index a591582980..885055db72 100644 --- a/common/src/comp/body/object.rs +++ b/common/src/comp/body/object.rs @@ -58,6 +58,7 @@ pub enum Body { CampfireLit = 51, BoltFireBig = 52, TrainingDummy = 53, + Firework = 54, } impl Body { @@ -67,7 +68,7 @@ impl Body { } } -pub const ALL_OBJECTS: [Body; 54] = [ +pub const ALL_OBJECTS: [Body; 55] = [ Body::Arrow, Body::Bomb, Body::Scarecrow, @@ -122,6 +123,7 @@ pub const ALL_OBJECTS: [Body; 54] = [ Body::BoltFireBig, Body::ArrowSnake, Body::TrainingDummy, + Body::Firework, ]; impl From for super::Body { @@ -185,6 +187,7 @@ impl Body { Body::BoltFireBig => "bolt_fire_big", Body::ArrowSnake => "arrow_snake", Body::TrainingDummy => "training_dummy", + Body::Firework => "firework", } } } diff --git a/common/src/comp/inventory/item/mod.rs b/common/src/comp/inventory/item/mod.rs index 3990e1c5d7..b847361a60 100644 --- a/common/src/comp/inventory/item/mod.rs +++ b/common/src/comp/inventory/item/mod.rs @@ -20,6 +20,7 @@ use vek::Rgb; pub enum Throwable { Bomb, TrainingDummy, + Firework, } #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] diff --git a/common/src/comp/misc.rs b/common/src/comp/misc.rs index 14eecab757..e926d693c3 100644 --- a/common/src/comp/misc.rs +++ b/common/src/comp/misc.rs @@ -6,6 +6,7 @@ use specs_idvs::IdvStorage; #[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)] pub enum Object { Bomb { owner: Option }, + Firework { owner: Option }, } impl Component for Object { diff --git a/server/src/events/inventory_manip.rs b/server/src/events/inventory_manip.rs index 549804d6f8..b8d5d1a01e 100644 --- a/server/src/events/inventory_manip.rs +++ b/server/src/events/inventory_manip.rs @@ -402,16 +402,22 @@ pub fn handle_inventory(server: &mut Server, entity: EcsEntity, manip: comp::Inv // Throw items for (pos, vel, ori, kind) in thrown_items { - let vel = vel.0 - + *ori.0 * 20.0 - + Vec3::unit_z() * 15.0 - + Vec3::::zero().map(|_| rand::thread_rng().gen::() - 0.5) * 4.0; + let vel = match kind { + item::Throwable::Firework => Vec3::unit_z() * 200.0, + _ => { + vel.0 + + *ori.0 * 20.0 + + Vec3::unit_z() * 15.0 + + Vec3::::zero().map(|_| rand::thread_rng().gen::() - 0.5) * 4.0 + }, + }; let uid = state.read_component_copied::(entity); let mut new_entity = state .create_object(Default::default(), match kind { item::Throwable::Bomb => comp::object::Body::Bomb, + item::Throwable::Firework => comp::object::Body::Bomb, item::Throwable::TrainingDummy => comp::object::Body::TrainingDummy, }) .with(comp::Pos(pos.0 + Vec3::unit_z() * 0.25)) @@ -421,6 +427,9 @@ pub fn handle_inventory(server: &mut Server, entity: EcsEntity, manip: comp::Inv item::Throwable::Bomb => { new_entity = new_entity.with(comp::Object::Bomb { owner: uid }); }, + item::Throwable::Firework => { + new_entity = new_entity.with(comp::Object::Firework { owner: uid }); + }, item::Throwable::TrainingDummy => { new_entity = new_entity.with(comp::Stats::new( "Training Dummy".to_string(), diff --git a/server/src/sys/object.rs b/server/src/sys/object.rs index ea3c2d3ad5..81a2200fbe 100644 --- a/server/src/sys/object.rs +++ b/server/src/sys/object.rs @@ -1,5 +1,5 @@ use common::{ - comp::{HealthSource, Object, PhysicsState, Pos}, + comp::{HealthSource, Object, PhysicsState, Pos, Vel}, event::{EventBus, ServerEvent}, state::DeltaTime, }; @@ -14,19 +14,20 @@ impl<'a> System<'a> for Sys { Read<'a, DeltaTime>, Read<'a, EventBus>, ReadStorage<'a, Pos>, + ReadStorage<'a, Vel>, ReadStorage<'a, PhysicsState>, WriteStorage<'a, Object>, ); fn run( &mut self, - (entities, _dt, server_bus, positions, physics_states, mut objects): Self::SystemData, + (entities, _dt, server_bus, positions, velocities, physics_states, mut objects): Self::SystemData, ) { let mut server_emitter = server_bus.emitter(); // Objects - for (entity, pos, physics, object) in - (&entities, &positions, &physics_states, &mut objects).join() + for (entity, pos, vel, physics, object) in + (&entities, &positions, &velocities, &physics_states, &mut objects).join() { match object { Object::Bomb { owner } => { @@ -43,6 +44,20 @@ impl<'a> System<'a> for Sys { }); } }, + Object::Firework { owner } => { + if physics.on_surface().is_some() || vel.0.z < 0.0 { + server_emitter.emit(ServerEvent::Destroy { + entity, + cause: HealthSource::Suicide, + }); + server_emitter.emit(ServerEvent::Explosion { + pos: pos.0, + power: 4.0, + owner: *owner, + friendly_damage: true, + }); + } + }, } } } diff --git a/voxygen/src/scene/figure/load.rs b/voxygen/src/scene/figure/load.rs index aafa1b8970..6489891367 100644 --- a/voxygen/src/scene/figure/load.rs +++ b/voxygen/src/scene/figure/load.rs @@ -3418,6 +3418,7 @@ pub fn mesh_object( Vec3::new(-0.5, -6.0, -1.5), ), Body::Bomb => ("object.bomb", Vec3::new(-5.5, -5.5, 0.0)), + Body::Firework => ("object.firework", Vec3::new(-5.5, -5.5, 0.0)), Body::Scarecrow => ("object.scarecrow", Vec3::new(-9.5, -4.0, 0.0)), Body::Cauldron => ("object.cauldron", Vec3::new(-10.0, -10.0, 0.0)), Body::ChestVines => ("object.chest_vines", Vec3::new(-7.5, -6.0, 0.0)), From 6789b7ae27c445fcae99b9aca9c69e3f12a8cf75 Mon Sep 17 00:00:00 2001 From: Monty Marz Date: Tue, 11 Aug 2020 16:05:34 +0200 Subject: [PATCH 2/3] Add firework hues --- CHANGELOG.md | 1 + assets/common/items/utility/firework.ron | 7 --- assets/common/items/utility/firework_blue.ron | 7 +++ .../common/items/utility/firework_green.ron | 7 +++ .../common/items/utility/firework_purple.ron | 7 +++ assets/common/items/utility/firework_red.ron | 7 +++ .../common/items/utility/firework_yellow.ron | 7 +++ assets/common/loot_table.ron | 1 - assets/common/recipe_book.ron | 6 ++- assets/voxygen/item_image_manifest.ron | 20 +++++++- assets/voxygen/shaders/particle-vert.glsl | 51 +++++++++++++++++++ .../voxel/weapon/projectile/fireworks-0.vox | 3 ++ .../weapon/projectile/fireworks_blue-0.vox | 3 ++ .../weapon/projectile/fireworks_green-0.vox | 3 ++ .../weapon/projectile/fireworks_purple-0.vox | 3 ++ .../weapon/projectile/fireworks_red-0.vox | 3 ++ .../weapon/projectile/fireworks_yellow-0.vox | 3 ++ common/src/comp/body/object.rs | 20 ++++++-- common/src/comp/inventory/item/mod.rs | 11 +++- common/src/comp/misc.rs | 10 +++- common/src/event.rs | 3 +- common/src/outcome.rs | 2 + common/src/sys/projectile.rs | 2 + server/src/cmd.rs | 1 + server/src/events/entity_manipulation.rs | 8 ++- server/src/events/inventory_manip.rs | 33 ++++++++++-- server/src/events/mod.rs | 3 +- server/src/sys/object.rs | 16 ++++-- voxygen/src/audio/sfx/mod.rs | 2 +- voxygen/src/lib.rs | 2 +- voxygen/src/render/pipelines/particle.rs | 5 ++ voxygen/src/scene/figure/load.rs | 21 +++++++- voxygen/src/scene/mod.rs | 29 +++++++++-- voxygen/src/scene/particle.rs | 29 +++++++++-- 34 files changed, 295 insertions(+), 41 deletions(-) delete mode 100644 assets/common/items/utility/firework.ron create mode 100644 assets/common/items/utility/firework_blue.ron create mode 100644 assets/common/items/utility/firework_green.ron create mode 100644 assets/common/items/utility/firework_purple.ron create mode 100644 assets/common/items/utility/firework_red.ron create mode 100644 assets/common/items/utility/firework_yellow.ron create mode 100644 assets/voxygen/voxel/weapon/projectile/fireworks-0.vox create mode 100644 assets/voxygen/voxel/weapon/projectile/fireworks_blue-0.vox create mode 100644 assets/voxygen/voxel/weapon/projectile/fireworks_green-0.vox create mode 100644 assets/voxygen/voxel/weapon/projectile/fireworks_purple-0.vox create mode 100644 assets/voxygen/voxel/weapon/projectile/fireworks_red-0.vox create mode 100644 assets/voxygen/voxel/weapon/projectile/fireworks_yellow-0.vox diff --git a/CHANGELOG.md b/CHANGELOG.md index 06d7096ee9..2f9506382a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,6 +52,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add detection of entities under the cursor - Functional group-system with exp-sharing and disabled damage to group members - Some Campfire, fireball & bomb; particle, light & sound effects. +- Added firework recipe - Added setting to change resolution ### Changed diff --git a/assets/common/items/utility/firework.ron b/assets/common/items/utility/firework.ron deleted file mode 100644 index a33bf47fae..0000000000 --- a/assets/common/items/utility/firework.ron +++ /dev/null @@ -1,7 +0,0 @@ -Item( - name: "Firework", - description: "Label: Outdoor use only!\n\n", - kind: Throwable( - kind: Firework, - ), -) diff --git a/assets/common/items/utility/firework_blue.ron b/assets/common/items/utility/firework_blue.ron new file mode 100644 index 0000000000..5468670824 --- /dev/null +++ b/assets/common/items/utility/firework_blue.ron @@ -0,0 +1,7 @@ +Item( + name: "Firework Blue", + description: "Recommended clearance: 42 chonks\n\n", + kind: Throwable( + kind: Firework(Blue), + ), +) diff --git a/assets/common/items/utility/firework_green.ron b/assets/common/items/utility/firework_green.ron new file mode 100644 index 0000000000..ae329c12da --- /dev/null +++ b/assets/common/items/utility/firework_green.ron @@ -0,0 +1,7 @@ +Item( + name: "Firework Green", + description: "Watch out for trees.\n\n", + kind: Throwable( + kind: Firework(Green), + ), +) diff --git a/assets/common/items/utility/firework_purple.ron b/assets/common/items/utility/firework_purple.ron new file mode 100644 index 0000000000..e217d72ff7 --- /dev/null +++ b/assets/common/items/utility/firework_purple.ron @@ -0,0 +1,7 @@ +Item( + name: "Firework Purple", + description: "Cult favourite.\n\n", + kind: Throwable( + kind: Firework(Purple), + ), +) diff --git a/assets/common/items/utility/firework_red.ron b/assets/common/items/utility/firework_red.ron new file mode 100644 index 0000000000..edda2afe76 --- /dev/null +++ b/assets/common/items/utility/firework_red.ron @@ -0,0 +1,7 @@ +Item( + name: "Firework Red", + description: "Humans sometimes use these\nas a flare in a pinch.\n\n", + kind: Throwable( + kind: Firework(Red), + ), +) diff --git a/assets/common/items/utility/firework_yellow.ron b/assets/common/items/utility/firework_yellow.ron new file mode 100644 index 0000000000..652408f515 --- /dev/null +++ b/assets/common/items/utility/firework_yellow.ron @@ -0,0 +1,7 @@ +Item( + name: "Firework Yellow", + description: "The Great Dr. passed away after\ntesting this contraption indoors.\n\n", + kind: Throwable( + kind: Firework(Yellow), + ), +) diff --git a/assets/common/loot_table.ron b/assets/common/loot_table.ron index f39443ba4a..4d0a7e98bf 100644 --- a/assets/common/loot_table.ron +++ b/assets/common/loot_table.ron @@ -9,7 +9,6 @@ (0.4, "common.items.ore.velorite"), (0.6, "common.items.ore.veloritefrag"), (0.1, "common.items.consumable.potion_minor"), - (1.0, "common.items.utility.firework"), (0.01, "common.items.utility.collar"), (0.01, "common.items.utility.bomb_pile"), (0.1, "common.items.utility.bomb"), diff --git a/assets/common/recipe_book.ron b/assets/common/recipe_book.ron index 0637d439fc..7e4d6b66d1 100644 --- a/assets/common/recipe_book.ron +++ b/assets/common/recipe_book.ron @@ -6,7 +6,11 @@ "potion_m": (("common.items.consumable.potion_med", 1), [("common.items.consumable.potion_minor", 2), ("common.items.ore.veloritefrag", 4)]), "collar_basic": (("common.items.utility.collar", 1), [("common.items.crafting_ing.leather_scraps", 5), ("common.items.crafting_ing.shiny_gem", 1)]), "bomb_coconut": (("common.items.utility.bomb", 1), [("common.items.crafting_ing.stones", 10), ("common.items.food.coconut", 2), ("common.items.ore.veloritefrag", 2), ("common.items.crafting_tools.mortar_pestle", 0)]), - "firework": (("common.items.utility.firework", 1), [("common.items.crafting_ing.twigs", 1), ("common.items.crafting_ing.stones", 1), ("common.items.food.coconut", 2), ("common.items.ore.veloritefrag", 10), ("common.items.crafting_tools.mortar_pestle", 0)]), + "firework_blue": (("common.items.utility.firework_blue", 1), [("common.items.crafting_ing.twigs", 1), ("common.items.crafting_ing.stones", 1), ("common.items.food.coconut", 1), ("common.items.ore.veloritefrag", 1), ("common.items.crafting_tools.mortar_pestle", 0)]), + "firework_green": (("common.items.utility.firework_green", 1), [("common.items.crafting_ing.twigs", 1), ("common.items.crafting_ing.stones", 1), ("common.items.food.coconut", 1), ("common.items.ore.veloritefrag", 1), ("common.items.crafting_tools.mortar_pestle", 0)]), + "firework_purple": (("common.items.utility.firework_purple", 1), [("common.items.crafting_ing.twigs", 1), ("common.items.crafting_ing.stones", 1), ("common.items.food.coconut", 1), ("common.items.ore.veloritefrag", 1), ("common.items.crafting_tools.mortar_pestle", 0)]), + "firework_red": (("common.items.utility.firework_red", 1), [("common.items.crafting_ing.twigs", 1), ("common.items.crafting_ing.stones", 1), ("common.items.food.coconut", 1), ("common.items.ore.veloritefrag", 1), ("common.items.crafting_tools.mortar_pestle", 0)]), + "firework_yellow": (("common.items.utility.firework_yellow", 1), [("common.items.crafting_ing.twigs", 1), ("common.items.crafting_ing.stones", 1), ("common.items.food.coconut", 1), ("common.items.ore.veloritefrag", 1), ("common.items.crafting_tools.mortar_pestle", 0)]), "apple_shroom_curry": (("common.items.food.apple_mushroom_curry", 1), [("common.items.food.mushroom", 10), ("common.items.food.coconut", 1), ("common.items.food.apple", 5), ("common.items.crafting_tools.mortar_pestle", 0)]), "apples_stick": (("common.items.food.apple_stick", 1),[("common.items.crafting_ing.twigs", 1), ("common.items.food.apple", 3)]), "mushroom_stick": (("common.items.food.mushroom_stick", 1),[("common.items.crafting_ing.twigs", 1), ("common.items.food.mushroom", 5)]), diff --git a/assets/voxygen/item_image_manifest.ron b/assets/voxygen/item_image_manifest.ron index 3101fd660d..7bfa8a6c2f 100644 --- a/assets/voxygen/item_image_manifest.ron +++ b/assets/voxygen/item_image_manifest.ron @@ -1110,8 +1110,24 @@ "voxel.object.bomb", (0.0, 0.5, 0.0), (-50.0, 40.0, 20.0), 0.8, ), - Throwable(Firework): VoxTrans( - "voxel.object.firework", + Throwable(Firework(Blue)): VoxTrans( + "voxel.weapon.projectile.fireworks_blue-0", + (0.0, 0.5, 0.0), (-50.0, 40.0, 20.0), 0.8, + ), + Throwable(Firework(Green)): VoxTrans( + "voxel.weapon.projectile.fireworks_green-0", + (0.0, 0.5, 0.0), (-50.0, 40.0, 20.0), 0.8, + ), + Throwable(Firework(Purple)): VoxTrans( + "voxel.weapon.projectile.fireworks_purple-0", + (0.0, 0.5, 0.0), (-50.0, 40.0, 20.0), 0.8, + ), + Throwable(Firework(Red)): VoxTrans( + "voxel.weapon.projectile.fireworks_red-0", + (0.0, 0.5, 0.0), (-50.0, 40.0, 20.0), 0.8, + ), + Throwable(Firework(Yellow)): VoxTrans( + "voxel.weapon.projectile.fireworks_yellow-0", (0.0, 0.5, 0.0), (-50.0, 40.0, 20.0), 0.8, ), Throwable(TrainingDummy): VoxTrans( diff --git a/assets/voxygen/shaders/particle-vert.glsl b/assets/voxygen/shaders/particle-vert.glsl index 2f2914f63d..10fd626140 100644 --- a/assets/voxygen/shaders/particle-vert.glsl +++ b/assets/voxygen/shaders/particle-vert.glsl @@ -26,6 +26,12 @@ const int FIRE = 1; const int GUN_POWDER_SPARK = 2; const int SHRAPNEL = 3; +const int FIREWORK_BLUE = 4; +const int FIREWORK_GREEN = 5; +const int FIREWORK_PURPLE = 6; +const int FIREWORK_RED = 7; +const int FIREWORK_YELLOW = 8; + // meters per second squared (acceleration) const float earth_gravity = 9.807; @@ -97,6 +103,51 @@ void main() { 3.0 + rand0, vec3(0.6 + rand7 * 0.4) ); + } else if (inst_mode == FIREWORK_BLUE) { + attr = Attr( + linear_motion( + vec3(0.0, 1.0, 1.0), + vec3(rand4, rand5, rand6) * 40.0 + grav_vel(earth_gravity) + ), + 3.0 + rand0, + vec3(0.6 + rand7 * 0.4) + ); + } else if (inst_mode == FIREWORK_GREEN) { + attr = Attr( + linear_motion( + vec3(0.0, 1.0, 0.0), + vec3(rand4, rand5, rand6) * 40.0 + grav_vel(earth_gravity) + ), + 3.0 + rand0, + vec3(0.6 + rand7 * 0.4) + ); + } else if (inst_mode == FIREWORK_PURPLE) { + attr = Attr( + linear_motion( + vec3(1.0, 0.0, 1.0), + vec3(rand4, rand5, rand6) * 40.0 + grav_vel(earth_gravity) + ), + 3.0 + rand0, + vec3(0.6 + rand7 * 0.4) + ); + } else if (inst_mode == FIREWORK_RED) { + attr = Attr( + linear_motion( + vec3(1.0, 0.0, 0.0), + vec3(rand4, rand5, rand6) * 40.0 + grav_vel(earth_gravity) + ), + 3.0 + rand0, + vec3(0.6 + rand7 * 0.4) + ); + } else if (inst_mode == FIREWORK_YELLOW) { + attr = Attr( + linear_motion( + vec3(1.0, 1.0, 0.0), + vec3(rand4, rand5, rand6) * 40.0 + grav_vel(earth_gravity) + ), + 3.0 + rand0, + vec3(0.6 + rand7 * 0.4) + ); } else { attr = Attr( linear_motion( diff --git a/assets/voxygen/voxel/weapon/projectile/fireworks-0.vox b/assets/voxygen/voxel/weapon/projectile/fireworks-0.vox new file mode 100644 index 0000000000..0caaabd29a --- /dev/null +++ b/assets/voxygen/voxel/weapon/projectile/fireworks-0.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c5b19e7810b284a72a79d4c1b2d2deff1c326f79ce96972cf265b9e33a40d4f8 +size 1260 diff --git a/assets/voxygen/voxel/weapon/projectile/fireworks_blue-0.vox b/assets/voxygen/voxel/weapon/projectile/fireworks_blue-0.vox new file mode 100644 index 0000000000..42963c0b0c --- /dev/null +++ b/assets/voxygen/voxel/weapon/projectile/fireworks_blue-0.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:356a158618f928bc57eeffcf1a1af3191b2f580f8ec9188eaadb5aca9fe4fcf2 +size 1260 diff --git a/assets/voxygen/voxel/weapon/projectile/fireworks_green-0.vox b/assets/voxygen/voxel/weapon/projectile/fireworks_green-0.vox new file mode 100644 index 0000000000..38f9055a65 --- /dev/null +++ b/assets/voxygen/voxel/weapon/projectile/fireworks_green-0.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:53a212bf9d25eb2d5c0b6331ec1e9a85c46af217e7883fcb7b68c55dfa33e372 +size 1260 diff --git a/assets/voxygen/voxel/weapon/projectile/fireworks_purple-0.vox b/assets/voxygen/voxel/weapon/projectile/fireworks_purple-0.vox new file mode 100644 index 0000000000..845351cf4f --- /dev/null +++ b/assets/voxygen/voxel/weapon/projectile/fireworks_purple-0.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:67bae5b00b2276497275a3ce99392e4f4c19d7129010dc8e11eb8be5b2bcc353 +size 1260 diff --git a/assets/voxygen/voxel/weapon/projectile/fireworks_red-0.vox b/assets/voxygen/voxel/weapon/projectile/fireworks_red-0.vox new file mode 100644 index 0000000000..0caaabd29a --- /dev/null +++ b/assets/voxygen/voxel/weapon/projectile/fireworks_red-0.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c5b19e7810b284a72a79d4c1b2d2deff1c326f79ce96972cf265b9e33a40d4f8 +size 1260 diff --git a/assets/voxygen/voxel/weapon/projectile/fireworks_yellow-0.vox b/assets/voxygen/voxel/weapon/projectile/fireworks_yellow-0.vox new file mode 100644 index 0000000000..f2c0793fbc --- /dev/null +++ b/assets/voxygen/voxel/weapon/projectile/fireworks_yellow-0.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fd993b29e23e43ce21c84add88fddb46f6d99dd0a87a4f1973abc1429909e0a7 +size 1260 diff --git a/common/src/comp/body/object.rs b/common/src/comp/body/object.rs index 885055db72..fe73e92172 100644 --- a/common/src/comp/body/object.rs +++ b/common/src/comp/body/object.rs @@ -58,7 +58,11 @@ pub enum Body { CampfireLit = 51, BoltFireBig = 52, TrainingDummy = 53, - Firework = 54, + FireworkBlue = 54, + FireworkGreen = 55, + FireworkPurple = 56, + FireworkRed = 57, + FireworkYellow = 58, } impl Body { @@ -68,7 +72,7 @@ impl Body { } } -pub const ALL_OBJECTS: [Body; 55] = [ +pub const ALL_OBJECTS: [Body; 59] = [ Body::Arrow, Body::Bomb, Body::Scarecrow, @@ -123,7 +127,11 @@ pub const ALL_OBJECTS: [Body; 55] = [ Body::BoltFireBig, Body::ArrowSnake, Body::TrainingDummy, - Body::Firework, + Body::FireworkBlue, + Body::FireworkGreen, + Body::FireworkPurple, + Body::FireworkRed, + Body::FireworkYellow, ]; impl From for super::Body { @@ -187,7 +195,11 @@ impl Body { Body::BoltFireBig => "bolt_fire_big", Body::ArrowSnake => "arrow_snake", Body::TrainingDummy => "training_dummy", - Body::Firework => "firework", + Body::FireworkBlue => "firework_blue", + Body::FireworkGreen => "firework_green", + Body::FireworkPurple => "firework_purple", + Body::FireworkRed => "firework_red", + Body::FireworkYellow => "firework_yellow", } } } diff --git a/common/src/comp/inventory/item/mod.rs b/common/src/comp/inventory/item/mod.rs index b847361a60..7f1fbe8d61 100644 --- a/common/src/comp/inventory/item/mod.rs +++ b/common/src/comp/inventory/item/mod.rs @@ -20,7 +20,16 @@ use vek::Rgb; pub enum Throwable { Bomb, TrainingDummy, - Firework, + Firework(Reagent), +} + +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +pub enum Reagent { + Blue, + Green, + Purple, + Red, + Yellow, } #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] diff --git a/common/src/comp/misc.rs b/common/src/comp/misc.rs index e926d693c3..70bd4748c4 100644 --- a/common/src/comp/misc.rs +++ b/common/src/comp/misc.rs @@ -1,3 +1,4 @@ +use super::item::Reagent; use crate::sync::Uid; use serde::{Deserialize, Serialize}; use specs::Component; @@ -5,8 +6,13 @@ use specs_idvs::IdvStorage; #[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)] pub enum Object { - Bomb { owner: Option }, - Firework { owner: Option }, + Bomb { + owner: Option, + }, + Firework { + owner: Option, + reagent: Reagent, + }, } impl Component for Object { diff --git a/common/src/event.rs b/common/src/event.rs index 943757a2a7..671af425a6 100644 --- a/common/src/event.rs +++ b/common/src/event.rs @@ -1,5 +1,5 @@ use crate::{comp, sync::Uid, util::Dir}; -use comp::item::Item; +use comp::item::{Item, Reagent}; use parking_lot::Mutex; use specs::Entity as EcsEntity; use std::{collections::VecDeque, ops::DerefMut}; @@ -26,6 +26,7 @@ pub enum ServerEvent { power: f32, owner: Option, friendly_damage: bool, + reagent: Option, }, Damage { uid: Uid, diff --git a/common/src/outcome.rs b/common/src/outcome.rs index 4f89f418b0..6088e99959 100644 --- a/common/src/outcome.rs +++ b/common/src/outcome.rs @@ -1,4 +1,5 @@ use crate::comp; +use comp::item::Reagent; use serde::{Deserialize, Serialize}; use vek::*; @@ -12,6 +13,7 @@ pub enum Outcome { Explosion { pos: Vec3, power: f32, + reagent: Option, // How can we better define this? }, ProjectileShot { pos: Vec3, diff --git a/common/src/sys/projectile.rs b/common/src/sys/projectile.rs index 20f96fc311..439f038a95 100644 --- a/common/src/sys/projectile.rs +++ b/common/src/sys/projectile.rs @@ -71,6 +71,7 @@ impl<'a> System<'a> for Sys { power, owner: projectile.owner, friendly_damage: false, + reagent: None, }) }, projectile::Effect::Vanish => server_emitter.emit(ServerEvent::Destroy { @@ -133,6 +134,7 @@ impl<'a> System<'a> for Sys { power, owner: projectile.owner, friendly_damage: false, + reagent: None, }) }, projectile::Effect::Vanish => server_emitter.emit(ServerEvent::Destroy { diff --git a/server/src/cmd.rs b/server/src/cmd.rs index 5a282766fd..8f828673cf 100644 --- a/server/src/cmd.rs +++ b/server/src/cmd.rs @@ -1039,6 +1039,7 @@ fn handle_explosion( power, owner: ecs.read_storage::().get(target).copied(), friendly_damage: true, + reagent: None, }) }, None => server.notify_client( diff --git a/server/src/events/entity_manipulation.rs b/server/src/events/entity_manipulation.rs index ff6f4ae2b6..4a8cfe12d2 100644 --- a/server/src/events/entity_manipulation.rs +++ b/server/src/events/entity_manipulation.rs @@ -13,6 +13,7 @@ use common::{ terrain::{Block, TerrainGrid}, vol::{ReadVol, Vox}, }; +use comp::item::Reagent; use specs::{join::Join, saveload::MarkerAllocator, Entity as EcsEntity, WorldExt}; use tracing::error; use vek::Vec3; @@ -284,6 +285,7 @@ pub fn handle_explosion( power: f32, owner: Option, friendly_damage: bool, + reagent: Option, ) { // Go through all other entities let hit_range = 3.0 * power; @@ -291,7 +293,11 @@ pub fn handle_explosion( // Add an outcome ecs.write_resource::>() - .push(Outcome::Explosion { pos, power }); + .push(Outcome::Explosion { + pos, + power, + reagent, + }); let owner_entity = owner.and_then(|uid| { ecs.read_resource::() diff --git a/server/src/events/inventory_manip.rs b/server/src/events/inventory_manip.rs index b8d5d1a01e..31dbe26b35 100644 --- a/server/src/events/inventory_manip.rs +++ b/server/src/events/inventory_manip.rs @@ -11,10 +11,11 @@ use common::{ terrain::block::Block, vol::{ReadVol, Vox}, }; +use comp::LightEmitter; use rand::Rng; use specs::{join::Join, world::WorldExt, Builder, Entity as EcsEntity, WriteStorage}; use tracing::{debug, error}; -use vek::Vec3; +use vek::{Rgb, Vec3}; pub fn swap_lantern( storage: &mut WriteStorage, @@ -400,10 +401,16 @@ pub fn handle_inventory(server: &mut Server, entity: EcsEntity, manip: comp::Inv .build(); } + let mut rng = rand::thread_rng(); + // Throw items for (pos, vel, ori, kind) in thrown_items { let vel = match kind { - item::Throwable::Firework => Vec3::unit_z() * 200.0, + item::Throwable::Firework(_) => Vec3::new( + rng.gen_range(-15.0, 15.0), + rng.gen_range(-15.0, 15.0), + rng.gen_range(80.0, 110.0), + ), _ => { vel.0 + *ori.0 * 20.0 @@ -417,7 +424,13 @@ pub fn handle_inventory(server: &mut Server, entity: EcsEntity, manip: comp::Inv let mut new_entity = state .create_object(Default::default(), match kind { item::Throwable::Bomb => comp::object::Body::Bomb, - item::Throwable::Firework => comp::object::Body::Bomb, + item::Throwable::Firework(reagent) => match reagent { + item::Reagent::Blue => comp::object::Body::FireworkBlue, + item::Reagent::Green => comp::object::Body::FireworkGreen, + item::Reagent::Purple => comp::object::Body::FireworkPurple, + item::Reagent::Red => comp::object::Body::FireworkRed, + item::Reagent::Yellow => comp::object::Body::FireworkYellow, + }, item::Throwable::TrainingDummy => comp::object::Body::TrainingDummy, }) .with(comp::Pos(pos.0 + Vec3::unit_z() * 0.25)) @@ -427,8 +440,18 @@ pub fn handle_inventory(server: &mut Server, entity: EcsEntity, manip: comp::Inv item::Throwable::Bomb => { new_entity = new_entity.with(comp::Object::Bomb { owner: uid }); }, - item::Throwable::Firework => { - new_entity = new_entity.with(comp::Object::Firework { owner: uid }); + item::Throwable::Firework(reagent) => { + new_entity = new_entity + .with(comp::Object::Firework { + owner: uid, + reagent, + }) + .with(LightEmitter { + animated: true, + flicker: 2.0, + strength: 2.0, + col: Rgb::new(1.0, 1.0, 0.0), + }); }, item::Throwable::TrainingDummy => { new_entity = new_entity.with(comp::Stats::new( diff --git a/server/src/events/mod.rs b/server/src/events/mod.rs index 412d9a536a..948fbc6355 100644 --- a/server/src/events/mod.rs +++ b/server/src/events/mod.rs @@ -55,7 +55,8 @@ impl Server { power, owner, friendly_damage, - } => handle_explosion(&self, pos, power, owner, friendly_damage), + reagent, + } => handle_explosion(&self, pos, power, owner, friendly_damage, reagent), ServerEvent::Shoot { entity, dir, diff --git a/server/src/sys/object.rs b/server/src/sys/object.rs index 81a2200fbe..8a59fd32a6 100644 --- a/server/src/sys/object.rs +++ b/server/src/sys/object.rs @@ -26,8 +26,14 @@ impl<'a> System<'a> for Sys { let mut server_emitter = server_bus.emitter(); // Objects - for (entity, pos, vel, physics, object) in - (&entities, &positions, &velocities, &physics_states, &mut objects).join() + for (entity, pos, vel, physics, object) in ( + &entities, + &positions, + &velocities, + &physics_states, + &mut objects, + ) + .join() { match object { Object::Bomb { owner } => { @@ -41,11 +47,12 @@ impl<'a> System<'a> for Sys { power: 4.0, owner: *owner, friendly_damage: true, + reagent: None, }); } }, - Object::Firework { owner } => { - if physics.on_surface().is_some() || vel.0.z < 0.0 { + Object::Firework { owner, reagent } => { + if vel.0.z < 0.0 { server_emitter.emit(ServerEvent::Destroy { entity, cause: HealthSource::Suicide, @@ -55,6 +62,7 @@ impl<'a> System<'a> for Sys { power: 4.0, owner: *owner, friendly_damage: true, + reagent: Some(*reagent), }); } }, diff --git a/voxygen/src/audio/sfx/mod.rs b/voxygen/src/audio/sfx/mod.rs index 783056271b..8c47867aa1 100644 --- a/voxygen/src/audio/sfx/mod.rs +++ b/voxygen/src/audio/sfx/mod.rs @@ -273,7 +273,7 @@ impl SfxMgr { } match outcome { - Outcome::Explosion { pos, power } => { + Outcome::Explosion { pos, power, .. } => { audio.play_sfx( // TODO: from sfx triggers config "voxygen.audio.sfx.explosion", diff --git a/voxygen/src/lib.rs b/voxygen/src/lib.rs index ccec393b41..9eeeb17318 100644 --- a/voxygen/src/lib.rs +++ b/voxygen/src/lib.rs @@ -1,6 +1,6 @@ #![deny(unsafe_code)] #![allow(clippy::option_map_unit_fn)] -#![feature(drain_filter, bool_to_option)] +#![feature(drain_filter, bool_to_option, or_patterns)] #![recursion_limit = "2048"] #[macro_use] diff --git a/voxygen/src/render/pipelines/particle.rs b/voxygen/src/render/pipelines/particle.rs index eae013242d..616e3158c4 100644 --- a/voxygen/src/render/pipelines/particle.rs +++ b/voxygen/src/render/pipelines/particle.rs @@ -87,6 +87,11 @@ pub enum ParticleMode { CampfireFire = 1, GunPowderSpark = 2, Shrapnel = 3, + FireworkBlue = 4, + FireworkGreen = 5, + FireworkPurple = 6, + FireworkRed = 7, + FireworkYellow = 8, } impl ParticleMode { diff --git a/voxygen/src/scene/figure/load.rs b/voxygen/src/scene/figure/load.rs index 6489891367..01c7044073 100644 --- a/voxygen/src/scene/figure/load.rs +++ b/voxygen/src/scene/figure/load.rs @@ -3418,7 +3418,26 @@ pub fn mesh_object( Vec3::new(-0.5, -6.0, -1.5), ), Body::Bomb => ("object.bomb", Vec3::new(-5.5, -5.5, 0.0)), - Body::Firework => ("object.firework", Vec3::new(-5.5, -5.5, 0.0)), + Body::FireworkBlue => ( + "weapon.projectile.fireworks_blue-0", + Vec3::new(0.0, 0.0, 0.0), + ), + Body::FireworkGreen => ( + "weapon.projectile.fireworks_green-0", + Vec3::new(0.0, 0.0, 0.0), + ), + Body::FireworkPurple => ( + "weapon.projectile.fireworks_purple-0", + Vec3::new(0.0, 0.0, 0.0), + ), + Body::FireworkRed => ( + "weapon.projectile.fireworks_red-0", + Vec3::new(0.0, 0.0, 0.0), + ), + Body::FireworkYellow => ( + "weapon.projectile.fireworks_yellow-0", + Vec3::new(0.0, 0.0, 0.0), + ), Body::Scarecrow => ("object.scarecrow", Vec3::new(-9.5, -4.0, 0.0)), Body::Cauldron => ("object.cauldron", Vec3::new(-10.0, -10.0, 0.0)), Body::ChestVines => ("object.chest_vines", Vec3::new(-7.5, -6.0, 0.0)), diff --git a/voxygen/src/scene/mod.rs b/voxygen/src/scene/mod.rs index 5eacf0870b..c4e338d463 100644 --- a/voxygen/src/scene/mod.rs +++ b/voxygen/src/scene/mod.rs @@ -26,6 +26,7 @@ use common::{ terrain::{BlockKind, TerrainChunk}, vol::ReadVol, }; +use comp::item::Reagent; use specs::{Entity as EcsEntity, Join, WorldExt}; use vek::*; @@ -203,9 +204,31 @@ impl Scene { self.sfx_mgr.handle_outcome(&outcome, audio); match outcome { - Outcome::Explosion { pos, power, .. } => self.event_lights.push(EventLight { - light: Light::new(*pos, Rgb::new(1.0, 0.5, 0.0), *power * 2.5), - timeout: 0.5, + Outcome::Explosion { + pos, + power, + reagent, + } => self.event_lights.push(EventLight { + light: Light::new( + *pos, + match reagent { + Some(Reagent::Blue) => Rgb::new(0.0, 0.0, 1.0), + Some(Reagent::Green) => Rgb::new(0.0, 1.0, 0.0), + Some(Reagent::Purple) => Rgb::new(1.0, 0.0, 1.0), + Some(Reagent::Red) => Rgb::new(1.0, 0.0, 0.0), + Some(Reagent::Yellow) => Rgb::new(1.0, 1.0, 0.0), + None => Rgb::new(1.0, 0.5, 0.0), + }, + *power + * match reagent { + Some(_) => 5.0, + None => 2.5, + }, + ), + timeout: match reagent { + Some(_) => 1.0, + None => 0.5, + }, fadeout: |timeout| timeout * 2.0, }), Outcome::ProjectileShot { .. } => {}, diff --git a/voxygen/src/scene/particle.rs b/voxygen/src/scene/particle.rs index f797ba9e89..aff6107727 100644 --- a/voxygen/src/scene/particle.rs +++ b/voxygen/src/scene/particle.rs @@ -8,7 +8,7 @@ use crate::{ }; use common::{ assets, - comp::{object, Body, CharacterState, Pos}, + comp::{item::Reagent, object, Body, CharacterState, Pos}, figure::Segment, outcome::Outcome, }; @@ -48,15 +48,27 @@ impl ParticleMgr { let mut rng = rand::thread_rng(); match outcome { - Outcome::Explosion { pos, power } => { + Outcome::Explosion { + pos, + power, + reagent, + } => { for _ in 0..150 { self.particles.push(Particle::new( - Duration::from_millis(250), + Duration::from_millis(if reagent.is_some() { 1000 } else { 250 }), time, - ParticleMode::Shrapnel, + match reagent { + Some(Reagent::Blue) => ParticleMode::FireworkBlue, + Some(Reagent::Green) => ParticleMode::FireworkGreen, + Some(Reagent::Purple) => ParticleMode::FireworkPurple, + Some(Reagent::Red) => ParticleMode::FireworkRed, + Some(Reagent::Yellow) => ParticleMode::FireworkYellow, + None => ParticleMode::Shrapnel, + }, *pos, )); } + for _ in 0..200 { self.particles.push(Particle::new( Duration::from_secs(4), @@ -113,7 +125,14 @@ impl ParticleMgr { Body::Object(object::Body::BoltFireBig) => { self.maintain_boltfirebig_particles(scene_data, pos) }, - Body::Object(object::Body::Bomb) => self.maintain_bomb_particles(scene_data, pos), + Body::Object( + object::Body::Bomb + | object::Body::FireworkBlue + | object::Body::FireworkGreen + | object::Body::FireworkPurple + | object::Body::FireworkRed + | object::Body::FireworkYellow, + ) => self.maintain_bomb_particles(scene_data, pos), _ => {}, } } From fcdd875bff7ff78b41d55e6b284be5869bd6bc90 Mon Sep 17 00:00:00 2001 From: Monty Marz Date: Wed, 12 Aug 2020 18:10:18 +0000 Subject: [PATCH 3/3] UI fixes, assets update --- .../common/items/debug/dungeon_purple-0.ron | 12 ++ .../weapons/hammer/cultist_purp_2h-0.ron | 13 ++ assets/voxygen/audio/soundtrack.ron | 7 ++ .../audio/soundtrack/a_solemn_quest.ogg | 3 + assets/voxygen/background/bg_9.png | 4 +- assets/voxygen/background/bg_main.png | 4 +- assets/voxygen/element/help.png | 4 +- assets/voxygen/i18n/de_DE.ron | 6 +- assets/voxygen/i18n/en.ron | 6 +- assets/voxygen/item_image_manifest.ron | 4 + assets/voxygen/shaders/particle-frag.glsl | 2 +- assets/voxygen/shaders/particle-vert.glsl | 10 +- .../figure/accessory/orc/male_eyepatch.vox | 3 + .../accessory/undead/female_eyepatch.vox | 3 + .../figure/accessory/undead/male_eyepatch.vox | 3 + .../voxygen/voxel/humanoid_head_manifest.ron | 7 +- .../voxel/humanoid_main_weapon_manifest.ron | 4 + .../voxel/weapon/hammer/cult_purp-0.vox | 3 + .../voxel/weapon/projectile/multi-arrow.vox | 3 + common/src/comp/body/humanoid.rs | 6 +- common/src/comp/body/object.rs | 5 +- common/src/comp/inventory/item/tool.rs | 2 +- voxygen/src/controller.rs | 2 +- voxygen/src/hud/chat.rs | 2 +- voxygen/src/hud/mod.rs | 2 +- voxygen/src/hud/overhead.rs | 5 +- voxygen/src/menu/main/ui.rs | 114 ++++++++++-------- voxygen/src/scene/figure/load.rs | 1 + voxygen/src/settings.rs | 4 +- voxygen/src/window.rs | 7 +- 30 files changed, 170 insertions(+), 81 deletions(-) create mode 100644 assets/common/items/debug/dungeon_purple-0.ron create mode 100644 assets/common/items/weapons/hammer/cultist_purp_2h-0.ron create mode 100644 assets/voxygen/audio/soundtrack/a_solemn_quest.ogg create mode 100644 assets/voxygen/voxel/figure/accessory/orc/male_eyepatch.vox create mode 100644 assets/voxygen/voxel/figure/accessory/undead/female_eyepatch.vox create mode 100644 assets/voxygen/voxel/figure/accessory/undead/male_eyepatch.vox create mode 100644 assets/voxygen/voxel/weapon/hammer/cult_purp-0.vox create mode 100644 assets/voxygen/voxel/weapon/projectile/multi-arrow.vox diff --git a/assets/common/items/debug/dungeon_purple-0.ron b/assets/common/items/debug/dungeon_purple-0.ron new file mode 100644 index 0000000000..e877374a9a --- /dev/null +++ b/assets/common/items/debug/dungeon_purple-0.ron @@ -0,0 +1,12 @@ +Item( + name: "Purple Admin Cape", + description: "Where did I put my banhammer again?", + kind: Armor( + ( + kind: Back("DungPurp0"), + stats: ( + protection: Invincible, + ), + ) + ), +) diff --git a/assets/common/items/weapons/hammer/cultist_purp_2h-0.ron b/assets/common/items/weapons/hammer/cultist_purp_2h-0.ron new file mode 100644 index 0000000000..b1cdc4a25d --- /dev/null +++ b/assets/common/items/weapons/hammer/cultist_purp_2h-0.ron @@ -0,0 +1,13 @@ +Item( + name: "Magical Cultist Warhammer", + description: "This belonged to an evil Cult Leader.", + kind: Tool( + ( + kind: Hammer("CultPurp0"), + stats: ( + equip_time_millis: 500, + power: 2.00, + ), + ) + ), +) diff --git a/assets/voxygen/audio/soundtrack.ron b/assets/voxygen/audio/soundtrack.ron index 07f57316bf..deacc2c074 100644 --- a/assets/voxygen/audio/soundtrack.ron +++ b/assets/voxygen/audio/soundtrack.ron @@ -9,6 +9,13 @@ length: 629.0, timing: Some(Day), artist: "https://www.youtube.com/watch?v=FwVTkB-BIvM", + ), + ( + title: "A Solemn Quest Day", + path: "voxygen.audio.ambient.a_solemn_quest", + length: 206.0, + timing: Some(Day), + artist: "Eden", ), ( title: "Into The Dark Forest", diff --git a/assets/voxygen/audio/soundtrack/a_solemn_quest.ogg b/assets/voxygen/audio/soundtrack/a_solemn_quest.ogg new file mode 100644 index 0000000000..f3e7b16c95 --- /dev/null +++ b/assets/voxygen/audio/soundtrack/a_solemn_quest.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:03d18d9709710be041d9426681e3c43add2482fcb5075dbd67dbb0ef2c8c5132 +size 11626250 diff --git a/assets/voxygen/background/bg_9.png b/assets/voxygen/background/bg_9.png index dd6e2ac5b6..54b67e18d8 100644 --- a/assets/voxygen/background/bg_9.png +++ b/assets/voxygen/background/bg_9.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9ab7a56d699fc98ebb01d553d6c1d1736fea3ca639fee3fecf48e8a98947247c -size 899468 +oid sha256:6abf95dd5069525eaf35437efa09c0ba7c9bcb65ab50bba7a006fff825a2d675 +size 2782437 diff --git a/assets/voxygen/background/bg_main.png b/assets/voxygen/background/bg_main.png index 54b67e18d8..7bc1ca0499 100644 --- a/assets/voxygen/background/bg_main.png +++ b/assets/voxygen/background/bg_main.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6abf95dd5069525eaf35437efa09c0ba7c9bcb65ab50bba7a006fff825a2d675 -size 2782437 +oid sha256:131106ba0e9fb5fd1aad22725611d3911bd094d87573d680dc3aea5232cc0620 +size 1803337 diff --git a/assets/voxygen/element/help.png b/assets/voxygen/element/help.png index 68c382b3f6..9dc6699892 100644 --- a/assets/voxygen/element/help.png +++ b/assets/voxygen/element/help.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8bf2944cf39261d9f32fab48e9194e874e5ec93f31cdf8a039e14764395c1b6b -size 16021 +oid sha256:6cfd63e171326af7b6d7561208b85dec5c2abe9111109a3808ea5942b09d5319 +size 22160 diff --git a/assets/voxygen/i18n/de_DE.ron b/assets/voxygen/i18n/de_DE.ron index 86f73364f8..bf96a3e9b5 100644 --- a/assets/voxygen/i18n/de_DE.ron +++ b/assets/voxygen/i18n/de_DE.ron @@ -384,7 +384,7 @@ magischen Gegenstände ergattern?"#, "gameinput.wallleap": "Wandsprung", "gameinput.togglelantern": "Laterne ein-/ausschalten", "gameinput.mount": "Aufsteigen", - "gameinput.enter": "Betreten", + "gameinput.chat": "Chat", "gameinput.command": "Befehl", "gameinput.escape": "Escape", "gameinput.map": "Karte", @@ -403,6 +403,10 @@ magischen Gegenstände ergattern?"#, "gameinput.declinegroupinvite": "Ablehnen", "gameinput.acceptgroupinvite": "Annehmen", "gameinput.select": "Auswählen", + "gameinput.crafting": "Crafting", + "gameinput.sneak": "Schleichen", + "gameinput.swimdown": "Abwärts Tauchen", + "gameinput.swimup": "Aufwärts Schwimmen", /// End GameInput section diff --git a/assets/voxygen/i18n/en.ron b/assets/voxygen/i18n/en.ron index a9272a153e..6eb69f292f 100644 --- a/assets/voxygen/i18n/en.ron +++ b/assets/voxygen/i18n/en.ron @@ -385,7 +385,7 @@ magically infused items?"#, "gameinput.wallleap": "Wall Leap", "gameinput.togglelantern": "Toggle Lantern", "gameinput.mount": "Mount", - "gameinput.enter": "Enter", + "gameinput.chat": "Chat", "gameinput.command": "Command", "gameinput.escape": "Escape", "gameinput.map": "Map", @@ -404,6 +404,10 @@ magically infused items?"#, "gameinput.select": "Select Entity", "gameinput.acceptgroupinvite": "Accept Group Invite", "gameinput.declinegroupinvite": "Decline Group Invite", + "gameinput.crafting": "Crafting", + "gameinput.sneak": "Sneak", + "gameinput.swimdown": "Dive downwards", + "gameinput.swimup": "Swim upwards", /// End GameInput section diff --git a/assets/voxygen/item_image_manifest.ron b/assets/voxygen/item_image_manifest.ron index 7bfa8a6c2f..77d2638409 100644 --- a/assets/voxygen/item_image_manifest.ron +++ b/assets/voxygen/item_image_manifest.ron @@ -480,6 +480,10 @@ "voxel.weapon.hammer.2hhammer_mjolnir", (2.0, -1.0, 0.0), (-135.0, 90.0, 0.0), 1.1, ), + Tool(Hammer("CultPurp0")): VoxTrans( + "voxel.weapon.hammer.cult_purp-0", + (2.0, -1.0, 0.0), (-135.0, 90.0, 0.0), 1.1, + ), // Staffs Tool(Staff("BasicStaff")): VoxTrans( "voxel.weapon.staff.firestaff_starter", diff --git a/assets/voxygen/shaders/particle-frag.glsl b/assets/voxygen/shaders/particle-frag.glsl index 3d730f7a50..ebbc8e1786 100644 --- a/assets/voxygen/shaders/particle-frag.glsl +++ b/assets/voxygen/shaders/particle-frag.glsl @@ -34,5 +34,5 @@ void main() { vec3 fog_color = get_sky_color(normalize(f_pos - cam_pos.xyz), time_of_day.x, cam_pos.xyz, f_pos, 0.5, true, clouds); vec3 color = mix(mix(surf_color, fog_color, fog_level), clouds.rgb, clouds.a); - tgt_color = vec4(color, 1.0 - clamp((distance(focus_pos.xy, f_pos.xy) - (1000.0 - FADE_DIST)) / FADE_DIST, 0, 1)); + tgt_color = vec4(color, 0.3); } diff --git a/assets/voxygen/shaders/particle-vert.glsl b/assets/voxygen/shaders/particle-vert.glsl index 10fd626140..14a597d429 100644 --- a/assets/voxygen/shaders/particle-vert.glsl +++ b/assets/voxygen/shaders/particle-vert.glsl @@ -55,6 +55,10 @@ float exp_scale(float factor) { return 1 / (1 - lifetime * factor); } +float linear_scale(float factor) { + return lifetime * factor; +} + void main() { float rand0 = hash(vec4(inst_entropy + 0)); float rand1 = hash(vec4(inst_entropy + 1)); @@ -70,10 +74,10 @@ void main() { if (inst_mode == SMOKE) { attr = Attr( linear_motion( - vec3(rand0 * 0.25, rand1 * 0.25, 1.7 + rand5), - vec3(rand2 * 0.2, rand3 * 0.2, 1.0 + rand4 * 0.5)// + vec3(sin(lifetime), sin(lifetime + 1.5), sin(lifetime * 4) * 0.25) + vec3(0.0, 0.0, 0.0), + vec3(rand2 * 0.1, rand3 * 0.1, 1.0 + rand4 * 0.1)// + vec3(sin(lifetime), sin(lifetime + 1.5), sin(lifetime * 4) * 0.25) ), - exp_scale(-0.2), + linear_scale(0.5), vec3(1) ); } else if (inst_mode == FIRE) { diff --git a/assets/voxygen/voxel/figure/accessory/orc/male_eyepatch.vox b/assets/voxygen/voxel/figure/accessory/orc/male_eyepatch.vox new file mode 100644 index 0000000000..5ea825ae0a --- /dev/null +++ b/assets/voxygen/voxel/figure/accessory/orc/male_eyepatch.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7a3e1cacba8ff0a8ac3c91e85c4d3f3e92dcc3c699a629a84730aed6f3451b8b +size 1192 diff --git a/assets/voxygen/voxel/figure/accessory/undead/female_eyepatch.vox b/assets/voxygen/voxel/figure/accessory/undead/female_eyepatch.vox new file mode 100644 index 0000000000..ea5af4024e --- /dev/null +++ b/assets/voxygen/voxel/figure/accessory/undead/female_eyepatch.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7729c594f1f83fa8952827dfea766a6052ef191ee1c36fb30a01b1375ebab540 +size 1224 diff --git a/assets/voxygen/voxel/figure/accessory/undead/male_eyepatch.vox b/assets/voxygen/voxel/figure/accessory/undead/male_eyepatch.vox new file mode 100644 index 0000000000..5ed9d52354 --- /dev/null +++ b/assets/voxygen/voxel/figure/accessory/undead/male_eyepatch.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:922d12840831ac4976e5c1fd6445f67625a39cdf9320961935c3d83dcb94afa1 +size 1192 diff --git a/assets/voxygen/voxel/humanoid_head_manifest.ron b/assets/voxygen/voxel/humanoid_head_manifest.ron index 95abf4652a..7308e4b5f3 100644 --- a/assets/voxygen/voxel/humanoid_head_manifest.ron +++ b/assets/voxygen/voxel/humanoid_head_manifest.ron @@ -108,6 +108,7 @@ Some(("figure.accessory.orc.teeth-1", (5, 11, 3))), Some(("figure.accessory.orc.teeth-2", (5, 11, 3))), Some(("figure.accessory.orc.warpaint-male-0", (0, 4, 3))), + Some(("figure.accessory.orc.male_eyepatch", (0, 3, 0))), ], ), (Orc, Female): ( @@ -302,7 +303,8 @@ ], beard: [None], accessory: [ - None] + None, + Some(("figure.accessory.undead.male_eyepatch", (0, 1, 0))),] ), (Undead, Female): ( offset: (-5.0, -4.0, -6.75), @@ -322,7 +324,8 @@ ], beard: [None], accessory: [ - None] + None, + Some(("figure.accessory.undead.female_eyepatch", (0, 1, -1))),] ), (Danari, Male): ( offset: (-9.0, -4.0, -7.5), diff --git a/assets/voxygen/voxel/humanoid_main_weapon_manifest.ron b/assets/voxygen/voxel/humanoid_main_weapon_manifest.ron index f9269bbe00..96bec81511 100644 --- a/assets/voxygen/voxel/humanoid_main_weapon_manifest.ron +++ b/assets/voxygen/voxel/humanoid_main_weapon_manifest.ron @@ -425,6 +425,10 @@ vox_spec: ("weapon.hammer.2hhammer_mjolnir", (-2.5, -8.5, -4.0)), color: None ), + Hammer("CultPurp0"): ( + vox_spec: ("weapon.hammer.cult_purp-0", (-3.5, -4.5, -5.0)), + color: None + ), /*Dagger("Craftsman"): ( //TODO This should be a 1h hammer! vox_spec: ("weapon.hammer.craftsman", (-2.0, -5.0, -5.5)), color: None diff --git a/assets/voxygen/voxel/weapon/hammer/cult_purp-0.vox b/assets/voxygen/voxel/weapon/hammer/cult_purp-0.vox new file mode 100644 index 0000000000..d291dbb76b --- /dev/null +++ b/assets/voxygen/voxel/weapon/hammer/cult_purp-0.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c8f27d01ee0753187f94dffe44aa0bd957dd02b9b674dad122e48eec4fd0a971 +size 2648 diff --git a/assets/voxygen/voxel/weapon/projectile/multi-arrow.vox b/assets/voxygen/voxel/weapon/projectile/multi-arrow.vox new file mode 100644 index 0000000000..8fd61a5e1e --- /dev/null +++ b/assets/voxygen/voxel/weapon/projectile/multi-arrow.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9604eb8bf5715e577e23208a92b501f195bb48c5411cc041dc7d52762b21ccf5 +size 1300 diff --git a/common/src/comp/body/humanoid.rs b/common/src/comp/body/humanoid.rs index 3785be2dbb..ff1276da72 100644 --- a/common/src/comp/body/humanoid.rs +++ b/common/src/comp/body/humanoid.rs @@ -441,9 +441,9 @@ impl Species { (Species::Human, BodyType::Female) => 1, (Species::Human, BodyType::Male) => 1, (Species::Orc, BodyType::Female) => 4, - (Species::Orc, BodyType::Male) => 5, - (Species::Undead, BodyType::Female) => 1, - (Species::Undead, BodyType::Male) => 1, + (Species::Orc, BodyType::Male) => 6, + (Species::Undead, BodyType::Female) => 2, + (Species::Undead, BodyType::Male) => 2, } } diff --git a/common/src/comp/body/object.rs b/common/src/comp/body/object.rs index fe73e92172..e94d21a93d 100644 --- a/common/src/comp/body/object.rs +++ b/common/src/comp/body/object.rs @@ -63,6 +63,7 @@ pub enum Body { FireworkPurple = 56, FireworkRed = 57, FireworkYellow = 58, + MultiArrow = 59, } impl Body { @@ -72,7 +73,7 @@ impl Body { } } -pub const ALL_OBJECTS: [Body; 59] = [ +pub const ALL_OBJECTS: [Body; 60] = [ Body::Arrow, Body::Bomb, Body::Scarecrow, @@ -132,6 +133,7 @@ pub const ALL_OBJECTS: [Body; 59] = [ Body::FireworkPurple, Body::FireworkRed, Body::FireworkYellow, + Body::MultiArrow, ]; impl From for super::Body { @@ -200,6 +202,7 @@ impl Body { Body::FireworkPurple => "firework_purple", Body::FireworkRed => "firework_red", Body::FireworkYellow => "firework_yellow", + Body::MultiArrow => "multi_arrow", } } } diff --git a/common/src/comp/inventory/item/tool.rs b/common/src/comp/inventory/item/tool.rs index b040f0517f..335807ad3c 100644 --- a/common/src/comp/inventory/item/tool.rs +++ b/common/src/comp/inventory/item/tool.rs @@ -191,7 +191,7 @@ impl Tool { prepare_duration: Duration::from_millis(100), charge_duration: Duration::from_millis(1500), recover_duration: Duration::from_millis(500), - projectile_body: Body::Object(object::Body::Arrow), + projectile_body: Body::Object(object::Body::MultiArrow), projectile_light: None, }, ], diff --git a/voxygen/src/controller.rs b/voxygen/src/controller.rs index 42f60cb3e3..44b286c2e2 100644 --- a/voxygen/src/controller.rs +++ b/voxygen/src/controller.rs @@ -72,7 +72,7 @@ impl From<&crate::settings::GamepadSettings> for ControllerSettings { .push(GameInput::Escape); map.entry(settings.game_buttons.enter) .or_default() - .push(GameInput::Enter); + .push(GameInput::Chat); map.entry(settings.game_buttons.command) .or_default() .push(GameInput::Command); diff --git a/voxygen/src/hud/chat.rs b/voxygen/src/hud/chat.rs index 7b5ac61548..2e35de6493 100644 --- a/voxygen/src/hud/chat.rs +++ b/voxygen/src/hud/chat.rs @@ -374,7 +374,7 @@ impl<'a> Widget for Chat<'a> { .w_h(20.0, 20.0) .hover_image(self.imgs.chat_arrow_mo) .press_image(self.imgs.chat_arrow_press) - .bottom_right_with_margins_on(state.ids.message_box_bg, 0.0, -22.0) + .top_right_with_margins_on(state.ids.message_box_bg, 0.0, -22.0) .parent(id) .set(state.ids.chat_arrow, ui) .was_clicked() diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index 440bb77848..c2510cbea0 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -2250,7 +2250,7 @@ impl Hud { _ if !self.show.ui => false, WinEvent::Zoom(_) => !cursor_grabbed && !self.ui.no_widget_capturing_mouse(), - WinEvent::InputUpdate(GameInput::Enter, true) => { + WinEvent::InputUpdate(GameInput::Chat, true) => { self.ui.focus_widget(if self.typing() { None } else { diff --git a/voxygen/src/hud/overhead.rs b/voxygen/src/hud/overhead.rs index b14f39c213..3a990f5220 100644 --- a/voxygen/src/hud/overhead.rs +++ b/voxygen/src/hud/overhead.rs @@ -354,11 +354,10 @@ impl<'a> Widget for Overhead<'a> { })) .parent(id) .set(state.ids.health_bar, ui); - // TODO Only show health values for entities below 100% health let mut txt = format!( "{}/{}", - self.stats.health.current().max(1) / 10 as u32, /* Don't show 0 health for - * living entities */ + (self.stats.health.current() / 10).max(1) as u32, /* Don't show 0 health for + * living entities */ self.stats.health.maximum() / 10 as u32, ); if self.stats.is_dead { diff --git a/voxygen/src/menu/main/ui.rs b/voxygen/src/menu/main/ui.rs index e1f17b4440..d14a4e3549 100644 --- a/voxygen/src/menu/main/ui.rs +++ b/voxygen/src/menu/main/ui.rs @@ -262,6 +262,7 @@ impl<'a> MainMenuUi { env!("CARGO_PKG_VERSION"), common::util::GIT_VERSION.to_string() ); + let scale = 0.8; const TEXT_COLOR: Color = Color::Rgba(1.0, 1.0, 1.0, 1.0); const TEXT_COLOR_2: Color = Color::Rgba(1.0, 1.0, 1.0, 0.2); const TEXT_BG: Color = Color::Rgba(0.0, 0.0, 0.0, 1.0); @@ -329,9 +330,10 @@ impl<'a> MainMenuUi { }; // Version displayed top right corner + let pos = if self.connect { 5.0 } else { 98.0 }; Text::new(&version) .color(TEXT_COLOR) - .top_right_with_margins_on(ui_widgets.window, 5.0, 5.0) + .top_right_with_margins_on(ui_widgets.window, pos * scale, 10.0 * scale) .font_id(self.fonts.cyri.conrod_id) .font_size(self.fonts.cyri.scale(14)) .set(self.ids.version, ui_widgets); @@ -462,20 +464,21 @@ impl<'a> MainMenuUi { if !self.connect { Image::new(self.imgs.banner) - .w_h(65.0 * 6.0, 100.0 * 6.0) + .w_h(65.0 * 6.0 * scale, 100.0 * 6.0 * scale) .middle_of(self.ids.bg) - .color(Some(Color::Rgba(0.0, 0.0, 0.0, 0.9))) + .color(Some(Color::Rgba(0.0, 0.0, 0.0, 0.0))) .set(self.ids.banner, ui_widgets); Image::new(self.imgs.banner_top) - .w_h(70.0 * 6.0, 34.0) + .w_h(70.0 * 6.0 * scale, 34.0 * scale) .mid_top_with_margin_on(self.ids.banner, -34.0) + .color(Some(Color::Rgba(0.0, 0.0, 0.0, 0.0))) .set(self.ids.banner_top, ui_widgets); // Logo Image::new(self.imgs.v_logo) - .w_h(123.0 * 2.5, 35.0 * 2.5) - .mid_top_with_margin_on(self.ids.banner_top, 45.0) + .w_h(123.0 * 2.5 * scale, 35.0 * 2.5 * scale) + .top_right_with_margins_on(self.ids.bg, 10.0, 10.0) .color(Some(Color::Rgba(1.0, 1.0, 1.0, 0.95))) .set(self.ids.v_logo, ui_widgets); @@ -536,18 +539,18 @@ impl<'a> MainMenuUi { }; } // Info Window - Rectangle::fill_with([550.0, 250.0], COL1) - .top_left_with_margins_on(ui_widgets.window, 40.0, 40.0) - .color(Color::Rgba(0.0, 0.0, 0.0, 0.95)) + Rectangle::fill_with([550.0 * scale, 250.0 * scale], COL1) + .top_left_with_margins_on(ui_widgets.window, 40.0 * scale, 40.0 * scale) + .color(Color::Rgba(0.0, 0.0, 0.0, 0.80)) .set(self.ids.info_frame, ui_widgets); Image::new(self.imgs.banner_bottom) - .mid_bottom_with_margin_on(self.ids.info_frame, -50.0) - .w_h(550.0, 50.0) - .color(Some(Color::Rgba(0.0, 0.0, 0.0, 0.95))) + .mid_bottom_with_margin_on(self.ids.info_frame, -50.0 * scale) + .w_h(550.0 * scale, 50.0 * scale) + .color(Some(Color::Rgba(0.0, 0.0, 0.0, 0.80))) .set(self.ids.info_bottom, ui_widgets); Text::new(intro_text) - .top_left_with_margins_on(self.ids.info_frame, 15.0, 15.0) - .font_size(self.fonts.cyri.scale(20)) + .top_left_with_margins_on(self.ids.info_frame, 15.0 * scale, 15.0 * scale) + .font_size(self.fonts.cyri.scale(16)) .font_id(self.fonts.cyri.conrod_id) .color(TEXT_COLOR) .set(self.ids.info_text, ui_widgets); @@ -568,17 +571,20 @@ impl<'a> MainMenuUi { } // Username - Rectangle::fill_with([320.0, 50.0], color::rgba(0.0, 0.0, 0.0, 0.0)) - .mid_top_with_margin_on(self.ids.banner_top, 150.0) - .set(self.ids.usrnm_bg, ui_widgets); + Rectangle::fill_with( + [320.0 * scale, 50.0 * scale], + color::rgba(0.0, 0.0, 0.0, 0.0), + ) + .mid_top_with_margin_on(self.ids.banner_top, 150.0) + .set(self.ids.usrnm_bg, ui_widgets); Image::new(self.imgs.input_bg) - .w_h(338.0, 50.0) + .w_h(338.0 * scale, 50.0 * scale) .middle_of(self.ids.usrnm_bg) .set(self.ids.username_bg, ui_widgets); for event in TextBox::new(&self.username) - .w_h(290.0, 30.0) - .mid_bottom_with_margin_on(self.ids.username_bg, 14.0) - .font_size(self.fonts.cyri.scale(22)) + .w_h(290.0* scale, 30.0* scale) + .mid_bottom_with_margin_on(self.ids.username_bg, 14.0* scale) + .font_size(self.fonts.cyri.scale(18)) .font_id(self.fonts.cyri.conrod_id) .text_color(TEXT_COLOR) // transparent background @@ -597,16 +603,19 @@ impl<'a> MainMenuUi { } } // Password - Rectangle::fill_with([320.0, 50.0], color::rgba(0.0, 0.0, 0.0, 0.0)) - .down_from(self.ids.usrnm_bg, 10.0) - .set(self.ids.passwd_bg, ui_widgets); + Rectangle::fill_with( + [320.0 * scale, 50.0 * scale], + color::rgba(0.0, 0.0, 0.0, 0.0), + ) + .down_from(self.ids.usrnm_bg, 10.0 * scale) + .set(self.ids.passwd_bg, ui_widgets); Image::new(self.imgs.input_bg) - .w_h(338.0, 50.0) + .w_h(338.0 * scale, 50.0 * scale) .middle_of(self.ids.passwd_bg) .set(self.ids.password_bg, ui_widgets); for event in TextBox::new(&self.password) - .w_h(290.0, 30.0) - .mid_bottom_with_margin_on(self.ids.password_bg, 10.0) + .w_h(290.0 * scale, 30.0* scale) + .mid_bottom_with_margin_on(self.ids.password_bg, 10.0* scale) // the text is smaller to allow longer passwords, conrod limits text length // this allows 35 characters but can be increased, approximate formula: 420 / scale = length .font_size(self.fonts.cyri.scale(12)) @@ -694,17 +703,20 @@ impl<'a> MainMenuUi { }; } // Server address - Rectangle::fill_with([320.0, 50.0], color::rgba(0.0, 0.0, 0.0, 0.0)) - .down_from(self.ids.passwd_bg, 8.0) - .set(self.ids.srvr_bg, ui_widgets); + Rectangle::fill_with( + [320.0 * scale, 50.0 * scale], + color::rgba(0.0, 0.0, 0.0, 0.0), + ) + .down_from(self.ids.passwd_bg, 8.0 * scale) + .set(self.ids.srvr_bg, ui_widgets); Image::new(self.imgs.input_bg) - .w_h(338.0, 50.0) + .w_h(338.0 * scale, 50.0 * scale) .middle_of(self.ids.srvr_bg) .set(self.ids.address_bg, ui_widgets); for event in TextBox::new(&self.server_address) - .w_h(290.0, 30.0) - .mid_top_with_margin_on(self.ids.address_bg, 8.0) - .font_size(self.fonts.cyri.scale(22)) + .w_h(290.0*scale, 30.0*scale) + .mid_top_with_margin_on(self.ids.address_bg, 8.0*scale) + .font_size(self.fonts.cyri.scale(18)) .font_id(self.fonts.cyri.conrod_id) .text_color(TEXT_COLOR) // transparent background @@ -726,14 +738,14 @@ impl<'a> MainMenuUi { if Button::image(self.imgs.button) .hover_image(self.imgs.button_hover) .press_image(self.imgs.button_press) - .w_h(258.0, 55.0) - .down_from(self.ids.address_bg, 20.0) + .w_h(258.0*scale, 55.0*scale) + .down_from(self.ids.address_bg, 20.0*scale) .align_middle_x_of(self.ids.address_bg) .label(&self.voxygen_i18n.get("common.multiplayer")) .label_font_id(self.fonts.cyri.conrod_id) .label_color(TEXT_COLOR) - .label_font_size(self.fonts.cyri.scale(22)) - .label_y(Relative::Scalar(5.0)) + .label_font_size(self.fonts.cyri.scale(18)) + .label_y(Relative::Scalar(4.0)) /*.with_tooltip( tooltip_manager, "Login", @@ -754,14 +766,14 @@ impl<'a> MainMenuUi { if Button::image(self.imgs.button) .hover_image(self.imgs.button_hover) .press_image(self.imgs.button_press) - .w_h(258.0, 55.0) - .down_from(self.ids.login_button, 20.0) + .w_h(258.0 * scale, 55.0 * scale) + .down_from(self.ids.login_button, 20.0 * scale) .align_middle_x_of(self.ids.address_bg) .label(&self.voxygen_i18n.get("common.singleplayer")) .label_font_id(self.fonts.cyri.conrod_id) .label_color(TEXT_COLOR) - .label_font_size(self.fonts.cyri.scale(22)) - .label_y(Relative::Scalar(5.0)) + .label_font_size(self.fonts.cyri.scale(18)) + .label_y(Relative::Scalar(4.0)) .label_x(Relative::Scalar(2.0)) .set(self.ids.singleplayer_button, ui_widgets) .was_clicked() @@ -772,14 +784,14 @@ impl<'a> MainMenuUi { } // Quit if Button::image(self.imgs.button) - .w_h(190.0, 40.0) - .bottom_left_with_margins_on(ui_widgets.window, 60.0, 30.0) + .w_h(190.0 * scale, 40.0 * scale) + .bottom_left_with_margins_on(ui_widgets.window, 60.0 * scale, 30.0 * scale) .hover_image(self.imgs.button_hover) .press_image(self.imgs.button_press) .label(&self.voxygen_i18n.get("common.quit")) .label_font_id(self.fonts.cyri.conrod_id) .label_color(TEXT_COLOR) - .label_font_size(self.fonts.cyri.scale(20)) + .label_font_size(self.fonts.cyri.scale(16)) .label_y(Relative::Scalar(3.0)) .set(self.ids.quit_button, ui_widgets) .was_clicked() @@ -789,14 +801,14 @@ impl<'a> MainMenuUi { // Settings if Button::image(self.imgs.button) - .w_h(190.0, 40.0) - .up_from(self.ids.quit_button, 8.0) + .w_h(190.0*scale, 40.0*scale) + .up_from(self.ids.quit_button, 8.0*scale) //.hover_image(self.imgs.button_hover) //.press_image(self.imgs.button_press) .label(&self.voxygen_i18n.get("common.settings")) .label_font_id(self.fonts.cyri.conrod_id) .label_color(TEXT_COLOR_2) - .label_font_size(self.fonts.cyri.scale(20)) + .label_font_size(self.fonts.cyri.scale(16)) .label_y(Relative::Scalar(3.0)) .set(self.ids.settings_button, ui_widgets) .was_clicked() @@ -806,14 +818,14 @@ impl<'a> MainMenuUi { // Servers if Button::image(self.imgs.button) - .w_h(190.0, 40.0) - .up_from(self.ids.settings_button, 8.0) + .w_h(190.0 * scale, 40.0 * scale) + .up_from(self.ids.settings_button, 8.0 * scale) .hover_image(self.imgs.button_hover) .press_image(self.imgs.button_press) .label(&self.voxygen_i18n.get("common.servers")) .label_font_id(self.fonts.cyri.conrod_id) .label_color(TEXT_COLOR) - .label_font_size(self.fonts.cyri.scale(20)) + .label_font_size(self.fonts.cyri.scale(16)) .label_y(Relative::Scalar(3.0)) .set(self.ids.servers_button, ui_widgets) .was_clicked() diff --git a/voxygen/src/scene/figure/load.rs b/voxygen/src/scene/figure/load.rs index 01c7044073..e03d9ff608 100644 --- a/voxygen/src/scene/figure/load.rs +++ b/voxygen/src/scene/figure/load.rs @@ -3496,6 +3496,7 @@ pub fn mesh_object( Body::BoltFire => ("weapon.projectile.fire-bolt-0", Vec3::new(-3.0, -5.5, -3.0)), Body::BoltFireBig => ("weapon.projectile.fire-bolt-1", Vec3::new(-6.0, -6.0, -6.0)), Body::TrainingDummy => ("object.training_dummy", Vec3::new(-7.0, -5.0, 0.0)), + Body::MultiArrow => ("weapon.projectile.multi-arrow", Vec3::new(-4.0, -9.5, -5.0)), }; load_mesh(name, offset, generate_mesh) } diff --git a/voxygen/src/settings.rs b/voxygen/src/settings.rs index 86b3c0c9e7..5e1e86f4b4 100644 --- a/voxygen/src/settings.rs +++ b/voxygen/src/settings.rs @@ -122,7 +122,7 @@ impl ControlSettings { GameInput::Secondary => KeyMouse::Mouse(MouseButton::Right), GameInput::ToggleCursor => KeyMouse::Key(VirtualKeyCode::Tab), GameInput::Escape => KeyMouse::Key(VirtualKeyCode::Escape), - GameInput::Enter => KeyMouse::Key(VirtualKeyCode::Return), + GameInput::Chat => KeyMouse::Key(VirtualKeyCode::Return), GameInput::Command => KeyMouse::Key(VirtualKeyCode::Slash), GameInput::MoveForward => KeyMouse::Key(VirtualKeyCode::W), GameInput::MoveLeft => KeyMouse::Key(VirtualKeyCode::A), @@ -207,7 +207,7 @@ impl Default for ControlSettings { //GameInput::WallLeap, GameInput::ToggleLantern, GameInput::Mount, - GameInput::Enter, + GameInput::Chat, GameInput::Command, GameInput::Escape, GameInput::Map, diff --git a/voxygen/src/window.rs b/voxygen/src/window.rs index 8b43a2d0c1..916281e36f 100644 --- a/voxygen/src/window.rs +++ b/voxygen/src/window.rs @@ -47,7 +47,7 @@ pub enum GameInput { //WallLeap, ToggleLantern, Mount, - Enter, + Chat, Command, Escape, Map, @@ -98,7 +98,7 @@ impl GameInput { //GameInput::WallLeap => "gameinput.wallleap", GameInput::ToggleLantern => "gameinput.togglelantern", GameInput::Mount => "gameinput.mount", - GameInput::Enter => "gameinput.enter", + GameInput::Chat => "gameinput.chat", GameInput::Command => "gameinput.command", GameInput::CycleCamera => "gameinput.cyclecamera", GameInput::Escape => "gameinput.escape", @@ -158,12 +158,13 @@ impl GameInput { GameInput::Sneak, GameInput::ToggleLantern, GameInput::Mount, - GameInput::Enter, + GameInput::Chat, GameInput::Command, GameInput::Escape, GameInput::Map, GameInput::Bag, GameInput::Social, + GameInput::Crafting, GameInput::Spellbook, GameInput::Settings, GameInput::ToggleInterface,