diff --git a/sim/rogue/items_sets_pve.go b/sim/rogue/items_sets_pve.go index ad2f8fe02f..5167f9e27a 100644 --- a/sim/rogue/items_sets_pve.go +++ b/sim/rogue/items_sets_pve.go @@ -506,49 +506,90 @@ var ItemSetDeathdealersBattlearmor = core.NewItemSet(core.ItemSet{ }, // While active, your Main Gauche also causes you to heal for 10% of all damage done by Sinister Strike. // Any excess healing becomes a Blood Barrier, absorbing damage up to 20% of your maximum health. - // Shield appear to not be fully implemented in SoD commenting out until fixed 4: func(agent core.Agent) { - // rogue := agent.(RogueAgent).GetRogue() - // if !rogue.HasRune(proto.RogueRune_RuneMainGauche) { - // return - // } - // shieldSpell := rogue.GetOrRegisterSpell(core.SpellConfig{ - // ActionID: core.ActionID{SpellID: 1213761}, - // SpellSchool: core.SpellSchoolPhysical, - // ProcMask: core.ProcMaskSpellHealing, - // Flags: core.SpellFlagNoOnCastComplete | core.SpellFlagPassiveSpell | core.SpellFlagHelpful, - // - // DamageMultiplier: 1, - // ThreatMultiplier: 1, - // - // Shield: core.ShieldConfig{ - // Aura: core.Aura{ - // Label: "Blood Barrier", - // Duration: time.Second * 15, - // }, - // }, - // }) - // - // activeAura := core.MakeProcTriggerAura(&rogue.Unit, core.ProcTrigger{ - // Name: "Main Gauche - Blood Barrier", - // ActionID: core.ActionID{SpellID: 1213762}, - // Callback: core.CallbackOnSpellHitDealt, - // Duration: time.Second * 15, - // Handler: func(sim *core.Simulation, spell *core.Spell, result *core.SpellResult) { - // if result.Landed() && spell.SpellCode == SpellCode_RogueSinisterStrike{ - // shieldSpell.Shield(&rogue.Unit).Apply(sim, result.Damage*0.15) - // } - // }, - // }) - // - // core.MakePermanent(rogue.RegisterAura(core.Aura{ - // Label: "S03 - Item - TAQ - Rogue - Tank 4P Bonus", - // OnSpellHitDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) { - // if result.Landed() && spell.SpellCode == SpellCode_RogueMainGauche { - // activeAura.Activate(sim) - // } - // }, - // })) + rogue := agent.(RogueAgent).GetRogue() + if !rogue.HasRune(proto.RogueRune_RuneMainGauche) { + return + } + healthMetrics := rogue.NewHealthMetrics(core.ActionID{SpellID: 11294},) + healAmount := 0.0 + shieldAmount := 0.0 + currentShield := 0.0 + + + var shieldSpell *core.Spell + + shieldSpell = rogue.GetOrRegisterSpell(core.SpellConfig{ + ActionID: core.ActionID{SpellID: 1213761}, + SpellSchool: core.SpellSchoolPhysical, + ProcMask: core.ProcMaskSpellHealing, + Flags: core.SpellFlagNoOnCastComplete | core.SpellFlagPassiveSpell | core.SpellFlagHelpful, + + DamageMultiplier: 1, + ThreatMultiplier: 1, + + Shield: core.ShieldConfig{ + SelfOnly: true, + Aura: core.Aura{ + Label: "Blood Barrier", + ActionID: core.ActionID{SpellID: 1213762}, + Duration: time.Second * 15, + OnReset: func(aura *core.Aura, sim *core.Simulation) { + shieldAmount = 0.0 + currentShield = 0.0 + }, + OnSpellHitTaken: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) { + if currentShield <= 0 || result.Damage <= 0 { + return + } + + damageReduced := min(result.Damage, currentShield) + currentShield -= damageReduced + + rogue.GainHealth(sim, damageReduced, shieldSpell.HealthMetrics(result.Target)) + if currentShield <= 0 { + shieldSpell.SelfShield().Deactivate(sim) + } + }, + }, + }, + + ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) { + if currentShield < rogue.MaxHealth()*0.2 { + shieldAmount = min(shieldAmount, rogue.MaxHealth()*0.2-currentShield) + currentShield += shieldAmount + spell.SelfShield().Apply(sim, shieldAmount) + } + }, + }) + + activeAura := core.MakeProcTriggerAura(&rogue.Unit, core.ProcTrigger{ + Name: "Main Gauche - Blood Barrier", + ActionID: core.ActionID{SpellID: 1213762}, + Callback: core.CallbackOnSpellHitDealt, + Duration: time.Second * 15, + Handler: func(sim *core.Simulation, spell *core.Spell, result *core.SpellResult) { + if result.Landed() && spell.SpellCode == SpellCode_RogueSinisterStrike{ + healAmount = result.Damage*0.15 + if rogue.CurrentHealth() < rogue.MaxHealth() { + rogue.GainHealth(sim, healAmount, healthMetrics) + } else { + shieldAmount = healAmount + shieldSpell.Cast(sim, result.Target) + } + + } + }, + }) + + core.MakePermanent(rogue.RegisterAura(core.Aura{ + Label: "S03 - Item - TAQ - Rogue - Tank 4P Bonus", + OnSpellHitDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) { + if result.Landed() && spell.SpellCode == SpellCode_RogueMainGauche { + activeAura.Activate(sim) + } + }, + })) }, }, }) diff --git a/ui/core/proto_utils/logs_parser.tsx b/ui/core/proto_utils/logs_parser.tsx index c19b07f3b3..c502c0a82c 100644 --- a/ui/core/proto_utils/logs_parser.tsx +++ b/ui/core/proto_utils/logs_parser.tsx @@ -366,33 +366,42 @@ export class DamageDealtLog extends SimLog { result() { return ( <> - {this.isHealing() ? `Heal ` : ''} - {this.isShielding() ? `Shield ` : ''} - {this.miss - ? 'Miss' - : this.dodge - ? 'Dodge' - : this.parry - ? 'Parry' - : this.glance - ? 'Glance' - : this.blockedCrit - ? 'Blocked Crit' - : this.block - ? 'Block' - : this.crit - ? 'Crit' - : this.crush - ? 'Crush' - : this.tick - ? 'Tick' - : 'Hit'} + {this.isHealing() ? `Healed ` : ''} + {this.isShielding() ? `Shielded ` : ''} + {!(this.isHealing() || this.isShielding()) && ( + <> + {this.miss + ? 'Miss' + : this.dodge + ? 'Dodge' + : this.parry + ? 'Parry' + : this.glance + ? 'Glance' + : this.blockedCrit + ? 'Blocked Crit' + : this.block + ? 'Block' + : this.crit + ? 'Crit' + : this.crush + ? 'Crush' + : this.tick + ? 'Tick' + : 'Hit'} + + )} {` `} {this.target?.toHTML() || ''} {!this.miss && !this.dodge && !this.parry ? ( <> {` `} - for {this.amount.toFixed(2)} damage + for{' '} + {this.isHealing() || this.isShielding() ? ( + {this.amount.toFixed(2)} health + ) : ( + {this.amount.toFixed(2)} damage + )} {this.partialResist1_4 ? ( <> (25% Resist) ) : this.partialResist2_4 ? ( @@ -762,17 +771,20 @@ export class ResourceChangedLog extends SimLog { const verb = isHealth ? (this.isSpend ? 'Lost' : 'Recovered') : this.isSpend ? 'Spent' : 'Gained'; const resourceName = resourceNames.get(this.resourceType)!; const resourceClass = `resource-${resourceName.replace(/\s/g, '-').toLowerCase()}`; - + return ( <> {this.toPrefix(includeTimestamp)} {verb}{' '} {signedDiff.toFixed(1)} {resourceName} - {this.target ? <>{` on `} {this.target?.toHTML()} : null} + {this.target ? ( + <> + {` on `} {this.target?.toHTML()} + + ) : null} {` from `} - {this.newActionIdLink(this.actionId!)}. - ({this.valueBefore.toFixed(1)} → {this.valueAfter.toFixed(1)}) + {this.newActionIdLink(this.actionId!)}. ({this.valueBefore.toFixed(1)} → {this.valueAfter.toFixed(1)}) ); }); @@ -796,7 +808,7 @@ export class ResourceChangedLog extends SimLog { if (match) { const resourceType = stringToResourceType(match[4]); // combo points have an additional Target included in its log lines, adjust for that here - const valueBefore = match[13] + const valueBefore = match[13]; const valueAfter = match[14]; return ActionId.fromLogString(match[12]) .fill(params.source?.index)