forked from wowsims/cata
-
Notifications
You must be signed in to change notification settings - Fork 41
Add reactive Anti-Magic Shell and Malkorok (DPS) encounter #1513
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
cc7667d
Add reactive Anti-Magic Shell and real Malkorok (AMS) encounter
darkmaster2133 10c58f9
Update DK Frost/Unholy golden test results for P5 preset changes
darkmaster2133 a6ecf66
Fix Malkorok encounter per review: move reactive AMS to APL, correct …
darkmaster2133 7dc7c69
Add dedicated Malkorok reactive-AMS presets for Frost/Unholy DK
darkmaster2133 78ff346
Fix native Windows dev server setup
darkmaster2133 bbd551a
Trim Malkorok AI comments per review, ignore throwaway BiS tools
darkmaster2133 3f29d2f
Update .gitignore to remove unused entries
darkmaster2133 c3b2770
Fix Malkorok reactive-AMS presets and encounter data per review
darkmaster2133 4d92ce2
Fix Malkorok reactive-AMS presets and encounter data per review
darkmaster2133 3f41767
Generate per-spec index.html before starting the dev server
darkmaster2133 5991fb3
Add boss_spell_is_known APL condition; consolidate Malkorok DK presets
darkmaster2133 d0fd460
Merge branch 'master' of https://github.com/darkmaster2133/mop--malko…
darkmaster2133 73d6cd9
Add boss_spell_known to translation schema
darkmaster2133 ddfc79e
Simplify Windows dev binary naming per review
darkmaster2133 cb153e5
Merge upstream/master into malkorok-ams
darkmaster2133 6859340
Fix Glyph of Regenerative Magic CD reduction not refreshing minReady …
darkmaster2133 08de19b
Fix AMS autocast regression from Malkorok bossSpellIsKnown check
darkmaster2133 b576515
Merge upstream/master into malkorok-ams
darkmaster2133 e4f59e5
Simplify clean target to use wowsimmop$(BIN_EXT) instead of separate …
darkmaster2133 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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,49 @@ | ||
| package core | ||
|
|
||
| import "time" | ||
|
|
||
| // ImminentMagicAbilityProvider is an optional interface a TargetAI can implement so external | ||
| // systems (e.g. a player's reactive defensive-cooldown logic, like Death Knight Anti-Magic | ||
| // Shell) can ask "are you about to unleash harmful magic damage?" without needing to know this | ||
| // NPC's specific ability set. Implementations should return true if a harmful magic ability is | ||
| // either genuinely mid-cast (a real telegraph) or, absent one, close enough to its own CD | ||
| // becoming ready that it's likely to be cast on the NPC's next decision tick. | ||
| // | ||
| // This is checked via a type assertion against Target.AI, so encounters that don't implement it | ||
| // (including any boss AI not built for this reactive-AMS project) simply don't participate -- | ||
| // callers should always have a non-reactive fallback for that case. | ||
| type ImminentMagicAbilityProvider interface { | ||
| HasImminentMagicAbility(sim *Simulation, reactionWindow time.Duration) bool | ||
| } | ||
|
|
||
| // SpellbookHasImminentMagicAbility is the default building block most TargetAI implementations | ||
| // of ImminentMagicAbilityProvider can just delegate to (see e.g. any soo/*_ai.go boss file's own | ||
| // HasImminentMagicAbility method): true if any harmful (non-physical, damage-dealing) spell | ||
| // registered on target is either currently mid-cast (a real telegraph -- Target.Hardcast tracks | ||
| // any unit's in-progress cast generically) or has spell.TimeToReady(sim) within reactionWindow. | ||
| // | ||
| // Bosses whose rotation gates casting on something TimeToReady can't see on its own (e.g. | ||
| // Paragons of the Klaxxi's per-NPC active-window gating, since a gated ability's CD timer just | ||
| // sits "ready" indefinitely while skipped rather than being re-armed) must check that condition | ||
| // themselves before falling back to this helper -- see paragons_of_the_klaxxi_ai.go. | ||
| func SpellbookHasImminentMagicAbility(target *Target, sim *Simulation, reactionWindow time.Duration) bool { | ||
| hardcasting := target.Hardcast.Expires > sim.CurrentTime | ||
|
|
||
| for _, spell := range target.Spellbook { | ||
| if !isHarmfulMagicSpell(spell) { | ||
| continue | ||
| } | ||
| if hardcasting && spell.ActionID == target.Hardcast.ActionID { | ||
| return true | ||
| } | ||
| if spell.TimeToReady(sim) <= reactionWindow { | ||
| return true | ||
| } | ||
| } | ||
|
|
||
| return false | ||
| } | ||
|
|
||
| func isHarmfulMagicSpell(spell *Spell) bool { | ||
| return spell.ProcMask.Matches(ProcMaskSpellDamage) && !spell.SpellSchool.Matches(SpellSchoolPhysical) | ||
| } | ||
This file contains hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.