Skip to content

Commit

Permalink
Merge pull request #2508 from tomaszajac-vs/issues-2494-fix
Browse files Browse the repository at this point in the history
fixes flipped undefined errors, closes #2494
  • Loading branch information
DreadKnight authored Oct 18, 2023
2 parents e7284d4 + dd6f28f commit ea7fc27
Show file tree
Hide file tree
Showing 13 changed files with 50 additions and 49 deletions.
54 changes: 27 additions & 27 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/abilities/Chimera.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default (G) => {
},
team: this._targetTeam,
id: chimera.id,
flipped: chimera.flipped,
flipped: chimera.player.flipped,
hexes: G.grid.getHexMap(chimera.x - 3, chimera.y - 2, 0, false, matrices.frontnback3hex),
});
},
Expand Down
4 changes: 2 additions & 2 deletions src/abilities/Golden-Wyrm.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export default (G) => {
},
team: this._targetTeam,
id: wyrm.id,
flipped: wyrm.flipped,
flipped: wyrm.player.flipped,
hexes: this._getHexes(),
});
},
Expand Down Expand Up @@ -348,7 +348,7 @@ export default (G) => {
optTest: this._confirmTarget,
team: this._targetTeam,
id: wyrm.id,
flipped: wyrm.flipped,
flipped: wyrm.player.flipped,
hexes: this._getHexes(),
});
},
Expand Down
2 changes: 1 addition & 1 deletion src/abilities/Headless.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export default (G) => {
},
team: this._targetTeam,
id: crea.id,
flipped: crea.flipped,
flipped: crea.player.flipped,
hexes: crea.getHexMap(matrices.frontnback2hex),
});
},
Expand Down
7 changes: 3 additions & 4 deletions src/abilities/Impaler.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,13 @@ export default (G) => {
query: function () {
const ability = this;
const creature = this.creature;

G.grid.queryCreature({
fnOnConfirm: function () {
ability.animation(...arguments);
},
team: this._targetTeam,
id: creature.id,
flipped: creature.flipped,
flipped: creature.player.flipped,
hexes: this._getHexes(),
});
},
Expand Down Expand Up @@ -168,7 +167,7 @@ export default (G) => {
},
team: this._targetTeam,
id: creature.id,
flipped: creature.flipped,
flipped: creature.player.flipped,
hexes: this._getHexes(),
});
},
Expand Down Expand Up @@ -288,7 +287,7 @@ export default (G) => {
},
team: this._targetTeam,
id: this.creature.id,
flipped: this.creature.flipped,
flipped: this.creature.player.flipped,
hexes: this._getHexes(),
});
},
Expand Down
4 changes: 2 additions & 2 deletions src/abilities/Infernal.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export default (G) => {
},
team: this._targetTeam,
id: magmaSpawn.id,
flipped: magmaSpawn.flipped,
flipped: magmaSpawn.player.flipped,
hexes: this.creature.getHexMap(matrices.frontnback3hex),
});
},
Expand Down Expand Up @@ -202,7 +202,7 @@ export default (G) => {
team: Team.Both,
requireCreature: 0,
id: magmaSpawn.id,
flipped: magmaSpawn.flipped,
flipped: magmaSpawn.player.flipped,
choices: [magmaSpawn.getHexMap(this.map), magmaSpawn.getHexMap(this.map, true)],
});
},
Expand Down
4 changes: 2 additions & 2 deletions src/abilities/Knightmare.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export default (G) => {
},
team: this._targetTeam,
id: this.creature.id,
flipped: this.creature.flipped,
flipped: this.creature.player.flipped,
hexes: this.creature.getHexMap(matrices.frontnback2hex),
});
},
Expand Down Expand Up @@ -170,7 +170,7 @@ export default (G) => {
},
team: this._targetTeam,
id: this.creature.id,
flipped: this.creature.flipped,
flipped: this.creature.player.flipped,
hexes: this.creature.getHexMap(matrices.frontnback2hex),
});
},
Expand Down
5 changes: 3 additions & 2 deletions src/abilities/Nutcase.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export default (G) => {
},
team: this._targetTeam,
id: this.creature.id,
flipped: this.creature.flipped,
flipped: this.creature.player.flipped,
hexes: this.creature.getHexMap(matrices.frontnback2hex),
});
} else {
Expand Down Expand Up @@ -580,13 +580,14 @@ export default (G) => {
},
team: this._targetTeam,
id: this.creature.id,
flipped: this.creature.flipped,
flipped: this.creature.player.flipped,
hexes: this.creature.getHexMap(matrices.inlinefrontnback2hex),
optTest: function (creature) {
// Size restriction of 2 if unupgraded
return ability.isUpgraded() ? true : creature.size <= 2;
},
});

},

