Skip to content

Commit

Permalink
Merge pull request #2625 from Changh341/whip-move-and-plasma-field-in…
Browse files Browse the repository at this point in the history
…teraction

Fix: Whip move interaction with plasma fielded Dark Priest [#2542]
  • Loading branch information
DreadKnight authored Sep 25, 2024
2 parents 8a2d9de + b65e0a1 commit 53d0125
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/abilities/Headless.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Damage } from '../damage';
import { Team } from '../utility/team';
import { isTeam, Team } from '../utility/team';
import * as matrices from '../utility/matrices';
import { Effect } from '../effect';
import Game from '../game';
Expand Down Expand Up @@ -272,7 +272,22 @@ export default (G: Game) => {
let destinationX = null;
let destinationTargetX = null;
const isOnLeft = headless.x < target.x;
if (target.size === 1) {

if (
target.isDarkPriest() &&
target.hasCreaturePlayerGotPlasma() &&
!isTeam(this.creature, target, Team.Ally)
) {
/* Target creature is a plasma fielded enemy Dark Priest
blocking the ability and triggering a counter damage if upgraded field */
destinationTargetX = 0;
const d = {
slash: 1,
};
const damage = new Damage(ability.creature, d, 1, [], G);

target.takeDamage(damage);
} else if (target.size === 1) {
/* Small creature, pull target towards self landing it in the hex directly
in front of the Headless. */
destinationTargetX = isOnLeft ? headless.x + 1 : headless.x - 2;
Expand Down

0 comments on commit 53d0125

Please sign in to comment.