diff --git a/internal/character/herta/talent.go b/internal/character/herta/talent.go index cf677f1a..d6245d89 100644 --- a/internal/character/herta/talent.go +++ b/internal/character/herta/talent.go @@ -35,8 +35,8 @@ func (c *char) talentListener(e event.HPChange) { onCD, ok := passiveCooldowns[e.Target] if e.NewHPRatio <= 0.5 { - // Check if enemy, is either not in the map (never seen before) or is in there and - if c.engine.IsEnemy(e.Target) && (!ok || !onCD) && !c.engine.HasBehaviorFlag(c.id, model.BehaviorFlag_STAT_CTRL) { + // Check if enemy, is either not in the map (never seen before) or is in there, the source is an ally and Herta is not under a status control effect + if c.engine.IsEnemy(e.Target) && (!ok || !onCD) && c.engine.IsCharacter(e.Source) && !c.engine.HasBehaviorFlag(c.id, model.BehaviorFlag_STAT_CTRL) { if len(c.engine.Enemies()) > 0 { c.engine.Events().AttackEnd.Subscribe(c.talentAfterAttackListener) hertaCount += 1 diff --git a/internal/lightcone/destruction/theunreachableside/theunreachableside.go b/internal/lightcone/destruction/theunreachableside/theunreachableside.go index 2008b9d3..476e0c5a 100644 --- a/internal/lightcone/destruction/theunreachableside/theunreachableside.go +++ b/internal/lightcone/destruction/theunreachableside/theunreachableside.go @@ -63,7 +63,7 @@ func buffOnAttacked(mod *modifier.Instance, e event.AttackEnd) { func buffOnHPConsume(mod *modifier.Instance, e event.HPChange) { // bypass if: hpchangebydmg is true, hpchange source isn't lc holder, hpchange increase hp. - if e.IsHPChangeByDamage || e.Target != mod.Owner() || e.NewHP > e.OldHP { + if e.IsHPChangeByDamage || e.Source != mod.Owner() || e.NewHP > e.OldHP { return } dmgAmt := mod.State().(float64) diff --git a/pkg/engine/attribute/event.go b/pkg/engine/attribute/event.go index 6b2135df..01f4e00a 100644 --- a/pkg/engine/attribute/event.go +++ b/pkg/engine/attribute/event.go @@ -19,6 +19,7 @@ func (s *Service) emitHPChangeEvents( s.event.HPChange.Emit(event.HPChange{ Key: key, Target: target, + Source: source, OldHPRatio: oldRatio, NewHPRatio: newRatio, OldHP: maxHP * oldRatio, diff --git a/pkg/engine/event/attribute.go b/pkg/engine/event/attribute.go index 3e75dde0..c02c0939 100644 --- a/pkg/engine/event/attribute.go +++ b/pkg/engine/event/attribute.go @@ -9,6 +9,7 @@ type HPChangeEventHandler = handler.EventHandler[HPChange] type HPChange struct { Key key.Reason `json:"key"` Target key.TargetID `json:"target"` + Source key.TargetID `json:"source"` OldHPRatio float64 `json:"old_hp_ratio"` NewHPRatio float64 `json:"new_hp_ratio"` OldHP float64 `json:"old_hp"` diff --git a/ui/packages/types/src/event.ts b/ui/packages/types/src/event.ts index b74a7108..20d53ef7 100755 --- a/ui/packages/types/src/event.ts +++ b/ui/packages/types/src/event.ts @@ -13,6 +13,7 @@ export type HPChangeEventHandler = Handler; export interface HPChange { key: string; target: string; + source: string; old_hp_ratio: number /* float64 */; new_hp_ratio: number /* float64 */; old_hp: number /* float64 */;