Skip to content

Commit

Permalink
Fixes issue #2494
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomáš Zajac committed Oct 14, 2023
1 parent b9e6121 commit 6c7c7b7
Show file tree
Hide file tree
Showing 22 changed files with 97 additions and 88 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/Abolished.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export default (G) => {
fnOnConfirm: function () {
ability.animation(...arguments);
},
flipped: abolished.player.flipped,
flipped: abolished.flipped,
team: this._targetTeam,
id: this.creature.id,
requireCreature: true,
Expand Down
2 changes: 1 addition & 1 deletion src/abilities/Asher.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export default (G) => {
fnOnConfirm: function () {
ability.animation(...arguments);
},
flipped: crea.player.flipped,
flipped: crea.flipped,
team: this._targetTeam,
id: this.creature.id,
requireCreature: true,
Expand Down
4 changes: 2 additions & 2 deletions src/abilities/Bounty-Hunter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export default (G: Game) => {
},
team: this._targetTeam,
id: crea.id,
flipped: crea.player.flipped,
flipped: crea.flipped,
hexes: crea.adjacentHexes(1),
});
},
Expand Down Expand Up @@ -266,7 +266,7 @@ export default (G: Game) => {
team: this._targetTeam,
requireCreature: 1,
id: swine.id,
flipped: swine.player.flipped,
flipped: swine.flipped,
choices: choices,
});
},
Expand Down
7 changes: 4 additions & 3 deletions src/abilities/Chimera.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export default (G) => {
flipped: chimera.flipped,
hexes: G.grid.getHexMap(chimera.x - 3, chimera.y - 2, 0, false, matrices.frontnback3hex),
});
console.log('Chimera.Flipped:', chimera.flipped);
},

