Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion assets/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1070,6 +1070,13 @@
"label": "Trigger ICD",
"tooltip": "Triggers the specified internal cooldown."
},
"damage_amplification": {
"label": "Damage Amplification",
"tooltip": "Multiplies Damage Done % by the specified percentage.",
"amount": {
"label": "Percentage"
}
},
"item_swap": {
"label": "Item Swap",
"tooltip": "Swaps items, using the swap set specified in Settings."
Expand Down Expand Up @@ -1685,7 +1692,8 @@
"include_reaction_time_tooltip": "If checked, will use the configured reaction time.",
"use_base_value": "Use base value",
"use_base_value_tooltip": "If checked, will compare the current DoT to the the base value (on encounter start) of the DoT.",
"variable_assignment_tooltip": "Value to assign to variable '{{variableName}}'"
"variable_assignment_tooltip": "Value to assign to variable '{{variableName}}'",
"amplification_type": "Amplification Type"
},
"eclipse_types": {
"lunar": "Lunar",
Expand Down Expand Up @@ -1715,6 +1723,20 @@
"cat": "Cat",
"hybrid": "Hybrid"
},
"amplification_types": {
"caster_buff": {
"label": "Caster Buff",
"tooltip": "Buff is on caster; snapshots DoTs and affect pets (not guardians)"
},
"environment_buff": {
"label": "Environment Buff",
"tooltip": "Buff is on the environment (ie. Jin'Rokh' pool); snapshots DoTs and affect pets (not guardians)"
},
"target_debuff": {
"label": "Target Debuff",
"tooltip": "Debuff is on target; doesn't snapshot DoTs and affects pets/guardians"
}
},
"unit_labels": {
"self": "Self",
"current_target": "Current Target",
Expand Down
3,067 changes: 1,545 additions & 1,522 deletions assets/locales/fr/translation.json

Large diffs are not rendered by default.

13 changes: 12 additions & 1 deletion proto/apl.proto
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ message APLGroup {
repeated APLValueVariable variables = 3; // Variables that can be used in this group
}

// NextIndex: 31
// NextIndex: 32
message APLAction {
APLValue condition = 1; // If set, action will only execute if value is true or != 0.

Expand Down Expand Up @@ -85,6 +85,7 @@ message APLAction {
APLActionItemSwap item_swap = 17;
APLActionMove move = 21;
APLActionMoveDuration move_duration = 22;
APLActionDamageAmplifier damage_amplifier = 31;

// Class or Spec-specific actions
APLActionCatOptimalRotationAction cat_optimal_rotation_action = 18;
Expand Down Expand Up @@ -419,6 +420,16 @@ message APLActionMove {
message APLActionMoveDuration {
APLValue duration = 1;
}
message APLActionDamageAmplifier {
enum AmplificationType {
CasterBuff = 0;
EnvironmentBuff = 1;
TargetDebuff = 2;
}

AmplificationType ampType = 1;
int32 amount = 2;
}

message APLActionCustomRotation {
}
Expand Down
1 change: 1 addition & 0 deletions proto/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,7 @@ enum OtherAction {
OtherActionMove = 20; // Used by movement to be able to show it in timeline
OtherActionPrepull = 21; // Indicated prepull specific action
OtherActionEncounterStart = 22; // Indicated resources gained or lost at the start of an encounter
OtherActionDamageAmplifier = 23; // Indicated damage done % amplifiers configured in the APL
}

message ActionID {
Expand Down
98 changes: 97 additions & 1 deletion schemas/translation.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,7 @@
"name",
"search",
"filter",
"elapsed_time",
"phases",
"tanks",
"status",
Expand Down Expand Up @@ -4442,6 +4443,35 @@
"tooltip"
]
},
"damage_amplification": {
"type": "object",
"properties": {
"label": {
"type": "string"
},
"tooltip": {
"type": "string"
},
"amount": {
"type": "object",
"properties": {
"label": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"label"
]
}
},
"additionalProperties": false,
"required": [
"label",
"tooltip",
"amount"
]
},
"item_swap": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -4604,6 +4634,7 @@
"activate_all_stat_buff_proc_auras",
"cancel_aura",
"trigger_icd",
"damage_amplification",
"item_swap",
"move",
"custom_rotation",
Expand Down Expand Up @@ -7042,6 +7073,9 @@
},
"variable_assignment_tooltip": {
"type": "string"
},
"amplification_type": {
"type": "string"
}
},
"additionalProperties": false,
Expand All @@ -7055,7 +7089,8 @@
"include_reaction_time_tooltip",
"use_base_value",
"use_base_value_tooltip",
"variable_assignment_tooltip"
"variable_assignment_tooltip",
"amplification_type"
]
},
"eclipse_types": {
Expand Down Expand Up @@ -7170,6 +7205,65 @@
"hybrid"
]
},
"amplification_types": {
"type": "object",
"properties": {
"caster_buff": {
"type": "object",
"properties": {
"label": {
"type": "string"
},
"tooltip": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"label",
"tooltip"
]
},
"environment_buff": {
"type": "object",
"properties": {
"label": {
"type": "string"
},
"tooltip": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"label",
"tooltip"
]
},
"target_debuff": {
"type": "object",
"properties": {
"label": {
"type": "string"
},
"tooltip": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"label",
"tooltip"
]
}
},
"additionalProperties": false,
"required": [
"caster_buff",
"environment_buff",
"target_debuff"
]
},
"unit_labels": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -7251,6 +7345,7 @@
"rune_slots",
"rotation_types",
"hotw_strategies",
"amplification_types",
"unit_labels",
"placeholder_tooltip",
"select_variable",
Expand Down Expand Up @@ -9808,6 +9903,7 @@
"breakpoints_implemented",
"post_cap_ep",
"reforge_optimization_failed",
"reforge_optimization_cancelled",
"use_custom",
"enable_modification",
"modify_in_editor",
Expand Down
2 changes: 2 additions & 0 deletions sim/core/apl_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ func (rot *APLRotation) newAPLActionImpl(config *proto.APLAction) APLActionImpl
return rot.newActionCancelAura(config.GetCancelAura())
case *proto.APLAction_TriggerIcd:
return rot.newActionTriggerICD(config.GetTriggerIcd())
case *proto.APLAction_DamageAmplifier:
return rot.newActionDamageAmplifier(config.GetDamageAmplifier())
case *proto.APLAction_ItemSwap:
return rot.newActionItemSwap(config.GetItemSwap())
case *proto.APLAction_Move:
Expand Down
82 changes: 82 additions & 0 deletions sim/core/apl_actions_misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package core

