Skip to content

Fix: Accept additional correct solutions in L14.P2 damage check - #1389

Open
madison-nicole wants to merge 1 commit into
GDQuest:mainfrom
madison-nicole:fix/l14-p2-damage-check
Open

Fix: Accept additional correct solutions in L14.P2 damage check#1389
madison-nicole wants to merge 1 commit into
GDQuest:mainfrom
madison-nicole:fix/l14-p2-damage-check

Conversation

@madison-nicole

Copy link
Copy Markdown

Please check if the PR fulfills these requirements:

  • The commit message follows our guidelines.
  • For bug fixes and features:
    • You tested the changes.

Related issue (if applicable): #1388

What kind of change does this PR introduce?

Bug fix: widens the static check for practice L14.P2 "Reducing damage at
higher levels" so it accepts more correct solutions.

Does this PR introduce a breaking change?

No. All previously accepted solutions still pass; the change only adds
alternatives to the existing GDExpr.any_of pattern in
TestReducingDamage.gd. No practice text or error messages were touched,
so there is no translation churn.

New feature or change

What is the current behavior?

The check "Multiplication Is Used To Reduce Damage Amount" only matches
amount *= 0.5 and amount = amount * 0.5 (operand order is already
flexible, so amount = 0.5 * amount also passes). Other solutions that
produce exactly the specified behavior, half damage above level 2, full
damage below, fail with "It looks like amount isn't reduced by a
percentage," even though the behavioral check passes.

What is the new behavior?

Two additional forms are accepted, both of which keep the practice's
intent of assigning the reduced value back to the parameter:

  • amount -= amount * 0.5
  • amount /= 2 (also matches 2.0, since literal matching uses Variant ==)

Out of scope, up to the maintainer

The static check for the "Reducing damage at higher levels" practice
only matched 'amount *= 0.5' and 'amount = amount * 0.5'. Also accept
'amount -= amount * 0.5' and 'amount /= 2', which produce the specified
behavior (half damage above level 2) and still assign the reduced value
back to the parameter.
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.

1 participant