From 3d17fde537be57dc8e14a5233eb24dcea6591e0a Mon Sep 17 00:00:00 2001 From: Adam Strauss Date: Fri, 7 May 2021 01:41:44 -0700 Subject: [PATCH 1/2] Implement #1105: Rolling removes burning debuff --- common/src/states/roll.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/common/src/states/roll.rs b/common/src/states/roll.rs index 547a703499..d75763eca8 100644 --- a/common/src/states/roll.rs +++ b/common/src/states/roll.rs @@ -1,5 +1,9 @@ use crate::{ - comp::{CharacterState, InputKind, StateUpdate}, + comp::{ + buff::{BuffChange, BuffKind}, + CharacterState, InputKind, StateUpdate, + }, + event::ServerEvent, states::{ behavior::{CharacterBehavior, JoinData}, utils::*, @@ -52,6 +56,11 @@ impl CharacterBehavior for Data { match self.stage_section { StageSection::Buildup => { handle_move(data, &mut update, 1.0); + // Remove burning effect if active + update.server_events.push_front(ServerEvent::Buff { + entity: data.entity, + buff_change: BuffChange::RemoveByKind(BuffKind::Burning), + }); if self.timer < self.static_data.buildup_duration { // Build up update.character = CharacterState::Roll(Data { From a5b7e34bf81f1ce26c3ebb63f7b2ec9fb410128c Mon Sep 17 00:00:00 2001 From: Adam Strauss Date: Fri, 7 May 2021 15:40:11 -0700 Subject: [PATCH 2/2] Fix #1105: Move server event so it does not emit constantly during build up --- common/src/states/roll.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/common/src/states/roll.rs b/common/src/states/roll.rs index d75763eca8..d4fc7a7ea6 100644 --- a/common/src/states/roll.rs +++ b/common/src/states/roll.rs @@ -56,11 +56,6 @@ impl CharacterBehavior for Data { match self.stage_section { StageSection::Buildup => { handle_move(data, &mut update, 1.0); - // Remove burning effect if active - update.server_events.push_front(ServerEvent::Buff { - entity: data.entity, - buff_change: BuffChange::RemoveByKind(BuffKind::Burning), - }); if self.timer < self.static_data.buildup_duration { // Build up update.character = CharacterState::Roll(Data { @@ -71,6 +66,11 @@ impl CharacterBehavior for Data { ..*self }); } else { + // Remove burning effect if active + update.server_events.push_front(ServerEvent::Buff { + entity: data.entity, + buff_change: BuffChange::RemoveByKind(BuffKind::Burning), + }); // Transitions to movement section of stage update.character = CharacterState::Roll(Data { timer: Duration::default(),