From d5e0a7d3518a15b7603a4991a602715cd34f2c04 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sun, 5 Jul 2020 01:08:52 +0100 Subject: [PATCH] Added bombs to loot table --- assets/common/items/bomb_pile.ron | 8 ++++++++ assets/common/loot_table.ron | 8 +++++++- server/src/events/inventory_manip.rs | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 assets/common/items/bomb_pile.ron diff --git a/assets/common/items/bomb_pile.ron b/assets/common/items/bomb_pile.ron new file mode 100644 index 0000000000..84577dced8 --- /dev/null +++ b/assets/common/items/bomb_pile.ron @@ -0,0 +1,8 @@ +Item( + name: "Bomb", + description: "Boom!\n\n", + kind: Throwable( + kind: Bomb, + amount: 10, + ), +) diff --git a/assets/common/loot_table.ron b/assets/common/loot_table.ron index 089f042417..17891fbf7b 100644 --- a/assets/common/loot_table.ron +++ b/assets/common/loot_table.ron @@ -1,10 +1,16 @@ [ // All loot rates go here + // food + (3, "common.items.cheese"), + (3, "common.items.apple"), + (3, "common.items.mushroom"), // miscellaneous (0.4, "common.items.velorite"), (0.6, "common.items.veloritefrag"), (1.5, "common.items.potion_minor"), - (1, "common.items.collar"), + (0.5, "common.items.collar"), + (0.5, "common.items.bomb_pile"), + (1, "common.items.bomb"), // swords (0.1, "common.items.weapons.sword.starter_sword"), (0.1, "common.items.weapons.sword.wood_sword"), diff --git a/server/src/events/inventory_manip.rs b/server/src/events/inventory_manip.rs index 86cbf38ffb..d0d857c89e 100644 --- a/server/src/events/inventory_manip.rs +++ b/server/src/events/inventory_manip.rs @@ -358,7 +358,7 @@ pub fn handle_inventory(server: &mut Server, entity: EcsEntity, manip: comp::Inv .with(comp::Pos(pos.0 + Vec3::unit_z() * 0.25)) .with(comp::Vel(vel)); - #[allow(clippy::single-match)] + #[allow(clippy::single_match)] match item.kind { item::ItemKind::Throwable { kind: item::Throwable::Bomb,