changed get_noncursed() to helper on BUC struct
This commit is contained in:
parent
4d21bd46d4
commit
fa4612cf1f
2 changed files with 11 additions and 2 deletions
|
|
@ -243,6 +243,15 @@ pub enum BUC {
|
||||||
Blessed,
|
Blessed,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl BUC {
|
||||||
|
pub fn noncursed(&self) -> bool {
|
||||||
|
match self {
|
||||||
|
BUC::Cursed => false,
|
||||||
|
_ => true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Component, Debug, Serialize, Deserialize, Eq, PartialEq, Hash, Clone)]
|
#[derive(Component, Debug, Serialize, Deserialize, Eq, PartialEq, Hash, Clone)]
|
||||||
pub struct Beatitude {
|
pub struct Beatitude {
|
||||||
pub buc: BUC,
|
pub buc: BUC,
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
use super::{ add_effect, get_noncursed, particles, spatial, EffectType, Entity, Targets, World };
|
use super::{ add_effect, particles, spatial, EffectType, Entity, Targets, World };
|
||||||
use crate::{
|
use crate::{
|
||||||
gamelog,
|
gamelog,
|
||||||
gui::item_colour_ecs,
|
gui::item_colour_ecs,
|
||||||
|
|
@ -205,7 +205,7 @@ fn handle_healing(
|
||||||
healing_item.modifier;
|
healing_item.modifier;
|
||||||
add_effect(
|
add_effect(
|
||||||
event.source,
|
event.source,
|
||||||
EffectType::Healing { amount: roll, increment_max: get_noncursed(&event.buc) },
|
EffectType::Healing { amount: roll, increment_max: event.buc.noncursed() },
|
||||||
event.target.clone()
|
event.target.clone()
|
||||||
);
|
);
|
||||||
for target in get_entity_targets(&event.target) {
|
for target in get_entity_targets(&event.target) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue