Bayesian statistics

blocks drift towards the center of pilot wave's field

mod: Bayesian statistics - no longer stops ammo spawns
  30% to double power ups, but ejects a mod when you take damage

mod: exciton-lattice - 40% damage, but no ammo can spawn
This commit is contained in:
landgreen
2020-09-08 17:38:44 -07:00
parent e3d8dda23f
commit 8ce7f684c8
11 changed files with 135 additions and 107 deletions

View File

@@ -148,13 +148,13 @@ function collisionChecks(event) {
dmg *= 0.85
}
mech.damage(dmg);
if (mod.isEjectMod) {
if (mod.isBayesian) {
const have = [] //find which mods you have
for (let i = 0; i < mod.mods.length; i++) {
if (mod.mods[i].count > 0) have.push(i)
}
const choose = have[Math.floor(Math.random() * have.length)]
game.makeTextLog(`<div class='circle mod'></div> &nbsp; <strong>${mod.mods[choose].name}</strong> ejected by exciton-lattice`, 300) //message about what mod was lost
game.makeTextLog(`<div class='circle mod'></div> &nbsp; <strong>${mod.mods[choose].name}</strong> ejected by Bayesian statistics`, 300) //message about what mod was lost
for (let i = 0; i < mod.mods[choose].count; i++) powerUps.spawn(mech.pos.x, mech.pos.y, "mod");
mod.mods[choose].count = 0;
mod.mods[choose].remove(); // remove a random mod form the list of mods you have