Skip to content

Commit

Permalink
fix: update to T26 SimulationCraft scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Sidoine committed Dec 19, 2020
1 parent 18d7714 commit bc3a3e1
Show file tree
Hide file tree
Showing 57 changed files with 16,845 additions and 6,954 deletions.
4 changes: 2 additions & 2 deletions .vscode/launch.json
Expand Up @@ -8,9 +8,9 @@
"type": "node",
"request": "launch",
"name": "SimulationCraft",
"program": "${workspaceFolder}/dist/src/utils/importsimc.js",
"program": "${workspaceFolder}/dist/src/utils/importsimc/index.js",
"protocol": "inspector",
"args": ["../../simc/", "T25_Mage_Arcane.simc"],
"args": ["../../simc/", "T26_Druid_Feral_Owlweave.simc"],
"outFiles": ["${workspaceFolder}/dist/**/*.js"]
},
{
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -7,7 +7,7 @@
"test": "jest",
"prepare": "tstolua -p tsconfig.lua.json",
"prepare-tools": "tsc",
"simc": "node dist/src/utils/importsimc.js ../../simc",
"simc": "node dist/src/utils/importsimc/index.js ../../simc",
"dbc": "node dist/src/utils/dbc.js",
"watch": "tstolua -p tsconfig.lua.json -w",
"watch-tools": "tsc -w",
Expand Down
2 changes: 2 additions & 0 deletions src/engine/ast.ts
Expand Up @@ -125,6 +125,7 @@ export const checkSpellInfo: TypeCheck<SpellInfoValues> = {
haste: true,
health: true,
holypower: true,
icd: true,
inccounter: true,
insanity: true,
interrupt: true,
Expand All @@ -140,6 +141,7 @@ export const checkSpellInfo: TypeCheck<SpellInfoValues> = {
rage: true,
replaced_by: true,
resetcounter: true,
rppm: true,
runes: true,
runicpower: true,
shared_cd: true,
Expand Down
38 changes: 19 additions & 19 deletions src/engine/compile.ts
Expand Up @@ -208,25 +208,25 @@ export class OvaleCompileClass {
if (itemId) {
const ii = this.ovaleData.ItemInfo(itemId);
for (const [k, v] of kpairs(namedParams)) {
if (k == "proc") {
const buff = v;
if (buff.type === "value" && isNumber(buff.value)) {
const name = "item_proc_" + namedParams.proc;
const list = this.ovaleData.buffSpellList[name] || {};
list[buff.value] = true;
this.ovaleData.buffSpellList[name] = list;
} else {
ok = false;
break;
}
} else {
if (v.type === "value" || v.type === "string")
(ii as any)[k] = v.value;
else {
ok = false;
break;
}
// if (k == "proc") {
// const buff = v;
// if (buff.type === "value" && isNumber(buff.value)) {
// const name = "item_proc_" + namedParams.proc;
// const list = this.ovaleData.buffSpellList[name] || {};
// list[buff.value] = true;
// this.ovaleData.buffSpellList[name] = list;
// } else {
// ok = false;
// break;
// }
// } else {
if (v.type === "value" || v.type === "string")
(ii as any)[k] = v.value;
else {
ok = false;
break;
}
// }
}
this.ovaleData.itemInfo[itemId] = ii;
}
Expand Down Expand Up @@ -446,7 +446,7 @@ export class OvaleCompileClass {
spellName
);
}
} else {
} else if (spellId > 0) {
this.tracer.Error(
"Unknown spell with ID %s.",
spellId
Expand Down
3 changes: 2 additions & 1 deletion src/engine/condition.ts
Expand Up @@ -55,8 +55,9 @@ export function isComparator(token: string): token is ComparatorId {
interface NumberParameterInfo<Optional = boolean> {
type: "number";
name: string;
optional?: Optional;
optional: Optional;
isSpell?: boolean;
isItem?: boolean;
defaultValue?: number;
}

Expand Down
3 changes: 3 additions & 0 deletions src/engine/data.ts
Expand Up @@ -148,6 +148,9 @@ export interface SpellInfoValues
gcd?: number;
shared_cd?: string;
cd?: number;
/** Internal cooldown (mainly on items) */
icd?: number;
rppm?: number;
charge_cd?: number;
forcecd?: number;
buff_cd?: number; // Internal cooldown, rename?
Expand Down

0 comments on commit bc3a3e1

Please sign in to comment.