Skip to content

Commit

Permalink
Merge pull request #1188 from sanguinerarogue/RogueAbsorbSet
Browse files Browse the repository at this point in the history
rogue 4pc bonus implemented
  • Loading branch information
sanguinerarogue authored Dec 22, 2024
2 parents 2aeca3d + cbdf26e commit 29f0022
Show file tree
Hide file tree
Showing 2 changed files with 122 additions and 69 deletions.
125 changes: 83 additions & 42 deletions sim/rogue/items_sets_pve.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
},
}))
},
},
})
66 changes: 39 additions & 27 deletions ui/core/proto_utils/logs_parser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 <strong className="text-danger">{this.amount.toFixed(2)} damage</strong>
for{' '}
{this.isHealing() || this.isShielding() ? (
<strong className="resource-health">{this.amount.toFixed(2)} health</strong>
) : (
<strong className="text-danger">{this.amount.toFixed(2)} damage</strong>
)}
{this.partialResist1_4 ? (
<> (25% Resist)</>
) : this.partialResist2_4 ? (
Expand Down Expand Up @@ -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}{' '}
<strong className={resourceClass}>
{signedDiff.toFixed(1)} {resourceName}
</strong>
{this.target ? <>{` on `} {this.target?.toHTML()}</> : null}
{this.target ? (
<>
{` on `} {this.target?.toHTML()}
</>
) : null}
{` from `}
{this.newActionIdLink(this.actionId!)}.
({this.valueBefore.toFixed(1)} &rarr; {this.valueAfter.toFixed(1)})
{this.newActionIdLink(this.actionId!)}. ({this.valueBefore.toFixed(1)} &rarr; {this.valueAfter.toFixed(1)})
</>
);
});
Expand All @@ -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)
Expand Down

0 comments on commit 29f0022

Please sign in to comment.