// activate() :
Expand Down
6 changes: 3 additions & 3 deletions src/abilities/Scavenger.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default (G) => {
},
team: this._targetTeam,
id: this.creature.id,
flipped: this.creature.flipped,
flipped: this.creature.player.flipped,
hexes: this.creature.getHexMap(matrices.frontnback2hex),
});
},
Expand Down Expand Up @@ -229,7 +229,7 @@ export default (G) => {
team: this._targetTeam,
id: [crea.id, trg.id],
size: size,
flipped: crea.player.flipped,
flipped: crea.player.player.flipped,
hexes: G.grid
.getFlyingRange(x, crea.y, distance, size, [crea.id, trg.id])
.filter(function (item) {
Expand Down Expand Up @@ -336,7 +336,7 @@ export default (G) => {
},
team: this._targetTeam,
id: this.creature.id,
flipped: this.creature.flipped,
flipped: this.creature.player.flipped,
hexes: this.creature.getHexMap(matrices.frontnback2hex),
});
},
Expand Down
4 changes: 2 additions & 2 deletions src/abilities/Stomper.js
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ export default (G) => {
team: Team.Both,
requireCreature: 0,
id: stomper.id,
flipped: stomper.flipped,
flipped: stomper.player.flipped,
choices: [targets, targets2], // Target the front or back row
hexesDashed: dashed,
});
Expand Down Expand Up @@ -492,7 +492,7 @@ export default (G) => {
team: Team.Both,
requireCreature: 0,
id: stomper.id,
flipped: stomper.flipped,
flipped: stomper.player.flipped,
choices: [stomper.getHexMap(this.map), stomper.getHexMap(this.map, true)],
});
},
Expand Down
4 changes: 2 additions & 2 deletions src/abilities/Uncle-Fungus.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export default (G) => {
},
team: this._targetTeam,
id: uncle.id,
flipped: uncle.flipped,
flipped: uncle.player.flipped,
hexes: uncle.getHexMap(matrices.frontnback2hex),
});
},
Expand Down Expand Up @@ -369,7 +369,7 @@ export default (G) => {
},
team: this._targetTeam,
id: uncle.id,
flipped: uncle.flipped,
flipped: uncle.player.flipped,
hexes: G.grid.getHexMap(uncle.x - 2, uncle.y - 2, 0, false, matrices.frontnback2hex),
});
},
Expand Down
2 changes: 1 addition & 1 deletion src/abilities/Vehemoth.js
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ export default (G) => {
},
team: this._targetTeam,
id: vehemoth.id,
flipped: vehemoth.flipped,
flipped: vehemoth.player.flipped,
hexes: this._getHexes(),
});
},
Expand Down
1 change: 1 addition & 0 deletions src/creature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,7 @@ export class Creature {
}, // Optional args
size: this.size,
flipped: this.player.flipped,

id: this.id,
hexes: o.range,
ownCreatureHexShade: o.ownCreatureHexShade,
Expand Down

1 comment on commit ea7fc27

@vercel
Copy link

@vercel vercel bot commented on ea7fc27 Oct 18, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.