Skip to content

Commit

Permalink
Update game.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
Luffy117 authored Dec 9, 2024
1 parent 489c46e commit 6fab35f
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions src/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ export default class Game {
setupOpt: Partial<GameConfig>,
matchInitialized?: boolean,
matchid?: number,
onLoadCompleteFn = () => {},
onLoadCompleteFn = () => { },
) {
// Need to remove keydown listener before new game start
// to prevent memory leak and mixing hotkeys between start screen and game
Expand Down Expand Up @@ -902,7 +902,7 @@ export default class Game {

o = $j.extend(
{
callback: function () {},
callback: function () { },
noTooltip: false,
tooltip: 'Skipped',
},
Expand Down Expand Up @@ -963,7 +963,7 @@ export default class Game {

o = $j.extend(
{
callback: function () {},
callback: function () { },
},
o,
);
Expand Down Expand Up @@ -1260,10 +1260,9 @@ export default class Game {
onStartPhase(/* creature, callback */) {
const creature = arguments[0],
totalTraps = this.traps.length;
if (creature.abilities.some(ability => ability.name === 'Bonfire Spring')) {
creature.accumulatedTeleportRange += 1;
}

if (creature.abilities.some(ability => ability.title === 'Bonfire Spring')) {
creature.accumulatedTeleportRange += 1;
}
let trap: Trap;

for (let i = 0; i < totalTraps; i++) {
Expand Down Expand Up @@ -1506,7 +1505,7 @@ export default class Game {

action(o, opt) {
const defaultOpt = {
callback: function () {},
callback: function () { },
};

opt = $j.extend(defaultOpt, opt);
Expand Down Expand Up @@ -1536,10 +1535,9 @@ export default class Game {
case 'ability': {
const args = $j.makeArray(o.args[1]);
const ability = this.activeCreature.abilities[o.id];

if (ability.title === 'Bonfire Spring') {
this.activeCreature.accumulatedTeleportRange = 0;
}
this.activeCreature.accumulatedTeleportRange = 0;
}

if (o.target.type == 'hex') {
args.unshift(this.grid.hexes[o.target.y][o.target.x]);
Expand Down

0 comments on commit 6fab35f

Please sign in to comment.