Skip to content

Commit

Permalink
One check
Browse files Browse the repository at this point in the history
  • Loading branch information
Joywin2412 committed Aug 9, 2024
1 parent 1e733af commit 09f7db7
Showing 1 changed file with 40 additions and 40 deletions.
80 changes: 40 additions & 40 deletions src/creature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -635,54 +635,54 @@ export class Creature {
}

const defaultOptions = {
targeting: false,
noPath: false,
isAbility: false,
ownCreatureHexShade: true,
range: game.grid.getMovementRange(this.x, this.y, remainingMove, this.size, this.id),
callback: function (hex: Hex, args) {
if (hex.x == args.creature.x && hex.y == args.creature.y) {
// Prevent null movement
game.activeCreature.queryMove();
return;
}
targeting: false,
noPath: false,
isAbility: false,
ownCreatureHexShade: true,
range: game.grid.getMovementRange(this.x, this.y, remainingMove, this.size, this.id),
callback: function (hex: Hex, args) {
if (hex.x == args.creature.x && hex.y == args.creature.y) {
// Prevent null movement
game.activeCreature.queryMove();
return;
}

if (game.grid.materialize_overlay) {
const creature = game.retrieveCreatureStats(game.activeCreature.type);
game.Phaser.add
.tween(game.grid.materialize_overlay)
.to(
{
alpha: 0,
},
creature.animation.walk_speed,
Phaser.Easing.Linear.None,
)
.start();
}
if (game.grid.materialize_overlay) {
const creature = game.retrieveCreatureStats(game.activeCreature.type);
game.Phaser.add
.tween(game.grid.materialize_overlay)
.to(
{
alpha: 0,
},
creature.animation.walk_speed,
Phaser.Easing.Linear.None,
)
.start();
}

game.gamelog.add({
action: 'move',
target: {
x: hex.x,
y: hex.y,
},
});
if (game.multiplayer) {
game.gameplay.moveTo({
game.gamelog.add({
action: 'move',
target: {
x: hex.x,
y: hex.y,
},
});
if (game.multiplayer) {
game.gameplay.moveTo({
target: {
x: hex.x,
y: hex.y,
},
});
}
game.UI.btnDelay.changeState('disabled');
args.creature.moveTo(hex, {
animation: args.creature.movementType() === 'flying' ? 'fly' : 'walk',
callback: function () {
game.activeCreature.queryMove();
},
});
game.UI.btnDelay.changeState('disabled');
args.creature.moveTo(hex, {
animation: args.creature.movementType() === 'flying' ? 'fly' : 'walk',
callback: function () {
game.activeCreature.queryMove();
},
});
},
},
// overwrite any fields of `defaultOptions` that were provided in `options`
Expand Down

0 comments on commit 09f7db7

Please sign in to comment.