-
Notifications
You must be signed in to change notification settings - Fork 91
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
NextQueueItemIsValid to use active char instead of next char #2174
Merged
Conversation
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
The follow changes fix the problem diff --git a/pkg/simulation/run.go b/pkg/simulation/run.go
index addf1f6a5..010c219d7 100644
--- a/pkg/simulation/run.go
+++ b/pkg/simulation/run.go
@@ -152,7 +152,7 @@ func queuePhase(s *Simulation) (stateFn, error) {
}
// append swap if called for char is not active
// check if NoChar incase this is some special action that does not require a character
- if next.Char != keys.NoChar && next.Char != s.C.Player.ActiveChar().Base.Key {
+ if next.Char != keys.NoChar && next.Char != s.C.Player.ActiveChar().Base.Key && next.Action != action.ActionSwap {
s.queue = append(s.queue, &action.Eval{
Char: next.Char,
Action: action.ActionSwap,
@@ -256,13 +256,21 @@ func executeActionPhase(s *Simulation) (stateFn, error) {
// wrap the error for more context
return nil, fmt.Errorf("error encountered on %v executing %v: %w", q.Char.String(), q.Action.String(), err)
}
+ next := skipUntilCanQueue
//TODO: this check here is probably unnecessary
if l := s.popQueue(); l > 0 {
// don't go back to queue if there are more actions already queued
- return actionReadyCheckPhase, nil
+ next = actionReadyCheckPhase
}
- return skipUntilCanQueue, nil
+ if q.Action == action.ActionSwap {
+ // if the action is swap, we need to advance frames by the SwapDelay so that the ready checks are being done on the correct character
+ // this is only needed because implicit swap will queue two actions immediately.
+ // an explicit swap will advance until the swap's CanQueueAfter before queue and calling ready check on the next action
+ return s.advanceFrames(s.C.Player.Delays.Swap, next)
+ }
+
+ return next, nil
}
func skipUntilCanQueue(s *Simulation) (stateFn, error) { |
Charlie-Zheng
pushed a commit
to Charlie-Zheng/gcsim
that referenced
this pull request
Jun 12, 2024
…sim#2174) * NextQueueItemIsValid to use active char instead of next char * should pass in next char in NextQuestItemIsValid * move implicit swap to evaluator to avoid skipping CanQueueAfter * clean up comment
Charlie-Zheng
pushed a commit
to Charlie-Zheng/gcsim
that referenced
this pull request
Jun 14, 2024
…sim#2174) * NextQueueItemIsValid to use active char instead of next char * should pass in next char in NextQuestItemIsValid * move implicit swap to evaluator to avoid skipping CanQueueAfter * clean up comment
imring
added a commit
that referenced
this pull request
Jun 20, 2024
* initial arlecchino commit * Updated NA frames * Updated CA frames * Updated Skill frames * Updated Burst frames * Updated Plunge frames * Updated N0 frames * Added Arlecchino shortcut * Update mode-gcsim.js for new char shortcut * Adjust burst and c2 AoE * Adjust skill aoe * Adjusted Hitboxes for offsets for NA/CA/Q/E/C2 * Removed incorrect comment * Adjusted Burst heal comment * Added C2 Damage delay frames * Added AoE data * Added frames documentation * Added hitlag documentation * Added nickname documentation * Added param documentation * Adjusted directive absorb AoE * Moved location of absorbDirective func * Added early cancel for CA * Moved absorbDirectives func to skill.go * Changed early_cancel to only work if the following action is Dash or Jump * Fixed charge early cancel with swap not giving correct error * reupload freminet and lynette frames (#2167) * fix haran (#2162) * Fixed overheal to be float64 * Removed swap CD change * Fixed onSwap name * Changed early cancel checks to happen in NextQueueItemIsValid * exposes the current BoL and BoLratio of a character (#2169) * apply beidou shield on skill tap (#2170) * Clam and SoDP use total healing before BoL reduction. (#2161) * fix echoes icd bug (#2166) * fix echoes icd bug * fix typo in echoes.go * Added Missing BoL Documentation (#2172) * exposes the current BoL and BoLratio of a character * Updated documentation for BoL and BoL Ratio * add Crimson Moon's Semblance (#2164) * add Crimson Moon's Semblance * refactor crimsonmoonssemblance * add Fragment of Harmonic Whimsy (#2163) * add Fragment of Harmonic Whimsy * update fohw condition * update shortcut * use StatModIsActive * add passive scaling to pipeline (#2173) * add passive scaling to pipeline * fix lint error * fix linter issues from new linter version (#2175) * nahida xq/yl n0 (#2171) * NextQueueItemIsValid to use active char instead of next char (#2174) * NextQueueItemIsValid to use active char instead of next char * should pass in next char in NextQuestItemIsValid * move implicit swap to evaluator to avoid skipping CanQueueAfter * clean up comment * Fixed NextQueueItemIsValid signature for Arlechinno * Fix linting * Renamed a1Directive to directiveScaling * Removed getTotalAtk() * Changed c6 buff to be hitlag extended * Changed c6 to use a callback instead of a subscription * Fixed redundant func * Fixed long line of code * Removed early cancelled flag in favour of checking the previous action and params * Removed uneeded today * Changed masque status duration to -1 * Added clarifying comment to switch behaviour * fix c6 --------- Co-authored-by: soloxcx <58927267+soloxcx@users.noreply.github.com> Co-authored-by: Keng <39216134+Siwat-Keng@users.noreply.github.com> Co-authored-by: clevernt <Azozy2011.hd@gmail.com> Co-authored-by: Liu Yihua <yihuajack@live.cn> Co-authored-by: srl <906239+srliao@users.noreply.github.com> Co-authored-by: imring <vitaliyvorobets25@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
allows for char to also block swap if swap is not a valid next action