Skip to content
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

aAll units self-click, cleric heal #130

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mrboli
Copy link

@mrboli mrboli commented Feb 4, 2024

Main objective: Add in double click on cleric, assassin, poison wisp and enchantress to cast attack / heal.
Impact: Time saving for the user, feature in original game.

Steps for user:

  • Click Attack Mode First
  • Click aAll unit (cleric, asssassin, poison wisp, enchantress)
  • [New Behavior] Allow for clicking cleric on itself to initiate heal

Approach: Add self to target tiles list in getTargetTiles, modify existing calls to getTargetUnits to use getAttackTiles instead to ensure we are not targeting the unit itself.

Cases Tested:

  • NEW: Tested on non-quick mode with incognito
  • NEW: aAll units will not attack self
  • NEW: aAll Units will show affected target on card by default or when blurred
  • NEW: aAll Units will not show self damage on the card when focused or blurred
  • NEW: Cleric will not show self hit notice when full HP
  • Regular units without aAll will not have their own tile highlighted by default
  • Cleric will not heal self when full HP
  • Cleric will not double heal self when missing HP
  • Cleric will heal only self if only self is damaged
  • Assassin, enchantress and wisp can self-target for attack surrounding targets

Demo:
https://www.loom.com/share/e8ba68d94dbb46f780b4c8c8be0a3a4b

@@ -92,7 +92,7 @@ export default class Unit {
if (this.aLOS === true)
return this.getLOSTargetTiles(target, source);
else if (this.aAll === true)
return this.getAttackTiles(source);
return [...this.getAttackTiles(source), this.assignment];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To deduplicate, you can use this line:
return [ ...new Set([ ...this.getAttackTiles(source), this.assignment ]) ];

@@ -5,7 +5,7 @@ export default class Cleric extends Unit {
return this.getTargetUnits().map(u => u.assignment);
}
getTargetTiles() {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cleric class doesn't need to override getTargetTiles() anymore.

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.

None yet

2 participants