diff --git a/js/bullets.js b/js/bullets.js index d88ab5a..7a809f2 100644 --- a/js/bullets.js +++ b/js/bullets.js @@ -276,7 +276,7 @@ const b = { maxCount: 4, count: 0, effect() { - b.modEnergySiphon += 0.18; + b.modEnergySiphon += 0.15; mech.fieldMeter = mech.fieldEnergyMax } }, @@ -328,6 +328,15 @@ const b = { mech.fieldMeter = mech.fieldEnergyMax } }, + { + name: "quantum immortality", //28 + description: "after dying, continue in an alternate reality
guns, ammo, field, and mods are randomized", + maxCount: 1, + count: 0, + effect() { + b.isModImmortal = true; + } + }, { name: "+1 cardinality", //24 description: "one extra choice when selecting power ups", @@ -359,15 +368,6 @@ const b = { //have state is checked in mech.death() } }, - { - name: "quantum immortality", //28 - description: "after dying, continue in an alternate reality
guns, ammo, field, and mods are randomized", - maxCount: 1, - count: 0, - effect() { - b.isModImmortal = true; - } - }, ], giveMod(index = 'random') { if (index === 'random') { diff --git a/js/index.js b/js/index.js index 76d7220..6ae3026 100644 --- a/js/index.js +++ b/js/index.js @@ -2,12 +2,15 @@ /* TODO: ******************************************* ***************************************************** +show difficulty increase text in custom mode + +chart showing info about each mob type + can use css-grid chart like custom mod + add setting for random drops instead of choosing -rework custom mode +custom mode custom mode grey out mods that are bad, like selection based mods - enable recursive mods - remove 5 mod cap on custom mode change nail-bot's movement maybe have it move in a circle around player? @@ -158,12 +161,14 @@ const build = { list: [], choosePowerUp(who, index, type) { if (type === "field" || type === "gun") { + let isDeselect = false //if already click, toggle off for (let i = 0; i < build.list.length; i++) { if (build.list[i].index === index && build.list[i].type === type) { build.list.splice(i, 1); who.style.backgroundColor = "#fff" - return + isDeselect = true + break } } //check if trying to get a second field @@ -175,11 +180,13 @@ const build = { } } } - who.style.backgroundColor = "#919ba8" //"#868f9a" - build.list[build.list.length] = { - who: who, - index: index, - type: type, + if (!isDeselect) { + who.style.backgroundColor = "#919ba8" //"#868f9a" + build.list[build.list.length] = { + who: who, + index: index, + type: type, + } } } else if (type === "mod") { if (who.style.backgroundColor !== "#919ba8") who.style.backgroundColor = "#919ba8" //"#868f9a" @@ -212,6 +219,8 @@ const build = { who.innerHTML = `
  ${b.mods[index].name}
${b.mods[index].description}` } } + document.title = `effective starting level: ${build.list.length * game.difficultyMode}` + // document.getElementById("starting-level").innerHTML = `effective starting level: ${build.list.length * game.difficultyMode}` }, removeMod(index) { for (let i = build.list.length - 1; i > -1; i--) { @@ -256,7 +265,7 @@ document.getElementById("build-button").addEventListener("click", () => { -
+
each power up you select will increase the starting level by one
` for (let i = 1, len = mech.fieldUpgrades.length; i < len; i++) { @@ -266,7 +275,11 @@ document.getElementById("build-button").addEventListener("click", () => { text += `
  ${b.guns[i].name}
${b.guns[i].description}
` } for (let i = 0, len = b.mods.length; i < len; i++) { - text += `
  ${b.mods[i].name}
${b.mods[i].description}
` + if (b.mods[i].name === "Born rule" || b.mods[i].name === "Bayesian inference" || b.mods[i].name === "+1 cardinality") { + text += `
  ${b.mods[i].name}
${b.mods[i].description}
` + } else { + text += `
  ${b.mods[i].name}
${b.mods[i].description}
` + } } el.innerHTML = text el.style.display = "grid" diff --git a/js/spawn.js b/js/spawn.js index 65d5ede..4c89d2c 100644 --- a/js/spawn.js +++ b/js/spawn.js @@ -940,7 +940,7 @@ const spawn = { me.leaveBody = false; // me.dropPowerUp = false; me.onDeath = function () { //run this function on death - for (let i = 0; i < Math.ceil(this.mass * 0.2 + Math.random() * 3); ++i) { + for (let i = 0; i < Math.ceil(this.mass * 0.15 + Math.random() * 2.5); ++i) { spawn.spawns(this.position.x + (Math.random() - 0.5) * radius * 2.5, this.position.y + (Math.random() - 0.5) * radius * 2.5); Matter.Body.setVelocity(mob[mob.length - 1], { x: this.velocity.x + (Math.random() - 0.5) * 15,