-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move hunter APL to fully launched (with Simple Rotation) and fix a fe…
…w UI bugs
- Loading branch information
Showing
9 changed files
with
186 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { | ||
ActionID as ActionIdProto, | ||
Cooldowns, | ||
} from '../proto/common.js'; | ||
|
||
import { | ||
APLAction, | ||
APLPrepullAction, | ||
} from '../proto/apl.js'; | ||
|
||
export function prepullPotionAction(doAt?: string): APLPrepullAction { | ||
return APLPrepullAction.fromJsonString(`{"action":{"castSpell":{"spellId":{"otherId":"OtherActionPotion"}}},"doAtValue":{"const":{"val":"${doAt || '-1s'}"}}}`); | ||
} | ||
|
||
export function autocastCooldownsAction(startAt?: string): APLAction { | ||
if (startAt) { | ||
return APLAction.fromJsonString(`{"condition":{"cmp":{"op":"OpGt","lhs":{"currentTime":{}},"rhs":{"const":{"val":"${startAt}"}}}},"autocastOtherCooldowns":{}}`); | ||
} else { | ||
return APLAction.fromJsonString(`{"autocastOtherCooldowns":{}}`); | ||
} | ||
} | ||
|
||
export function scheduledCooldownAction(schedule: string, actionId: ActionIdProto): APLAction { | ||
return APLAction.fromJsonString(`{"schedule":{"schedule":"${schedule}","innerAction":{"castSpell":{"spellId":${ActionIdProto.toJson(actionId)}}}}}`); | ||
} | ||
|
||
export function simpleCooldownActions(cooldowns: Cooldowns): Array<APLAction> { | ||
return cooldowns.cooldowns | ||
.filter(cd => cd.id) | ||
.map(cd => { | ||
const schedule = cd.timings.map(timing => timing.toFixed(1) + 's').join(', '); | ||
return scheduledCooldownAction(schedule, cd.id!); | ||
}); | ||
} | ||
|
||
export function standardCooldownDefaults(cooldowns: Cooldowns, prepotAt?: string, startAutocastCDsAt?: string): [Array<APLPrepullAction>, Array<APLAction>] { | ||
return [ | ||
[prepullPotionAction(prepotAt)], | ||
[ | ||
autocastCooldownsAction(startAutocastCDsAt), | ||
simpleCooldownActions(cooldowns), | ||
].flat(), | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.