File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 829829 currentActor : null ,
830830 turnEndTime : null ,
831831 turnTimeout : 10000 ,
832- battleOver : false ,
832+ over : false ,
833833 startTime : Date . now ( )
834834 } ;
835835
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
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 ( ( ) => {
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 ) {
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 ) ;
You can’t perform that action at this time.
0 commit comments