blastmud/blastmud_game/src/static_content/journals/first_dog.rs
Condorra 590d4640dd Implement craft on benches
Initially just a stove
Also update Rust.
2023-07-24 22:46:50 +10:00

33 lines
880 B
Rust

use super::{award_journal_if_needed, JournalChecker, KillSubscriptionType};
#[double]
use crate::db::DBTrans;
use crate::{
models::{item::Item, journal::JournalType, user::User},
static_content::species::SpeciesType,
DResult,
};
use async_trait::async_trait;
use mockall_double::double;
pub struct FirstDogChecker;
#[async_trait]
impl JournalChecker for FirstDogChecker {
fn kill_subscriptions(&self) -> Vec<KillSubscriptionType> {
vec![KillSubscriptionType::SpecificNPCSpecies {
species: SpeciesType::Dog,
}]
}
async fn handle_kill(
&self,
trans: &DBTrans,
user: &mut User,
player: &mut Item,
_victim: &Item,
) -> DResult<bool> {
award_journal_if_needed(trans, user, player, JournalType::SlayedMeanDog).await
}
}
pub static CHECKER: FirstDogChecker = FirstDogChecker;