Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a few apl bugs #3269

Merged
merged 1 commit into from
Jul 8, 2023
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
3 changes: 2 additions & 1 deletion sim/core/apl.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ func (unit *Unit) newAPLRotation(config *proto.APLRotation) *APLRotation {
rotation.curWarnings = nil
}

for i, action := range rotation.allAPLActions() {
for i, action := range rotation.priorityList {
action.impl.Finalize(rotation)

rotation.priorityListWarnings[configIdxs[i]] = append(rotation.priorityListWarnings[configIdxs[i]], rotation.curWarnings...)
rotation.curWarnings = nil

Expand Down
12 changes: 10 additions & 2 deletions sim/core/apl_actions_sequences.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ func (rot *APLRotation) newActionSequence(config *proto.APLActionSequence) APLAc
func (action *APLActionSequence) GetInnerActions() []*APLAction {
return Flatten(MapSlice(action.actions, func(action *APLAction) []*APLAction { return action.GetAllActions() }))
}
func (action *APLActionSequence) Finalize(*APLRotation) {}
func (action *APLActionSequence) Finalize(rot *APLRotation) {
for _, subaction := range action.actions {
subaction.impl.Finalize(rot)
}
}
func (action *APLActionSequence) Reset(*Simulation) {
action.curIdx = 0
}
Expand Down Expand Up @@ -92,7 +96,11 @@ func (rot *APLRotation) newActionStrictSequence(config *proto.APLActionStrictSeq
func (action *APLActionStrictSequence) GetInnerActions() []*APLAction {
return Flatten(MapSlice(action.actions, func(action *APLAction) []*APLAction { return action.GetAllActions() }))
}
func (action *APLActionStrictSequence) Finalize(*APLRotation) {}
func (action *APLActionStrictSequence) Finalize(rot *APLRotation) {
for _, subaction := range action.actions {
subaction.impl.Finalize(rot)
}
}
func (action *APLActionStrictSequence) Reset(*Simulation) {
action.curIdx = 0
}
Expand Down
1 change: 1 addition & 0 deletions sim/hunter/explosive_trap.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ func (hunter *Hunter) registerExplosiveTrapSpell(timer *core.Timer) {
ActionID: core.ActionID{SpellID: 49067},
SpellSchool: core.SpellSchoolFire,
ProcMask: core.ProcMaskSpellDamage,
Flags: core.SpellFlagAPL,

ManaCost: core.ManaCostOptions{
BaseCost: 0.19,
Expand Down
19 changes: 16 additions & 3 deletions ui/core/proto_utils/action_id.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,18 @@ export class ActionId {
const baseName = tooltipData['name'];
let name = baseName;
switch (baseName) {
case 'Explosive Shot':
if (this.spellId == 60053) {
name += ' (R4)';
} else if (this.spellId == 60052) {
name += ' (R3)';
}
break;
case 'Explosive Trap':
if (this.tag == 1) {
name += ' (Weaving)';
}
break;
case 'Arcane Blast':
if (this.tag == 1) {
name += ' (No Stacks)';
Expand Down Expand Up @@ -408,7 +420,7 @@ export class ActionId {
} else if (this.otherId) {
return 'other-' + this.otherId;
} else {
return 'empty-action';
throw new Error('Empty action id!');
}
}

Expand Down Expand Up @@ -481,7 +493,8 @@ export class ActionId {
}
}

private static readonly logRegex = /{((SpellID)|(ItemID)|(OtherID)): (\d+)(, Tag: (-?\d+))?}/g;
private static readonly logRegex = /{((SpellID)|(ItemID)|(OtherID)): (\d+)(, Tag: (-?\d+))?}/;
private static readonly logRegexGlobal = new RegExp(ActionId.logRegex, 'g');
private static fromMatch(match: RegExpMatchArray): ActionId {
const idType = match[1];
const id = parseInt(match[5]);
Expand All @@ -503,7 +516,7 @@ export class ActionId {
}

static async replaceAllInString(str: string): Promise<string> {
const matches = [...str.matchAll(ActionId.logRegex)];
const matches = [...str.matchAll(ActionId.logRegexGlobal)];

const replaceData = await Promise.all(matches.map(async match => {
const actionId = ActionId.fromMatch(match);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,7 @@

.apl-picker-builder-root.apl-action-sequence .apl-action-condition {
display: none;
}
.apl-picker-builder-root.apl-action-strictSequence .apl-action-condition {
display: none;
}