worm hole mods

mod: critical bifurcation - nail gun does 400% more damage if it hits very close to the center of a mob
mod: supercritical fission - flechettes explode if they hit very close to the center of a mob

mod: transdimensional spores - after wormholes eat blocks, they disturb spores
mod: traversable geodesics - your bullets can go through worm holes

scrap bots now only last only 30 seconds, but they have a 20% chance to spawn from a kill (was 11%)
the difficulty should feel a bit harder after clearing the boss level
  (a bit more more damage taken, and fewer mod drops)
This commit is contained in:
landgreen
2020-10-20 17:23:47 -07:00
parent fb13945879
commit 0c2285b1c7
8 changed files with 221 additions and 142 deletions

View File

@@ -461,8 +461,8 @@ const powerUps = {
},
randomPowerUpCounter: 0,
spawnBossPowerUp(x, y) { //boss spawns field and gun mod upgrades
// if (game.difficultyMode === 4) powerUps.spawn(x, y, "mod") //why mode gets a free mod
powerUps.randomPowerUpCounter++;
if (game.difficultyMode === 4) powerUps.spawn(x, y, "mod") //why mode gets a free mod
const chanceToFail = Math.max(level.levelsCleared, 10) * 0.1 //1 until level 10, then 1.1, 1.2, 1.3, ...
if (Math.random() * chanceToFail < powerUps.randomPowerUpCounter) {
powerUps.randomPowerUpCounter = 0;
@@ -470,6 +470,16 @@ const powerUps = {
} else {
spawnHealthAmmo()
}
if (game.difficultyMode === 4) {
powerUps.randomPowerUpCounter++;
const chanceToFail = Math.max(level.levelsCleared, 10) * 0.1 //1 until level 10, then 1.1, 1.2, 1.3, ...
if (Math.random() * chanceToFail < powerUps.randomPowerUpCounter) {
powerUps.randomPowerUpCounter = 0;
spawnPowerUps()
} else {
spawnHealthAmmo()
}
}
function spawnHealthAmmo() {
if (mech.health < 0.65 && !mod.isEnergyHealth) {
@@ -511,7 +521,7 @@ const powerUps = {
//bonus power ups for clearing runs in the last game
if (level.levelsCleared === 0 && !game.isCheating) {
for (let i = 0; i < localSettings.levelsClearedLastGame / 4 - 1; i++) {
powerUps.spawn(mech.pos.x, mech.pos.y, "mod", false); //spawn a mod for every 5 levels cleared in last game
powerUps.spawn(mech.pos.x, mech.pos.y, "mod", false); //spawn a mod for levels cleared in last game
}
localSettings.levelsClearedLastGame = 0 //after getting bonus power ups reset run history
localStorage.setItem("localSettings", JSON.stringify(localSettings)); //update local storage