Skip to content
Closed
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
27 changes: 13 additions & 14 deletions src/abilities/Gumble.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,20 @@ export default (G: Game) => {
G.abilities[14] = [
// First Ability: Gooey Body
{
// Trigger when Gumble dies
/**
* When upgraded, allows Gumble to leap over units during movement phase
* (flying movement type).
*/
movementType: function () {
return this.isUpgraded() ? 'flying' : 'normal';
},

// Trigger when Gumble dies (only when not upgraded)
trigger: 'onCreatureDeath',

require: function () {
return true;
// Only trigger on death when NOT upgraded (upgraded version provides leap ability instead)
return !this.isUpgraded();
},

activate: function (deadCreature: Creature) {
Expand All @@ -39,20 +48,10 @@ export default (G: Game) => {
deathHex,
'onStepIn',
{
// Check if creature should be affected by the goo
// Always affect all units (allies and enemies)
requireFn: function () {
const creatureOnGoo = this.trap.hex.creature;
if (!creatureOnGoo) {
return false;
}

// If upgraded, don't affect allied units
if (ability.isUpgraded()) {
return creatureOnGoo.player !== ability.creature.player;
}

// Otherwise affect all units
return true;
return !!creatureOnGoo;
},
effectFn: function (_, creature: Creature) {
// Pin the creature in place for the current round
Expand Down
4 changes: 4 additions & 0 deletions src/utility/hex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,10 @@ export class Hex {
this.grid.displayHexesGroup.bringToTop(this.display);
} else {
this.display.loadTexture('hex_dashed');
// When showGrid is active on empty hexes, show dashed at 25% opacity
if (this.displayClasses.match(/showGrid/g)) {
this.display.alpha = 0.25;
}
}
} else if (this.displayClasses.match(/deadzone/)) {
this.display.loadTexture('hex_deadzone');
Expand Down
9 changes: 5 additions & 4 deletions src/utility/hexgrid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1456,18 +1456,19 @@ export class HexGrid {

showGrid(val) {
this.forEachHex((hex) => {
if (hex.creature) {
hex.creature.xray(val);
}

if (hex.drop) {
return;
}

if (val) {
hex.displayVisualState('showGrid');
// Show dashed grid (not x-ray) for empty hexes so coordinates are visible on top of units
if (!hex.creature) {
hex.displayVisualState('dashed');
}
} else {
hex.cleanDisplayVisualState('showGrid');
hex.cleanDisplayVisualState('dashed');
}
});
}
Expand Down
Loading