From 9cc6d36066b18da37a609ef2773df091df4afa09 Mon Sep 17 00:00:00 2001 From: howard Date: Tue, 24 Sep 2024 13:16:12 -0700 Subject: [PATCH] Add new condtional logic to check for plasma field on a whip move activation --- src/abilities/Headless.ts | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/abilities/Headless.ts b/src/abilities/Headless.ts index 2ea340f0a..c23aaa01d 100755 --- a/src/abilities/Headless.ts +++ b/src/abilities/Headless.ts @@ -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'; @@ -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;