Skip to content

Commit 4409e5f

Browse files
committed
fix: don't place Mud Baths on red Dark Priest
1 parent 76bb6d2 commit 4409e5f

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

src/abilities/Swine-Thug.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -401,10 +401,20 @@ export default (G: Game) => {
401401
let hexes = [];
402402
if (!selfOnly) {
403403
// Gather all the reachable hexes, including the current one
404-
hexes = G.grid.getFlyingRange(swine.x, swine.y, 50, 1, 0);
404+
hexes = G.grid.getFlyingRange(swine.x, swine.y, 50, 1, swine.id);
405405
}
406406
hexes.push(G.grid.hexes[swine.y][swine.x]);
407407

408+
// Filter out hexes containing any creatures (except self for self-cast)
409+
hexes = hexes.filter((hex) => {
410+
const isSelf = hex.x === swine.x && hex.y === swine.y;
411+
if (isSelf) {
412+
return true;
413+
}
414+
const creatures = getPointFacade().getCreaturesAt(hex.x, hex.y);
415+
return creatures.length === 0;
416+
});
417+
408418
G.grid.queryHexes({
409419
fnOnCancel: function () {
410420
G.activeCreature.queryMove();
@@ -451,11 +461,12 @@ export default (G: Game) => {
451461
'onStepIn',
452462
{
453463
requireFn: function () {
454-
const creaturesOnHex = getPointFacade().getCreaturesAt(hex.x, hex.y);
464+
const creaturesOnHex = getPointFacade().getCreaturesAt(this.trap.x, this.trap.y);
455465
if (creaturesOnHex.length === 0) {
456466
return false;
457467
}
458-
return creaturesOnHex[0].type != 'A1';
468+
// Swine Thugs are immune to the slow effect (they get Spa Goggles instead)
469+
return !creaturesOnHex.some((c) => c.type === 'A1');
459470
},
460471
effectFn: function (effect, crea: Creature) {
461472
if (crea) {

0 commit comments

Comments
 (0)