forked from blasthavers/blastmud
33 lines
880 B
Rust
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;
|