Compare commits
	
		
			2 Commits
		
	
	
		
			c6249b1b9b
			...
			6d92cb4deb
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						
						
							
						
						6d92cb4deb
	
				 | 
					
					
						|||
| 
						
						
							
						
						32e142b8cb
	
				 | 
					
					
						
							
								
								
									
										8
									
								
								calc.js
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								calc.js
									
									
									
									
									
								
							@@ -8,6 +8,8 @@ import calc, {
 | 
			
		||||
import assert from "assert";
 | 
			
		||||
import chev, { Lexer } from "chevrotain";
 | 
			
		||||
 | 
			
		||||
const gen = Generations.get(9);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Creates a lexer.
 | 
			
		||||
 *
 | 
			
		||||
@@ -266,7 +268,11 @@ function parseAndCalculate(line) {
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  const gen = Generations.get(8);
 | 
			
		||||
  // Pre-checking before the calculator throws unreadable errors.
 | 
			
		||||
  if (!gen.species.get(attacker)) throw Error(`No species ${attacker}`);
 | 
			
		||||
  if (!gen.species.get(defender)) throw Error(`No species ${attacker}`);
 | 
			
		||||
  if (!gen.moves.get(move)) throw Error(`No move ${move}`);
 | 
			
		||||
 | 
			
		||||
  return calculate(
 | 
			
		||||
    gen,
 | 
			
		||||
    new Pokemon(gen, attacker, attackerOpts),
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user