fix(abilities): stop Golden Wyrm turning around to heal an adjacent ally (fixes #1965) - #3215
Open
woahwhattheheck wants to merge 1 commit into
Open
Conversation
animation2() re-orients the caster at its target before every cast. That is right for an attack, but Visible Stigmata reaches out to an ally already standing beside the Golden Wyrm, so there is nothing to turn towards. Because the Wyrm occupies three hexes, faceHex() measures from one fixed end of that span. An ally on a frontal diagonal hex can therefore compare as being behind the reference hex and flip the sprite, leaving the Wyrm with its back to the unit it is healing. Let an ability decline the re-facing with `_facesTarget: false` and set it on Visible Stigmata. The caster still resets to its default player facing, so it faces forward rather than spinning. Abilities that say nothing are unchanged. fixes FreezingMoon#1965
|
@woahwhattheheck is attempting to deploy a commit to the FreezingMoon Team on Vercel. A member of the Team first needs to authorize it. |
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
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.
Fixes #1965
Why it turns around
Ability.animation2()re-orients the caster at its target before every cast:That's right for an attack. Visible Stigmata isn't one — it reaches out to an ally already standing next to the Golden Wyrm, so there's nothing to turn towards, and turning is what looks wrong.
It's worse for the Wyrm than for a normal unit because it occupies three hexes.
faceHex()takes its reference from one fixed end of that span (hexagons[0], orhexagons[size - 1]when flipped) and then decides withAn ally on a frontal diagonal hex can share the reference hex's
x, so on an even rowfaceto.x <= facefrom.xis true and the sprite flips — the Wyrm ends up with its back to the unit it's healing, which is the case in the issue.What this changes
An ability can now decline the re-facing with
_facesTarget: false, and Visible Stigmata sets it.facePlayerDefault()still runs first, so the Wyrm settles into its normal forward facing instead of spinning.Only an explicit
falseopts out, so every ability that doesn't mention the flag behaves exactly as before — this can't quietly change any other unit.Three files plus a test: new
src/utility/ability-facing.ts(the predicate, kept dependency-free so it's testable — the ability modules pull in a lot), the guard inability.ts, and the flag on Visible Stigmata.On the more general bug
faceHex()already has anattackFixbranch that suppresses exactly this diagonal flip, butanimation2()never passes it and its offsets are written around 2-hex creatures ("only works on 2hex creature targeting the adjacent row"). Fixing that properly would change facing for every multi-hex unit in the game, and I can't verify hex geometry without playing it, so I kept this PR to the ability the issue is about. Happy to do the general version as a follow-up if you'd rather have that — it'd want someone able to eyeball Impaler/Vehemoth/Nutcase afterwards.Testing
src/__tests__/utility/ability-facing.tscovers the opt-in default, explicit true, explicit false, and an undefined flag. The visible result is an animation, so it's worth a quick look in-game before merge: heal an ally on a frontal diagonal hex and the Wyrm should stay facing forward.Not posting a wallet address here; happy to sort that separately if this lands.