Skip to content
Draft
Show file tree
Hide file tree
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
48 changes: 44 additions & 4 deletions src/abilities/Abolished.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,28 @@ export default (G) => {
return true;
},

query() {
query(isPreview = false) {
const ability = this;
const abolished = this.creature;

// TODO: Visually show reduced damage hexes for 4-6 range

const forwardHexes = G.grid.getHexLine(
abolished.x,
abolished.y,
abolished.facing,
this.range.regular // Distance: 3 hexes straight ahead
);

if (isPreview) {
G.grid.queryHexes({
hexes: forwardHexes,
hideNonTarget: true,
id: abolished.id,
size: abolished.size,
flipped: abolished.player.flipped,
});
return;
}
G.grid.queryDirection({
fnOnConfirm: function () {
ability.animation(...arguments);
Expand Down Expand Up @@ -216,14 +232,27 @@ export default (G) => {
return this.testRequirements();
},

query() {
query(isPreview = false) {
const ability = this;
const crea = this.creature;
let totalRange = this.range;
if (this.isUpgraded()) {
totalRange = this.range + this.creature.accumulatedTeleportRange - 1;
}

const range = G.grid.getFlyingRange(crea.x, crea.y, totalRange, crea.size, crea.id);

if (isPreview) {
G.grid.queryHexes({
hexes: range,
hideNonTarget: true,
id: crea.id,
size: crea.size,
flipped: crea.player.flipped,
});
return;
}

// Relocates to any hex within range except for the current hex
crea.queryMove({
noPath: true,
Expand Down Expand Up @@ -319,14 +348,25 @@ export default (G) => {
require() {
return this.testRequirements();
},
query() {
query(isPreview = false) {
const ability = this;
const crea = this.creature;

// var inRangeCreatures = crea.hexagons[1].adjacentHex(1);

const range = crea.adjacentHexes(1);

if (isPreview) {
G.grid.queryHexes({
hexes: range,
hideNonTarget: true,
id: crea.id,
size: crea.size,
flipped: crea.player.flipped,
});
return;
}

G.grid.queryHexes({
fnOnConfirm: function () {
ability.animation(...arguments);
Expand Down
33 changes: 29 additions & 4 deletions src/abilities/Asher.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ export default (G) => {
},

// query() :
query: function () {
query: function (isPreview = false) {
if (isPreview) return;
const ability = this;
const crea = this.creature;

Expand Down Expand Up @@ -129,9 +130,22 @@ export default (G) => {
},

// query() :
query: function () {
query: function (isPreview = false) {
const ability = this;
const crea = this.creature;

const hexRange = G.grid.getFlyingRange(crea.x, crea.y, 50, crea.size, crea.id);

if (isPreview) {
G.grid.queryHexes({
hexes: hexRange,
hideNonTarget: true,
id: crea.id,
flipped: crea.player.flipped,
size: crea.size,
});
return;
}

crea.queryMove({
noPath: true,
Expand Down Expand Up @@ -233,7 +247,7 @@ export default (G) => {
},

// query() :
query: function () {
query: function (isPreview = false) {
const ability = this;
const crea = this.creature;

Expand All @@ -243,7 +257,18 @@ export default (G) => {
const tail = range.indexOf(crea.hexagons[2]);
range.splice(head, 1);
range.splice(tail, 1);


if (isPreview) {
G.grid.queryHexes({
hexes: range,
hideNonTarget: true,
id: crea.id,
flipped: crea.player.flipped,
size: crea.size,
});
return;
}

G.grid.queryHexes({
fnOnConfirm: function () {
ability.animation(...arguments);
Expand Down
27 changes: 24 additions & 3 deletions src/abilities/Bounty-Hunter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ export default (G: Game) => {
},

//query():
query: function () {
query: function (isPreview = false) {
if (isPreview) return;
const ability = this;
const crea = this.creature;

Expand Down Expand Up @@ -236,7 +237,7 @@ export default (G: Game) => {
},

// query() :
query: function () {
query: function (isPreview = false) {
const bellowrow = matrices.bellowrow;
const straitrow = matrices.straitrow;

Expand All @@ -258,6 +259,18 @@ export default (G: Game) => {
arrayUtils.filterCreature(choice, true, true, swine.id);
});

if (isPreview) {
G.grid.queryChoice({
choices: choices,
id: swine.id,
hideNonTarget: true,
flipped: swine.player.flipped,
team: this._targetTeam,
requireCreature: 1,
});
return;
}

G.grid.queryChoice({
fnOnConfirm: function () {
// eslint-disable-next-line
Expand Down Expand Up @@ -337,7 +350,7 @@ export default (G: Game) => {
},

// query() :
query: function () {
query: function (isPreview = false) {
const ability = this;
const swine = this.creature;

Expand All @@ -351,6 +364,14 @@ export default (G: Game) => {
}
hexes.push(G.grid.hexes[swine.y][swine.x]);

if (isPreview) {
G.grid.queryHexes({
hexes: hexes,
hideNonTarget: true,
});
return;
}

G.grid.queryHexes({
fnOnCancel: function () {
G.activeCreature.queryMove();
Expand Down
27 changes: 24 additions & 3 deletions src/abilities/Chimera.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ export default (G) => {
},

// query() :
query: function () {
query: function (isPreview = false) {
if (isPreview) return;
const ability = this;
const chimera = this.creature;

Expand Down Expand Up @@ -128,10 +129,29 @@ export default (G) => {
},

// query() :
query: function () {
query: function (isPreview = false) {
const ability = this;
const chimera = this.creature;

if (isPreview) {

let forward = G.grid.getHexMap(chimera.x, chimera.y, 0, false, matrices.straitrow);
let backward = G.grid.getHexMap(chimera.x, chimera.y, 0, true, matrices.straitrow);
const hexes = forward.concat(backward).sort(function (a, b) {
return a.x - b.x;
});

G.grid.queryHexes({
hexes: hexes,
id: chimera.id,
size: chimera.size,
flipped: chimera.player.flipped,
hideNonTarget: true,
});
return;

}

G.grid.queryDirection({
fnOnConfirm: function () {
ability.animation(...arguments);
Expand Down Expand Up @@ -254,7 +274,8 @@ export default (G) => {
},

// query() :
query: function () {
query: function (isPreview = false) {
if (isPreview) return;
const ability = this;
const chimera = this.creature;

Expand Down
30 changes: 27 additions & 3 deletions src/abilities/Cyber-Wolf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ export default (G: Game) => {
},

// query() :
query: function () {
query: function (isPreview = false) {
if(isPreview){return;}
const ability = this;
const crea = this.creature;

Expand Down Expand Up @@ -154,12 +155,33 @@ export default (G: Game) => {
},

// query() :
query: function () {
query: function (isPreview = false) {
const ability = this;
const crea = this.creature;

const straitrow = matrices.straitrow;
const bellowrow = matrices.bellowrow;

const hexes = []
.concat(
G.grid.getHexMap(crea.x, crea.y - 2, 0, false, bellowrow),
G.grid.getHexMap(crea.x, crea.y, 0, false, straitrow),
G.grid.getHexMap(crea.x, crea.y, 0, false, bellowrow),
G.grid.getHexMap(crea.x - 1, crea.y - 2, 0, true, bellowrow),
G.grid.getHexMap(crea.x - 1, crea.y, 0, true, straitrow),
G.grid.getHexMap(crea.x - 1, crea.y, 0, true, bellowrow)
);

if (isPreview) {
G.grid.queryHexes({
hexes: hexes,
id: crea.id,
size: crea.size,
flipped: crea.player.flipped,
hideNonTarget: true,
});
return;
}

const choices = [
//Front
Expand Down Expand Up @@ -207,6 +229,7 @@ export default (G: Game) => {
),
),
];


G.grid.queryChoice({
fnOnCancel: function () {
Expand Down Expand Up @@ -327,7 +350,8 @@ export default (G: Game) => {
},

// query() :
query: function () {
query: function (isPreview = false) {
if(isPreview){return;}
const ability = this;
const crea = this.creature;

Expand Down
9 changes: 6 additions & 3 deletions src/abilities/Dark-Priest.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ export default (G) => {
},

// query() :
query: function () {
query: function (isPreview = false) {
if (isPreview) {return;}
const ability = this;
const dpriest = this.creature;

Expand Down Expand Up @@ -168,7 +169,8 @@ export default (G) => {
},

// query() :
query: function () {
query: function (isPreview = false) {
if (isPreview) {return;}
const ability = this;
const dpriest = this.creature;

Expand Down Expand Up @@ -242,7 +244,8 @@ export default (G) => {
summonRange: 4,

// query() :
query: function () {
query: function (isPreview = false) {
if (isPreview) {return;}
if (this.isUpgraded()) {
this.summonRange = 6;
}
Expand Down
19 changes: 16 additions & 3 deletions src/abilities/Golden-Wyrm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ export default (G: Game) => {
return true;
},

query: function () {
query: function (isPreview = false) {
if (isPreview) {return;}
const wyrm = this.creature;
const ability = this;

Expand Down Expand Up @@ -213,11 +214,22 @@ export default (G: Game) => {
return true;
},

query: function () {
query: function (isPreview = false) {
if (isPreview) {return;}
const ability = this;
const wyrm = this.creature;

const range = this.game.grid.getFlyingRange(wyrm.x, wyrm.y, 10, wyrm.size, wyrm.id);
if (isPreview) {
G.grid.queryHexes({
hexes: range,
size: wyrm.size,
flipped: wyrm.player.flipped,
id: wyrm.id,
hideNonTarget: true,
});
return;
}

this.game.grid.queryHexes({
fnOnSelect: function () {
Expand Down Expand Up @@ -342,7 +354,8 @@ export default (G: Game) => {
return true;
},

query: function () {
query: function (isPreview = false) {
if (isPreview) {return;}
const ability = this;
const wyrm = this.creature;

Expand Down
Loading