diff --git a/assets/voxygen/voxel/sprite_manifest.ron b/assets/voxygen/voxel/sprite_manifest.ron index e2831a62f4..d83443972d 100644 --- a/assets/voxygen/voxel/sprite_manifest.ron +++ b/assets/voxygen/voxel/sprite_manifest.ron @@ -3411,7 +3411,7 @@ WitchWindow: Some(( ( model: "voxygen.voxel.sprite.window.witch_purple", offset: (-5.5, -5.5, 0.0), - lod_axes: (0.0, 0.0, 0.0), + lod_axes: (0.5, 0.5, 0.5), ), ], wind_sway: 0.0, @@ -3453,27 +3453,27 @@ CavernGrassBlueShort: Some(( ( model: "voxygen.voxel.sprite.cavern.grass_short-0", offset: (-5.5, -5.5, 0.0), - lod_axes: (0.0, 0.0, 0.0), + lod_axes: (0.0, 0.0, 1.0), ), ( model: "voxygen.voxel.sprite.cavern.grass_short-1", offset: (-5.5, -5.5, 0.0), - lod_axes: (0.0, 0.0, 0.0), + lod_axes: (0.0, 0.0, 1.0), ), ( model: "voxygen.voxel.sprite.cavern.grass_short-2", offset: (-5.5, -5.5, 0.0), - lod_axes: (0.0, 0.0, 0.0), + lod_axes: (0.0, 0.0, 1.0), ), ( model: "voxygen.voxel.sprite.cavern.grass_short-3", offset: (-5.5, -5.5, 0.0), - lod_axes: (0.0, 0.0, 0.0), + lod_axes: (0.0, 0.0, 1.0), ), ( model: "voxygen.voxel.sprite.cavern.grass_short-4", offset: (-5.5, -5.5, 0.0), - lod_axes: (0.0, 0.0, 0.0), + lod_axes: (0.0, 0.0, 1.0), ), ], wind_sway: 0.0, @@ -3484,22 +3484,22 @@ CavernGrassBlueMedium: Some(( ( model: "voxygen.voxel.sprite.cavern.grass_med-0", offset: (-5.5, -5.5, 0.0), - lod_axes: (0.0, 0.0, 0.0), + lod_axes: (0.0, 0.0, 1.0), ), ( model: "voxygen.voxel.sprite.cavern.grass_med-1", offset: (-5.5, -5.5, 0.0), - lod_axes: (0.0, 0.0, 0.0), + lod_axes: (0.0, 0.0, 1.0), ), ( model: "voxygen.voxel.sprite.cavern.grass_med-2", offset: (-5.5, -5.5, 0.0), - lod_axes: (0.0, 0.0, 0.0), + lod_axes: (0.0, 0.0, 1.0), ), ( model: "voxygen.voxel.sprite.cavern.grass_med-3", offset: (-5.5, -5.5, 0.0), - lod_axes: (0.0, 0.0, 0.0), + lod_axes: (0.0, 0.0, 1.0), ), ], wind_sway: 0.0, @@ -3510,42 +3510,42 @@ CavernGrassBlueLong: Some(( ( model: "voxygen.voxel.sprite.cavern.grass_long-0", offset: (-5.5, -5.5, 0.0), - lod_axes: (0.0, 0.0, 0.0), + lod_axes: (0.0, 0.0, 1.0), ), ( model: "voxygen.voxel.sprite.cavern.grass_long-1", offset: (-5.5, -5.5, 0.0), - lod_axes: (0.0, 0.0, 0.0), + lod_axes: (0.0, 0.0, 1.0), ), ( model: "voxygen.voxel.sprite.cavern.grass_long-2", offset: (-5.5, -5.5, 0.0), - lod_axes: (0.0, 0.0, 0.0), + lod_axes: (0.0, 0.0, 1.0), ), ( model: "voxygen.voxel.sprite.cavern.grass_long-3", offset: (-5.5, -5.5, 0.0), - lod_axes: (0.0, 0.0, 0.0), + lod_axes: (0.0, 0.0, 1.0), ), ( model: "voxygen.voxel.sprite.cavern.grass_long-4", offset: (-5.5, -5.5, 0.0), - lod_axes: (0.0, 0.0, 0.0), + lod_axes: (0.0, 0.0, 1.0), ), ( model: "voxygen.voxel.sprite.cavern.grass_long-5", offset: (-5.5, -5.5, 0.0), - lod_axes: (0.0, 0.0, 0.0), + lod_axes: (0.0, 0.0, 1.0), ), ( model: "voxygen.voxel.sprite.cavern.grass_long-6", offset: (-5.5, -5.5, 0.0), - lod_axes: (0.0, 0.0, 0.0), + lod_axes: (0.0, 0.0, 1.0), ), ( model: "voxygen.voxel.sprite.cavern.grass_long-7", offset: (-5.5, -5.5, 0.0), - lod_axes: (0.0, 0.0, 0.0), + lod_axes: (0.0, 0.0, 1.0), ), ], wind_sway: 0.0, @@ -3556,27 +3556,27 @@ CavernLillypadBlue: Some(( ( model: "voxygen.voxel.sprite.cavern.lillypad-0", offset: (-5.5, -5.5, -1.0), - lod_axes: (0.0, 0.0, 0.0), + lod_axes: (0.5, 0.5, 0.0), ), ( model: "voxygen.voxel.sprite.cavern.lillypad-1", offset: (-5.5, -5.5, -1.0), - lod_axes: (0.0, 0.0, 0.0), + lod_axes: (0.5, 0.5, 0.0), ), ( model: "voxygen.voxel.sprite.cavern.lillypad-2", offset: (-5.5, -5.5, -1.0), - lod_axes: (0.0, 0.0, 0.0), + lod_axes: (0.5, 0.5, 0.0), ), ( model: "voxygen.voxel.sprite.cavern.lillypad-3", offset: (-5.5, -5.5, -1.0), - lod_axes: (0.0, 0.0, 0.0), + lod_axes: (0.5, 0.5, 0.0), ), ( model: "voxygen.voxel.sprite.cavern.lillypad-4", offset: (-5.5, -5.5, -1.0), - lod_axes: (0.0, 0.0, 0.0), + lod_axes: (0.5, 0.5, 0.0), ), ], wind_sway: 0.0, @@ -3587,22 +3587,22 @@ CavernMycelBlue: Some(( ( model: "voxygen.voxel.sprite.cavern.mycel-0", offset: (-0.5, -0.5, -21.0), - lod_axes: (0.0, 0.0, 0.0), + lod_axes: (0.0, 0.0, 1.0), ), ( model: "voxygen.voxel.sprite.cavern.mycel-1", offset: (-0.5, -0.5, -31.0), - lod_axes: (0.0, 0.0, 0.0), + lod_axes: (0.0, 0.0, 1.0), ), ( model: "voxygen.voxel.sprite.cavern.mycel-2", offset: (-0.5, -0.5, -14.0), - lod_axes: (0.0, 0.0, 0.0), + lod_axes: (0.0, 0.0, 1.0), ), ( model: "voxygen.voxel.sprite.cavern.mycel-3", offset: (-0.5, -0.5, -40.0), - lod_axes: (0.0, 0.0, 0.0), + lod_axes: (0.0, 0.0, 1.0), ), ], wind_sway: 0.1, @@ -3657,5 +3657,14 @@ LillyPads: Some(( ), ], wind_sway: 0.6, +Bomb: Some(( + variations: [ + ( + model: "voxygen.voxel.object.bomb", + offset: (-5.5, -5.5, 0.0), + lod_axes: (0.5, 0.5, 0.5), + ), + ], + wind_sway: 0.0, )), ) diff --git a/common/src/states/sprite_interact.rs b/common/src/states/sprite_interact.rs index 82f48c98f0..20d0336c9b 100644 --- a/common/src/states/sprite_interact.rs +++ b/common/src/states/sprite_interact.rs @@ -156,7 +156,8 @@ impl From for Option { | SpriteKind::VialEmpty | SpriteKind::Bowl | SpriteKind::PotionMinor - | SpriteKind::Seashells => Some(SpriteInteractKind::Collectible), + | SpriteKind::Seashells + | SpriteKind::Bomb => Some(SpriteInteractKind::Collectible), // Collectible checked in addition to container for case that sprite requires a tool to // collect and cannot be collected by hand, yet still meets the container check _ if sprite_kind.is_container() && sprite_kind.is_collectible() => { diff --git a/common/src/terrain/block.rs b/common/src/terrain/block.rs index 86bab3ec99..d7fdbd4c01 100644 --- a/common/src/terrain/block.rs +++ b/common/src/terrain/block.rs @@ -279,7 +279,9 @@ impl Block { #[inline] pub fn is_bonkable(&self) -> bool { match self.get_sprite() { - Some(SpriteKind::Apple | SpriteKind::Beehive | SpriteKind::Coconut) => self.is_solid(), + Some( + SpriteKind::Apple | SpriteKind::Beehive | SpriteKind::Coconut | SpriteKind::Bomb, + ) => self.is_solid(), _ => false, } } diff --git a/common/src/terrain/sprite.rs b/common/src/terrain/sprite.rs index 55f36b0a5e..b62e9c92e6 100644 --- a/common/src/terrain/sprite.rs +++ b/common/src/terrain/sprite.rs @@ -187,6 +187,7 @@ make_case_elim!( LillyPads = 0xA0, JungleLeafyPlant = 0xA1, JungleRedGrass = 0xA2, + Bomb = 0xA3, } ); @@ -261,7 +262,8 @@ impl SpriteKind { | SpriteKind::Window3 | SpriteKind::Window4 | SpriteKind::DropGate - | SpriteKind::WitchWindow => 1.0, + | SpriteKind::WitchWindow + | SpriteKind::Bomb => 1.0, // TODO: Figure out if this should be solid or not. SpriteKind::Shelf => 1.0, SpriteKind::Lantern => 0.9, @@ -335,6 +337,7 @@ impl SpriteKind { SpriteKind::RoundCactus => item("common.items.crafting_ing.cactus"), SpriteKind::ShortFlatCactus => item("common.items.crafting_ing.cactus"), SpriteKind::MedFlatCactus => item("common.items.crafting_ing.cactus"), + SpriteKind::Bomb => item("common.items.utility.bomb"), SpriteKind::DungeonChest0 => table("common.loot_tables.dungeon.tier-0.chest"), SpriteKind::DungeonChest1 => table("common.loot_tables.dungeon.tier-1.chest"), SpriteKind::DungeonChest2 => table("common.loot_tables.dungeon.tier-2.chest"), diff --git a/server/src/events/entity_manipulation.rs b/server/src/events/entity_manipulation.rs index fbea2b88c8..9758c6dfa7 100644 --- a/server/src/events/entity_manipulation.rs +++ b/server/src/events/entity_manipulation.rs @@ -866,7 +866,7 @@ pub fn handle_explosion(server: &Server, pos: Vec3, explosion: Explosion, o } } -pub fn handle_bonk(server: &mut Server, pos: Vec3, _owner: Option, target: Option) { +pub fn handle_bonk(server: &mut Server, pos: Vec3, owner: Option, target: Option) { let ecs = &server.state.ecs(); let terrain = ecs.read_resource::(); let mut block_change = ecs.write_resource::(); @@ -884,18 +884,25 @@ pub fn handle_bonk(server: &mut Server, pos: Vec3, _owner: Option, tar { drop(terrain); drop(block_change); - server + let mut entity = server .state .create_object(Default::default(), match block.get_sprite() { // Create different containers depending on the original sprite Some(SpriteKind::Apple) => comp::object::Body::Apple, Some(SpriteKind::Beehive) => comp::object::Body::Hive, Some(SpriteKind::Coconut) => comp::object::Body::Coconut, + Some(SpriteKind::Bomb) => comp::object::Body::Bomb, _ => comp::object::Body::Pouch, }) .with(comp::Pos(pos.map(|e| e as f32) + Vec3::new(0.5, 0.5, 0.0))) - .with(item) - .build(); + .with(item); + + entity = match block.get_sprite() { + Some(SpriteKind::Bomb) => entity.with(comp::Object::Bomb { owner }), + _ => entity, + }; + + entity.build(); } }; }