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: fixes to import harness and import latest scripts #994

Merged
merged 60 commits into from
Sep 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
e4961dc
fix: generate 9.1 scripts from Tier27 SimulationCraft profiles
johnnylam88 Aug 26, 2021
20be10a
fix: adjust names of spell scripts for Shadowlands 9.1
johnnylam88 Sep 3, 2021
38ab022
fix: use correct SpellId names instead of hardcoding constants
johnnylam88 Aug 26, 2021
9586e4c
fix: ensure that 'this' is valid within parseGroup
johnnylam88 Aug 26, 2021
1efaf41
fix: update conduit data
johnnylam88 Aug 26, 2021
a09d3c4
fix: update usage of method in OvaleScripts class to correct name
johnnylam88 Aug 27, 2021
7d87aee
fix: remove identifier fixes that were not necessary
johnnylam88 Aug 27, 2021
5db2ba0
style: sort fixIdentifier() section
johnnylam88 Aug 27, 2021
ca1b148
fix: support heroic_charge action (Heroic Leap, then Charge)
johnnylam88 Aug 27, 2021
fcb26a7
fix: workaround name=name= syntax error in SimC profiles
johnnylam88 Aug 27, 2021
fbba18a
fix: workaround name=BT&Foo syntax error in SimC profiles
johnnylam88 Aug 27, 2021
79b8042
fix: add Merciless Bonegrinder soulbind and buff for warriors
johnnylam88 Aug 28, 2021
88fc337
fix: decorate warlock pet interrupt and CC spells
johnnylam88 Aug 28, 2021
1707cda
fix: support warlock interrupts
johnnylam88 Aug 28, 2021
e82917d
fix: from_the_shadows is a target debuff, not a player buff
johnnylam88 Aug 28, 2021
866a9f9
fix: add flagellation_buff granted by spending CPs during Flagellation
johnnylam88 Aug 28, 2021
1ec8f4d
fix: disambiguate blood_fury for paladins
johnnylam88 Aug 28, 2021
76bb8b0
fix: change bonedust_brew_debuff to just bonedust_brew
johnnylam88 Aug 28, 2021
bf02493
fix: add spell definition for ravenous_frenzy_sinful_hysteria_buff
johnnylam88 Aug 28, 2021
2f70647
fix: add partial support for "newfound_resolve" action
johnnylam88 Aug 28, 2021
a8db3b7
fix: support cp_gain modifier in SimC profile
johnnylam88 Aug 28, 2021
4517a12
fix: update Serrated Bone Spike to 9.1 behavior
johnnylam88 Aug 28, 2021
c82d563
fix: ignore "retarget_auto_attack" action
johnnylam88 Aug 28, 2021
fa0e6a4
fix: correctly translate cooldowns for items that proc buffs
johnnylam88 Aug 28, 2021
ac7efc9
fix: support {duration,remains}_expected as cooldown properties
johnnylam88 Aug 29, 2021
a41c5ef
fix: support {regen,time_to_max}_combined as energy properties
johnnylam88 Aug 29, 2021
3077168
fix: add missing HasWeapon script condition used for main_hand.2h
johnnylam88 Aug 29, 2021
664b201
fix: parse 'sequence' actions correctly
johnnylam88 Aug 30, 2021
b896fab
fix: include item identifiers in the common script
johnnylam88 Sep 3, 2021
eac60b1
fix: support more SimC "trinket" properties
johnnylam88 Sep 3, 2021
765d2d9
fix: support "death_and_decay.active_remains" in SimC profiles
johnnylam88 Sep 3, 2021
26055d3
fix: use correct trinket name for Tormented Insight buff
johnnylam88 Sep 3, 2021
c0297c1
refactor: extract function to walk a spell "replaced_by" chain
johnnylam88 Sep 3, 2021
0dd4570
fix: resolve spells in SpellCooldown() condition before checking
johnnylam88 Sep 3, 2021
d026da5
fix: disambiguate "bs_inc" into "berserk_{bear,cat}"
johnnylam88 Sep 3, 2021
da638b9
fix: disambiguate "berserk" into "berserk_{bear,cat}"
johnnylam88 Sep 3, 2021
47a2f57
fix: disambiguate "incarnation" action for each druid specialization
johnnylam88 Sep 3, 2021
8789133
fix: remove unneeded "berserk" spell list
johnnylam88 Sep 3, 2021
36385fc
fix: support "ca_inc" in balance druid SimC profiles
johnnylam88 Sep 3, 2021
9db5cd7
fix: eclipse module correctly handles Incarnation: Chosen of Elune
johnnylam88 Sep 3, 2021
da7f426
fix: remaining_winters_chill tracks a target, not player, debuff
johnnylam88 Sep 3, 2021
58edff2
style: minor whitespace changes to ovale_mage_spells
johnnylam88 Sep 4, 2021
0cbe21c
fix: decorate winters_chill_debuff for frost mages
johnnylam88 Sep 4, 2021
8a8760b
fix: support raid_event.vulnerable.{exists,in,up} in SimC profiles
johnnylam88 Sep 3, 2021
bd40faa
fix: support "searing_touch.active" for fire mage SimC profiles
johnnylam88 Sep 3, 2021
f921169
fix: support "precast_etf_equip" for MM hunter SimC profiles
johnnylam88 Sep 3, 2021
cb90393
fix: support "bloodseeker.remains" in survival hunter SimC profiles
johnnylam88 Sep 3, 2021
9c98a2b
fix: allow "code" without "symbolsInCode" in emitMiscOperand
johnnylam88 Sep 3, 2021
876643c
fix: support "expected_kindling_reduction" in fire mage SimC profiles
johnnylam88 Sep 3, 2021
3f90ed3
fix: support "target.cooldown.pause_action.*" in SimC profiles
johnnylam88 Sep 3, 2021
3fa8378
fix: support "buff.recent_purifies.value" in SimC profiles
johnnylam88 Sep 3, 2021
d0f576e
fix: support "execute_time" operand for "use_item" actions
johnnylam88 Sep 3, 2021
7dbef0f
fix: aura IDs are not always in the spellbook
johnnylam88 Sep 3, 2021
2b1780c
fix: use the exact item if the name is provided
johnnylam88 Sep 3, 2021
eb4693c
fix: correctly tag items identified by slot name for splitting
johnnylam88 Sep 3, 2021
9d85478
fix: import scripts from simc shadowlands branch from 2021-09-03
johnnylam88 Sep 3, 2021
2b29a5c
fix: use T27 script names in the integration tests
johnnylam88 Sep 3, 2021
5397156
fix: fixes for integration test
johnnylam88 Sep 3, 2021
941f2a0
fix: set the T27 scripts as the default for all specializations
johnnylam88 Sep 3, 2021
ba69682
Merge branch 'master' into fix/import-20210903
Sidoine Sep 4, 2021
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
7 changes: 5 additions & 2 deletions src/engine/ast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2651,15 +2651,18 @@ export class OvaleASTClass {
return node;
};