// activate() :
Expand Down Expand Up @@ -136,7 +137,7 @@ export default (G) => {
fnOnConfirm: function () {
ability.animation(...arguments);
},
flipped: chimera.player.flipped,
flipped: chimera.flipped,
team: this._targetTeam,
id: chimera.id,
requireCreature: true,
Expand Down Expand Up @@ -223,7 +224,7 @@ export default (G) => {

_getDirections: function () {
return this.testDirections({
flipped: this.creature.player.flipped,
flipped: this.creature.flipped,
team: this._targetTeam,
id: this.creature.id,
requireCreature: true,
Expand Down Expand Up @@ -262,7 +263,7 @@ export default (G) => {
fnOnConfirm: function () {
ability.animation(...arguments);
},
flipped: chimera.player.flipped,
flipped: chimera.flipped,
team: this._targetTeam,
id: chimera.id,
directions: this._getDirections(),
Expand Down
4 changes: 2 additions & 2 deletions src/abilities/Cyber-Wolf.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export default (G) => {
}, // fnOnConfirm
team: this._targetTeam,
id: crea.id,
flipped: crea.player.flipped,
flipped: crea.flipped,
hexes: crea.getHexMap(matrices.frontnback2hex),
});
},
Expand Down Expand Up @@ -342,7 +342,7 @@ export default (G) => {
}, // fnOnConfirm
team: Team.Enemy,
id: crea.id,
flipped: crea.player.flipped,
flipped: crea.flipped,
hexes: hexes,
});
},
Expand Down
6 changes: 3 additions & 3 deletions src/abilities/Dark-Priest.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export default (G) => {
},
team: this._targetTeam,
id: dpriest.id,
flipped: dpriest.player.flipped,
flipped: dpriest.flipped,
hexes: dpriest.adjacentHexes(this.isUpgraded() ? 4 : 1),
});
},
Expand Down Expand Up @@ -181,7 +181,7 @@ export default (G) => {
},
team: this._targetTeam,
id: dpriest.id,
flipped: dpriest.player.flipped,
flipped: dpriest.flipped,
hexes: dpriest.adjacentHexes(2),
});
},
Expand Down Expand Up @@ -314,7 +314,7 @@ export default (G) => {
cost: crea.size - 0 + (crea.level - 0),
}, // OptionalArgs
size: crea.size,
flipped: dpriest.player.flipped,
flipped: dpriest.flipped,
hexes: spawnRange,
});
},
Expand Down
2 changes: 1 addition & 1 deletion src/abilities/Golden-Wyrm.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ export default (G) => {
ability.animation(...arguments);
},
size: wyrm.size,
flipped: wyrm.player.flipped,
flipped: wyrm.flipped,
id: wyrm.id,
hexes: range,
});
Expand Down
4 changes: 2 additions & 2 deletions src/abilities/Gumble.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export default (G) => {
ability.animation(...arguments);
},
size: creature.size,
flipped: creature.player.flipped,
flipped: creature.flipped,
id: creature.id,
hexes: hexes,
ownCreatureHexShade: true,
Expand Down Expand Up @@ -286,7 +286,7 @@ export default (G) => {
fnOnConfirm: function () {
ability.animation(...arguments);
},
flipped: crea.player.flipped,
flipped: crea.flipped,
team: this._targetTeam,
id: this.creature.id,
requireCreature: true,
Expand Down
6 changes: 3 additions & 3 deletions src/abilities/Headless.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export default (G) => {
!this.testDirection({
team: this._targetTeam,
sourceCreature: headless,
flipped: headless.player.flipped,
flipped: headless.flipped,
directions: this._directions,
distance: this._getMaxDistance(),
minDistance: this.range.minimum,
Expand All @@ -251,7 +251,7 @@ export default (G) => {
team: this._targetTeam,
id: headless.id,
sourceCreature: headless,
flipped: headless.player.flipped,
flipped: headless.flipped,
x: headless.x,
y: headless.y,
directions: this._directions,
Expand Down Expand Up @@ -377,7 +377,7 @@ export default (G) => {
team: Team.Both,
requireCreature: 0,
id: crea.id,
flipped: crea.player.flipped,
flipped: crea.flipped,
choices: [crea.getHexMap(hexes), crea.getHexMap(hexes, true)],
});
},
Expand Down
3 changes: 2 additions & 1 deletion src/abilities/Impaler.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ export default (G) => {
query: function () {
const ability = this;
const creature = this.creature;

console.log('Creature.Flipped:', creature.flipped);
console.log('this.Creature.Flipped:', this.creature.flipped);
G.grid.queryCreature({
fnOnConfirm: function () {
ability.animation(...arguments);
Expand Down
6 changes: 3 additions & 3 deletions src/abilities/Infernal.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default (G) => {
activate: function () {
// Leave two traps behind
this._addTrap(this.creature.hexagons[1]);
this._addTrap(this.creature.hexagons[this.creature.player.flipped ? 0 : 2]);
this._addTrap(this.creature.hexagons[this.creature.flipped ? 0 : 2]);

// SFX
const music = G.Phaser.add.audio('MagmaSpawn0');
Expand Down Expand Up @@ -259,7 +259,7 @@ export default (G) => {
}

const magmaSpawn = this.creature;
const x = magmaSpawn.player.flipped ? magmaSpawn.x - magmaSpawn.size + 1 : magmaSpawn.x;
const x = magmaSpawn.flipped ? magmaSpawn.x - magmaSpawn.size + 1 : magmaSpawn.x;

if (
!this.testDirection({
Expand All @@ -278,7 +278,7 @@ export default (G) => {
const ability = this;
const magmaSpawn = this.creature;

const x = magmaSpawn.player.flipped ? magmaSpawn.x - magmaSpawn.size + 1 : magmaSpawn.x;
const x = magmaSpawn.flipped ? magmaSpawn.x - magmaSpawn.size + 1 : magmaSpawn.x;

G.grid.queryDirection({
fnOnConfirm: function () {
Expand Down
4 changes: 2 additions & 2 deletions src/abilities/Knightmare.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ export default (G) => {
}

const crea = this.creature;
const x = crea.player.flipped ? crea.x - crea.size + 1 : crea.x;
const x = crea.flipped ? crea.x - crea.size + 1 : crea.x;

if (
!this.testDirection({
Expand All @@ -260,7 +260,7 @@ export default (G) => {
const ability = this;
const crea = this.creature;

const x = crea.player.flipped ? crea.x - crea.size + 1 : crea.x;
const x = crea.flipped ? crea.x - crea.size + 1 : crea.x;

G.grid.queryDirection({
fnOnConfirm: function () {
Expand Down
4 changes: 3 additions & 1 deletion src/abilities/Nutcase.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ export default (G) => {
flipped: this.creature.flipped,
hexes: this.creature.getHexMap(matrices.frontnback2hex),
});
console.log('Nutcase.Flipped:', this.creature.flipped);
} else {
// If upgraded, show choice of front and back hex groups
const choices = [
Expand Down Expand Up @@ -387,7 +388,7 @@ export default (G) => {
G.grid.cleanReachable();

const isChargingBackwards =
(nutcase.player.flipped && args.direction === Direction.Right) ||
(nutcase.flipped && args.direction === Direction.Right) ||
args.direction === Direction.Left;

nutcase.moveTo(destination, {
Expand Down Expand Up @@ -587,6 +588,7 @@ export default (G) => {
return ability.isUpgraded() ? true : creature.size <= 2;
},
});

},

// activate() :
Expand Down
2 changes: 1 addition & 1 deletion src/abilities/Scavenger.js
Original file line number Diff line number Diff line change
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.flipped,
hexes: G.grid
.getFlyingRange(x, crea.y, distance, size, [crea.id, trg.id])
.filter(function (item) {
Expand Down
Loading

0 comments on commit 6c7c7b7

Please sign in to comment.