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

[Issue-2542] Whip move interaction with plasma fielded dark priest #2625

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading