Skip to content

Commit 57164a7

Browse files
committed
Do stuff
1 parent e652132 commit 57164a7

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

game.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,7 @@
829829
currentActor: null,
830830
turnEndTime: null,
831831
turnTimeout: 10000,
832-
battleOver: false,
832+
over: false,
833833
startTime: Date.now()
834834
};
835835

@@ -1128,7 +1128,7 @@
11281128
lastTime = ts;
11291129
update(dt);
11301130
draw();
1131-
if (!state.battle || state.battle.battleOver) { stopBattle(); return; }
1131+
if (!state.battle || state.battle.over) { stopBattle(); return; }
11321132
rafId = requestAnimationFrame(loop);
11331133
}
11341134

@@ -1524,7 +1524,7 @@
15241524
return;
15251525
}
15261526

1527-
const delay = 800 + Math.random() * 1000;
1527+
const delay = 500 + Math.random() * 1000;
15281528
opponent.aiTimer = Date.now() + delay;
15291529

15301530
setTimeout(() => {
@@ -1542,8 +1542,8 @@
15421542
if (safe) moveTowards(opponent, safe.x, safe.y);
15431543
}
15441544

1545-
const candidates = Object.keys(SKILLS).filter(k => (battleOppSkills[k] && battleOppSkills[k] !== 0) || battleOppSkills[k] === Infinity);
1546-
const tacticCandidates = Object.keys(TACTICS).filter(k => (battleOppTactics[k] && battleOppTactics[k] > 0));
1545+
const candidates = Object.keys(SKILLS).filter(k => battleOppSkills[k] > 0 || battleOppSkills[k] === Infinity);
1546+
const tacticCandidates = Object.keys(TACTICS).filter(k => battleOppTactics[k] > 0);
15471547

15481548
// try to find instant finisher
15491549
for (const k of candidates) {
@@ -1724,9 +1724,9 @@
17241724
}
17251725

17261726
async function finalizeEndBattle(playerWon, message) {
1727-
if (state.battle?.battleOver) return;
1727+
if (state.battle?.over) return;
17281728
const battle = state.battle;
1729-
state.battle.battleOver = true;
1729+
state.battle.over = true;
17301730
stopBattle();
17311731

17321732
let awarded = Math.floor(opponentStrength * 15) + (currentLevel === 'normal' ? 2 : 12);

0 commit comments

Comments
 (0)