Card Keyword Tooltips - UQcsse3200/2026-studio-3 GitHub Wiki

Card Keyword Tooltips

Related task: #448 — Map Introduction, Tutorial Improvements and Card Keyword Tooltips.

Implementation PR: #449 — Add battle card keyword tooltips, targeting Feature-2-Sprint4.

Player behaviour

Hovering a battle hand card shows explanations beside its top-right corner. Near the right screen edge, the panel appears on the left. Multiple keywords are shown once each, in their first appearance order in the card description.

The panel follows card movement and disappears when the pointer leaves, the player presses the card, the hand refreshes, the card becomes hidden or disabled, or the battle screen closes. It does not intercept card selection or dragging.

Supported keywords

Keyword Explanation
Block Absorbs normal damage. Resets at your next turn's start.
Strength +1 normal attack damage per point this combat.
Vulnerable Receives 50% more normal attack damage.
Poison Deals 1 damage per stack at enemy turn start. Ignores Block and Armour.
Feeble Deals 25% less normal attack damage.
Armour Absorbs normal damage after Block. Persists across turns.

Both Armour and Armor are recognised as the same keyword. Status duration remains specified in the card's own description.

Integration

  • CardKeyword.findIn(description) returns supported keywords using case-insensitive whole-word matching. Each keyword provides title() and description().
  • CardKeywordTooltip.attachTo(actor, description) attaches hover behaviour to an outer interactive card actor. The screen owns the shared tooltip and its skin.
  • BattleScreen.installHandCardWidget() supplies the button and resolved card description. Hand refresh, screen hide and disposal clear the panel.
  • The implementation currently serves battle hand cards. Card-face highlighting and inspection integration are coordinated with Team 6 through #432.

Verification

  • 8 keyword tests and 10 tooltip tests passed locally.
  • Push CI unit tests and Java formatting passed for commit e732e42e.
  • Joel confirmed the in-game behaviour and accepted the shortened descriptions.

Screenshots

Screenshots supplied by Joel in the PR verification comment.

Single keyword: Defend

Hovering Defend shows the concise Block explanation on the card's right side.

Defend with its Block explanation displayed on the right

Multiple keywords: Poison Blade

Poison Blade shows Block, Armour and Poison in description order. Block and Armour are recognised because the card mentions bypassing them, even though the card does not grant those defences.

Poison Blade with Block, Armour and Poison explanations

Left-side fallback: Iron Oath

Iron Oath shows the Armour explanation on its left when there is insufficient space on the right.

Iron Oath with the Armour explanation displayed on the left