Chooser AI

This commit is contained in:
zenoamaro committed 2019-06-30 16:37:29 +02:00
1 parent fb94f90326
commit f98bba041f
2 files changed
+28 -14

No files matched your search

+15 -3
View File
@@ -4,11 +4,23 @@ import {randomInt} from './math.js';
export const AI_TYPES = {
moron: {
decide() {
decide(player) {
return {
a: randomInt(0, 180),
p: randomInt(PLAYER_INITIAL_POWER, PLAYER_MAX_ENERGY*PLAYER_ENERGY_POWER_MULTIPLIER)}
}
p: randomInt(PLAYER_INITIAL_POWER, PLAYER_MAX_ENERGY*PLAYER_ENERGY_POWER_MULTIPLIER),
currentWeapon: player.currentWeapon,
};
},
},
chooser: {
decide(player) {
return {
a: randomInt(0, 180),
p: randomInt(PLAYER_INITIAL_POWER, PLAYER_MAX_ENERGY*PLAYER_ENERGY_POWER_MULTIPLIER),
currentWeapon: randomInt(0, player.weapons.length-1),
};
},
},
};