private parseGroup(tokenStream: OvaleLexer, annotation: AstAnnotation) {
private parseGroup = (
tokenStream: OvaleLexer,
annotation: AstAnnotation
): AstNode | undefined => {
const group = this.innerParseGroup(tokenStream, annotation);
if (group && lualength(group.child) === 1) {
const result = group.child[1];
this.nodesPool.release(group);
return result;
}
return group;
}
};

private innerParseGroup: ParserFunction<AstGroupNode> = (
tokenStream,
Expand Down
30 changes: 8 additions & 22 deletions src/engine/best-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
} from "./ast";
import { OvaleCooldownClass } from "../states/Cooldown";
import { OvaleSpellsClass } from "../states/Spells";
import { isNumber, isString, oneTimeMessage } from "../tools/tools";
import { isNumber, isString } from "../tools/tools";
import { OvaleClass } from "../Ovale";
import { AceModule } from "@wowts/tsaddon";
import { Guids } from "./guid";
Expand Down Expand Up @@ -187,28 +187,14 @@ export class OvaleBestActionClass {
let si = this.ovaleData.spellInfo[spellId];
let replacedSpellId = undefined;
if (si) {
const maxGuard = 20;
let guard = 0;
let replacementId = spellId;
let id: number | undefined = replacementId;
while (id !== undefined && guard < maxGuard) {
guard = guard + 1;
replacementId = id;
id = this.ovaleData.getSpellInfoProperty(
<number>replacementId,
atTime,
"replaced_by",
targetGUID
);
}
if (guard >= maxGuard) {
oneTimeMessage(
"Recursive 'replaced_by' chain for spell ID '%s'.",
spellId
);
} else if (replacementId != spellId) {
const replacementSpellId = this.ovaleData.resolveSpell(
spellId,
atTime,
targetGUID
);
if (replacementSpellId && replacementSpellId != spellId) {
replacedSpellId = spellId;
spellId = replacementId;
spellId = replacementSpellId;
si = this.ovaleData.spellInfo[spellId];
this.tracer.log(
"Spell ID '%s' is replaced by spell ID '%s'.",
Expand Down
200 changes: 85 additions & 115 deletions src/engine/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
LuaObj,
} from "@wowts/lua";
import { find } from "@wowts/string";
import { isNumber } from "../tools/tools";
import { isNumber, oneTimeMessage } from "../tools/tools";
import { HasteType } from "../states/PaperDoll";
import { PowerType } from "../states/Power";
import { GetSpellInfo, SpellId } from "@wowts/wow-mock";
Expand Down Expand Up @@ -306,147 +306,86 @@ export class OvaleDataClass {

buffSpellList: LuaObj<LuaArray<boolean>> = {
attack_power_multiplier_buff: {
[6673]: true,
[19506]: true,
[57330]: true,
[SpellId.battle_shout]: true,
},
critical_strike_buff: {
[1459]: true,
[24604]: true,
[24932]: true,
[61316]: true,
[90309]: true,
[90363]: true,
[97229]: true,
[116781]: true,
[126309]: true,
[126373]: true,
[128997]: true,
[160052]: true,
[160200]: true,
},
haste_buff: {
[49868]: true,
[55610]: true,
[113742]: true,
[128432]: true,
[135678]: true,
[160003]: true,
[160074]: true,
[160203]: true,
},
mastery_buff: {
[19740]: true,
[24907]: true,
[93435]: true,
[116956]: true,
[128997]: true,
[155522]: true,
[160073]: true,
[160198]: true,
[SpellId.arcane_intellect]: true,
},
haste_buff: {},
mastery_buff: {},
spell_power_multiplier_buff: {
[1459]: true,
[61316]: true,
[90364]: true,
[109773]: true,
[126309]: true,
[128433]: true,
[160205]: true,
[SpellId.arcane_intellect]: true,
},
stamina_buff: {
[469]: true,
[21562]: true,
[50256]: true,
[90364]: true,
[160003]: true,
[160014]: true,
[166928]: true,
[160199]: true,
},
str_agi_int_buff: {
[1126]: true,
[20217]: true,
[90363]: true,
[115921]: true,
[116781]: true,
[159988]: true,
[160017]: true,
[160077]: true,
[160206]: true,
},
versatility_buff: {
[1126]: true,
[35290]: true,
[50518]: true,
[55610]: true,
[57386]: true,
[159735]: true,
[160045]: true,
[160077]: true,
[167187]: true,
[167188]: true,
[172967]: true,
[SpellId.power_word_fortitude]: true,
},
str_agi_int_buff: {},
versatility_buff: {},
bleed_debuff: {
[1079]: true,
[16511]: true,
[33745]: true,
[77758]: true,
[113344]: true,
[115767]: true,
[122233]: true,
[154953]: true,
[155722]: true,
[SpellId.bloodbath_debuff]: true,
[SpellId.crimson_tempest]: true,
[SpellId.deep_wounds_debuff]: true,
[SpellId.garrote]: true,
[SpellId.internal_bleeding_debuff]: true,
[SpellId.rake_debuff]: true,
[SpellId.rend]: true,
[SpellId.rip]: true,
[SpellId.rupture]: true,
[SpellId.thrash_debuff]: true,
[SpellId.serrated_bone_spike]: true,
},
healing_reduced_debuff: {
[8680]: true,
[54680]: true,
[115625]: true,
[115804]: true,
[8680]: true, // Wound Poison debuff
[SpellId.mortal_wounds_debuff]: true,
},
stealthed_buff: {
[SpellId.stealth]: true,
[115191]: true,
[SpellId.incarnation_king_of_the_jungle]: true,
[SpellId.prowl]: true,
[SpellId.vanish]: true,
[11327]: true,
[SpellId.shadowmeld]: true,
[SpellId.incarnation_king_of_the_jungle]: true,
[SpellId.shadow_dance_buff]: true,
[SpellId.stealth]: true,
[SpellId.subterfuge_buff]: true,
[115193]: true,
[SpellId.shadow_dance]: true,
[185422]: true,
[347037]: true,
[SpellId.vanish]: true,
[11327]: true, // Vanish buff
[115191]: true, // Stealth (Subterfuge)
[115193]: true, // Vanish buff
[347037]: true, // Sepsis debuff
},
rogue_stealthed_buff: {
[SpellId.stealth]: true,
[115191]: true,
[SpellId.vanish]: true,
[11327]: true,
[SpellId.shadow_dance]: true,
[185422]: true,
[SpellId.shadow_dance_buff]: true,
[SpellId.subterfuge_buff]: true,
[347037]: true,
[SpellId.vanish]: true,
[11327]: true, // Vanish buff
[115191]: true, // Stealth (Subterfuge)
[115193]: true, // Vanish buff
[347037]: true, // Sepsis debuff
},
mantle_stealthed_buff: {
[SpellId.stealth]: true,
[SpellId.vanish]: true,
[11327]: true, // Vanish buff
[115193]: true, // Vanish buff
},
burst_haste_buff: {
[2825]: true,
[32182]: true,
[80353]: true,
[90355]: true,
[SpellId.bloodlust]: true,
[SpellId.drums_of_deathly_ferocity]: true,
[SpellId.drums_of_fury]: true,
[SpellId.drums_of_rage]: true,
[SpellId.drums_of_the_maelstrom]: true,
[SpellId.drums_of_the_mountain]: true,
[SpellId.heroism]: true,
[SpellId.primal_rage_pet]: true,
[SpellId.time_warp]: true,
},
burst_haste_debuff: {
[57723]: true,
[57724]: true,
[80354]: true,
[95809]: true,
[SpellId.exhaustion_debuff]: true,
[SpellId.sated_debuff]: true,
[SpellId.temporal_displacement_debuff]: true,
},
raid_movement_buff: {
[106898]: true,
[SpellId.stampeding_roar]: true,
[SpellId.wind_rush_buff]: true,
},
roll_the_bones_buff: {
[SpellId.broadside_buff]: true,
Expand All @@ -458,8 +397,12 @@ export class OvaleDataClass {
},
lethal_poison_buff: {
[SpellId.deadly_poison]: true,
[8679]: true,
[315584]: true,
[SpellId.instant_poison]: true,
[SpellId.wound_poison]: true,
},
non_lethal_poison_buff: {
[SpellId.crippling_poison]: true,
[SpellId.numbing_poison]: true,
},
};
constructor(private runner: Runner, ovaleDebug: DebugTools) {
Expand Down Expand Up @@ -793,6 +736,33 @@ export class OvaleDataClass {
return [value * ratio];
}

resolveSpell(
spellId: number,
atTime: number | undefined,
targetGUID: string | undefined
): number | undefined {
const maxGuard = 20;
let guard = 0;
let nextId;
let id: number | undefined = spellId;
while (id && guard < maxGuard) {
guard += 1;
nextId = id;
id = this.getSpellInfoProperty(
nextId,
atTime,
"replaced_by",
targetGUID
);
}
if (guard >= maxGuard) {
oneTimeMessage(
`Recursive 'replaced_by' chain for spell ID '${spellId}'.`
);
}
return nextId;
}

getDamage(
spellId: number,
attackpower: number,
Expand Down
Loading