27 lines
641 B
JavaScript
27 lines
641 B
JavaScript
import {PLAYER_MAX_ENERGY, PLAYER_INITIAL_POWER, PLAYER_ENERGY_POWER_MULTIPLIER} from './constants.js?v=5';
|
|
import {randomInt} from './math.js?v=5';
|
|
|
|
export const AI_TYPES = {
|
|
|
|
moron: {
|
|
decide(player) {
|
|
return {
|
|
a: randomInt(0, 180),
|
|
p: randomInt(225, PLAYER_MAX_ENERGY*PLAYER_ENERGY_POWER_MULTIPLIER),
|
|
currentWeapon: player.currentWeapon,
|
|
};
|
|
},
|
|
},
|
|
|
|
chooser: {
|
|
decide(player) {
|
|
return {
|
|
a: randomInt(0, 180),
|
|
p: randomInt(225, PLAYER_MAX_ENERGY*PLAYER_ENERGY_POWER_MULTIPLIER),
|
|
currentWeapon: randomInt(0, player.weapons.length-1),
|
|
};
|
|
},
|
|
},
|
|
|
|
};
|