Skip to content

fix(abilities): stop Golden Wyrm turning around to heal an adjacent ally (fixes #1965) - #3215

Open
woahwhattheheck wants to merge 1 commit into
FreezingMoon:masterfrom
woahwhattheheck:fix/1965-no-turn-while-casting
Open

fix(abilities): stop Golden Wyrm turning around to heal an adjacent ally (fixes #1965)#3215
woahwhattheheck wants to merge 1 commit into
FreezingMoon:masterfrom
woahwhattheheck:fix/1965-no-turn-while-casting

Conversation

@woahwhattheheck

@woahwhattheheck woahwhattheheck commented Sep 6, 2026

Copy link
Copy Markdown

Fixes #1965

Why it turns around

Ability.animation2() re-orients the caster at its target before every cast:

this.creature.facePlayerDefault();

// Force creatures to face towards their target
if (args[0]) {
	this.creature.faceHex(args[0]);

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], or hexagons[size - 1] when flipped) and then decides with

const flipped = facefrom.y % 2 === 0 ? faceto.x <= facefrom.x : faceto.x < facefrom.x;

An ally on a frontal diagonal hex can share the reference hex's x, so on an even row faceto.x <= facefrom.x is 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 false opts 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 in ability.ts, and the flag on Visible Stigmata.

On the more general bug

faceHex() already has an attackFix branch that suppresses exactly this diagonal flip, but animation2() 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.ts covers 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.

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
@vercel

vercel Bot commented Sep 6, 2026

Copy link
Copy Markdown

@woahwhattheheck is attempting to deploy a commit to the FreezingMoon Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

don't turn around while casting [bounty: 8 XTR]

1 participant