import (
"fmt"
"math"
"time"

"github.com/wowsims/mop/sim/core/proto"
Expand Down Expand Up @@ -389,3 +390,84 @@ func (action *APLActionMoveDuration) IsReady(sim *Simulation) bool {
func (action *APLActionMoveDuration) String() string {
return "MoveDuration()"
}

/***
* Damage amplifier actions
**/

type APLActionDamageAmplifier struct {
defaultAPLActionImpl
unit *Unit
amount int32
percentage float64
aura *Aura

lastExecutedAt time.Duration
}

func (rot *APLRotation) newActionDamageAmplifier(config *proto.APLActionDamageAmplifier) APLActionImpl {
var auraLabel string
switch config.AmpType {
case proto.APLActionDamageAmplifier_EnvironmentBuff:
auraLabel = "Environment Buff"
case proto.APLActionDamageAmplifier_TargetDebuff:
auraLabel = "Target Debuff"
default:
auraLabel = "Caster Buff"
}

character := rot.unit.Env.Raid.GetPlayerFromUnit(rot.unit).GetCharacter()

if character == nil {
return nil
}

aura := character.GetOrRegisterAura(Aura{
Label: fmt.Sprintf("Damage Done %% (%s)", auraLabel),
ActionID: ActionID{OtherID: proto.OtherAction_OtherActionDamageAmplifier}.WithTag(int32(config.AmpType)),

Duration: NeverExpires,
MaxStacks: math.MaxInt32,
OnStacksChange: func(aura *Aura, sim *Simulation, oldStacks int32, newStacks int32) {
amount := (1.0 + float64(newStacks)/100) / (1.0 + float64(oldStacks)/100)

if config.AmpType == proto.APLActionDamageAmplifier_TargetDebuff {
for _, unit := range character.Env.Encounter.AllTargetUnits {
unit.PseudoStats.DamageTakenMultiplier *= amount
}
} else {
character.PseudoStats.DamageDealtMultiplier *= amount

for _, pet := range character.Pets {
if !pet.isGuardian {
pet.PseudoStats.DamageDealtMultiplier *= amount
}
}
}

if sim.Log != nil {
sim.Log("Triggered Damage Done %% (Type = %s, Percentage = %d%%)", auraLabel, config.Amount)
}
},
})

return &APLActionDamageAmplifier{
unit: rot.unit,
amount: config.Amount,
aura: aura,
}
}
func (action *APLActionDamageAmplifier) Reset(sim *Simulation) {
action.lastExecutedAt = NeverExpires
}
func (action *APLActionDamageAmplifier) IsReady(sim *Simulation) bool {
// Prevent infinite loops by only allowing this action to be performed once at each timestamp.
return action.lastExecutedAt != sim.CurrentTime
}
func (action *APLActionDamageAmplifier) Execute(sim *Simulation) {
action.aura.Activate(sim)
action.aura.SetStacks(sim, action.aura.GetStacks()+action.amount)
}
func (action *APLActionDamageAmplifier) String() string {
return fmt.Sprintf("Damage Amplification(%d%%)", action.amount)
}
8 changes: 7 additions & 1 deletion ui/core/components/detailed_results/timeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,9 @@ export class Timeline extends ResultComponent {
);

auraAsResource.forEach(auraId => {
const auraIndex = buffsById.findIndex(auraUptimeLogs => auraUptimeLogs?.[0].actionId!.spellId === auraId);
const auraIndex = buffsById.findIndex(
auraUptimeLogs => auraUptimeLogs?.[0].actionId!.spellId === auraId || auraUptimeLogs?.[0].actionId!.otherId === auraId,
);
if (auraIndex !== -1) {
this.addAuraRow(buffsById[auraIndex], duration);
}
Expand Down Expand Up @@ -1316,6 +1318,9 @@ const SPELL_ACTION_CATEGORY = 2;
const DEFAULT_ACTION_CATEGORY = 3;

const auraAsResource = [
// APL Damage Amplifier
OtherAction.OtherActionDamageAmplifier,

// Vengeance
84840, // Druid
84839, // Paladin
Expand All @@ -1339,6 +1344,7 @@ const idToCategoryMap: Record<number, number> = {
[OtherAction.OtherActionMove]: 0,
[OtherAction.OtherActionAttack]: 0.01,
[OtherAction.OtherActionShoot]: 0.5,
[OtherAction.OtherActionDamageAmplifier]: 0.6,

// Druid
[48480]: 0.1, // Maul
Expand Down
Loading