Re-balanced items

This commit is contained in:
joeyahines committed 2024-05-28 20:53:05 -06:00
1 parent 04cb04bdd6
commit 2000d536ff
4 files changed
+46 -8

No files matched your search

+22
View File
@@ -341,6 +341,24 @@ async fn use_item(ctx: &Context, msg: &Message, args: Args) -> CommandResult {
msg.reply(&ctx.http, "You're trusty helmet regards you helmetly")
.await?;
}
ItemType::TacticalNuke => {
let mut users: Vec<User> = global_data.db.filter(|_, _user: &User| {
true
}
)?.collect();
for user in &mut users {
for item in &mut user.inventory.inventory {
if item.item_type == ItemType::KillGun || item.item_type == ItemType::CancelRay || item.item_type == ItemType::CancelInsurance || item.item_type == ItemType::Helmet {
item.quantity = 0;
}
}
global_data.db.insert(user.clone())?;
}
msg.reply(&ctx.http, "I have become cancel, the canceller of worlds. https://tenor.com/view/explosion-mushroom-cloud-atomic-bomb-bomb-boom-gif-4464831").await?;
}
}
Ok(())
@@ -455,6 +473,10 @@ pub async fn restock_shop(ctx: &Context, global_data: &GlobalData) -> Result<(),
bot_user
.inventory
.give_item(ItemType::Helmet, thread_rng().gen_range(1..=3), None);
bot_user
.inventory
.give_item(ItemType::TacticalNuke, thread_rng().gen_range(0..=1), None);
loop {
let mut dir = tokio::fs::read_dir(&global_data.cfg.nft_path).await?;