|
@ -406,6 +406,7 @@ where |
|
|
// TODO: convenience function for giving exp and checking levelups (un-duplicate code here and `request_exp`)
|
|
|
// TODO: convenience function for giving exp and checking levelups (un-duplicate code here and `request_exp`)
|
|
|
// TODO: use real errors (Idunnoman)
|
|
|
// TODO: use real errors (Idunnoman)
|
|
|
// TODO: create InventoryError::CannotGetItemHandle or something
|
|
|
// TODO: create InventoryError::CannotGetItemHandle or something
|
|
|
|
|
|
#[allow(clippy::too_many_arguments)]
|
|
|
pub async fn player_steals_exp<EG> (id: ClientId,
|
|
|
pub async fn player_steals_exp<EG> (id: ClientId,
|
|
|
expsteal: &ExperienceSteal,
|
|
|
expsteal: &ExperienceSteal,
|
|
|
entity_gateway: &mut EG,
|
|
|
entity_gateway: &mut EG,
|
|
@ -433,9 +434,7 @@ where |
|
|
let monster_stats = room.monster_stats.get(&monster.monster).ok_or(ShipError::UnknownMonster(monster.monster))?;
|
|
|
let monster_stats = room.monster_stats.get(&monster.monster).ok_or(ShipError::UnknownMonster(monster.monster))?;
|
|
|
|
|
|
|
|
|
let remaining_exp = monster_stats.exp - monster.stolen_exp[area_client.local_client.id() as usize];
|
|
|
let remaining_exp = monster_stats.exp - monster.stolen_exp[area_client.local_client.id() as usize];
|
|
|
if remaining_exp <= 0 {
|
|
|
|
|
|
Ok(Box::new(None.into_iter()))
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
if remaining_exp > 0 {
|
|
|
let char_special_modifier: f32 = if client.character.char_class.is_android() {
|
|
|
let char_special_modifier: f32 = if client.character.char_class.is_android() {
|
|
|
if room.mode.difficulty() == crate::ship::room::Difficulty::Ultimate {
|
|
|
if room.mode.difficulty() == crate::ship::room::Difficulty::Ultimate {
|
|
|
0.3
|
|
|
0.3
|
|
@ -514,6 +513,8 @@ where |
|
|
entity_gateway.save_character(&client.character).await?;
|
|
|
entity_gateway.save_character(&client.character).await?;
|
|
|
|
|
|
|
|
|
Ok(exp_pkts)
|
|
|
Ok(exp_pkts)
|
|
|
|
|
|
} else {
|
|
|
|
|
|
Ok(Box::new(None.into_iter()))
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|