Add new SelfBuff buff category

This commit is contained in:
maxicarlos08 2023-11-02 07:44:30 +01:00
parent d3f4b854fc
commit 601056ecbd
No known key found for this signature in database
2 changed files with 4 additions and 5 deletions

View File

@ -476,6 +476,7 @@ pub enum BuffCategory {
FromActiveAura(Uid, AuraKey),
RemoveOnAttack,
RemoveOnLoadoutChange,
SelfBuff,
}
#[derive(Clone, Debug, Serialize, Deserialize)]

View File

@ -86,9 +86,7 @@ impl CharacterBehavior for Data {
output_events.emit_server(ServerEvent::Buff {
entity: data.entity,
buff_change: BuffChange::RemoveByCategory {
// TODO: Consider renaming [BuffCategory::RemoveOnLoadoutChange] to
// something more generic?
all_required: vec![BuffCategory::RemoveOnLoadoutChange],
all_required: vec![BuffCategory::SelfBuff],
any_required: vec![],
none_required: vec![],
},
@ -107,9 +105,9 @@ impl CharacterBehavior for Data {
.ability
.map_or(false, |a| a.ability.is_from_tool())
{
vec![BuffCategory::RemoveOnLoadoutChange]
vec![BuffCategory::RemoveOnLoadoutChange, BuffCategory::SelfBuff]
} else {
Vec::new()
vec![BuffCategory::SelfBuff]
};
// Creates buff
let buff = Buff::new(