diff --git a/.DS_Store b/.DS_Store index 8a002ec..51d2d37 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/js/bullet.js b/js/bullet.js index b38856c..7bd9a00 100644 --- a/js/bullet.js +++ b/js/bullet.js @@ -22,9 +22,11 @@ const b = { } } else { if (mod.isAmmoFromHealth) { - if (mech.health > 2 * mod.isAmmoFromHealth * mech.maxHealth) { - mech.damage(mod.isAmmoFromHealth * mech.maxHealth / mech.harmReduction()); - if (!(mod.isRewindAvoidDeath && mech.energy > 0.66)) powerUps.spawn(mech.pos.x, mech.pos.y, "ammo"); //don't give ammo if CPT triggered + if (mech.health > 0.05) { + mech.damage(0.05 / mech.harmReduction()); // /mech.harmReduction() undoes damage increase from difficulty + if (!(mod.isRewindAvoidDeath && mech.energy > 0.66)) { //don't give ammo if CPT triggered + for (let i = 0; i < 3; i++) powerUps.spawn(mech.pos.x, mech.pos.y, "ammo"); + } } else { game.replaceTextLog = true; game.makeTextLog("not enough health for catabolism to produce ammo", 120); @@ -35,9 +37,7 @@ const b = { } mech.fireCDcycle = mech.cycle + 30; //fire cooldown } - if (mech.holdingTarget) { - mech.drop(); - } + if (mech.holdingTarget) mech.drop(); } }, removeAllGuns() { @@ -307,7 +307,7 @@ const b = { const me = bullet.length; bullet[me] = Bodies.circle(where.x, where.y, 15, b.fireAttributes(angle, false)); Matter.Body.setDensity(bullet[me], 0.0005); - bullet[me].explodeRad = 275; + bullet[me].explodeRad = 300; bullet[me].onEnd = function() { b.explosion(this.position, this.explodeRad); //makes bullet do explosive damage at end if (mod.fragments) b.targetedNail(this.position, mod.fragments * 5) @@ -316,7 +316,7 @@ const b = { bullet[me].beforeDmg = function() { this.endCycle = 0; //bullet ends cycle after doing damage //this also triggers explosion }; - speed = mech.crouch ? 43 : 32 + speed = mech.crouch ? 46 : 32 Matter.Body.setVelocity(bullet[me], { x: mech.Vx / 2 + speed * Math.cos(angle), y: mech.Vy / 2 + speed * Math.sin(angle) @@ -681,19 +681,21 @@ const b = { lastAngle: 0, wasExtruderOn: false, isExtruderOn: false, + didExtruderDrain: false, + canExtruderFire: true, extruder() { const DRAIN = 0.0007 + mech.fieldRegen - if (mech.energy > DRAIN) { + if (mech.energy > DRAIN && b.canExtruderFire) { mech.energy -= DRAIN if (mech.energy < 0) { mech.fieldCDcycle = mech.cycle + 120; mech.energy = 0; } - mech.isExtruderOn = true + b.isExtruderOn = true const SPEED = 10 const me = bullet.length; const where = Vector.add(mech.pos, player.velocity) - bullet[me] = Bodies.polygon(where.x + 20 * Math.cos(mech.angle), where.y + 20 * Math.sin(mech.angle), 3, 0.01, { + bullet[me] = Bodies.polygon(where.x + 20 * Math.cos(mech.angle), where.y + 20 * Math.sin(mech.angle), 4, 0.01, { cycle: -0.5, isWave: true, endCycle: game.cycle + 10 + 40 * mod.isPlasmaRange, @@ -755,7 +757,9 @@ const b = { const transverse = Vector.normalise(Vector.perp(bullet[me].velocity)) if (180 - Math.abs(Math.abs(b.lastAngle - mech.angle) - 180) > 0.3) bullet[me].isBranch = true; //don't draw stroke for this bullet b.lastAngle = mech.angle //track last angle for the above angle difference calculation - if (!mech.wasExtruderOn) bullet[me].isBranch = true; + if (!b.wasExtruderOn) bullet[me].isBranch = true; + } else { + b.canExtruderFire = false; } }, plasma() { @@ -1336,7 +1340,7 @@ const b = { const THRUST = 0.004 const dir = mech.angle + spread * (Math.random() - 0.5); const RADIUS = 18 - bullet[me] = Bodies.polygon(mech.pos.x + 30 * Math.cos(mech.angle), mech.pos.y + 30 * Math.sin(mech.angle), 4, RADIUS, { + bullet[me] = Bodies.polygon(mech.pos.x + 30 * Math.cos(mech.angle), mech.pos.y + 30 * Math.sin(mech.angle), 3, RADIUS, { angle: dir - Math.PI, inertia: Infinity, friction: 0, diff --git a/js/game.js b/js/game.js index 1fd5551..d9b7938 100644 --- a/js/game.js +++ b/js/game.js @@ -595,6 +595,9 @@ const game = { } } + if (mod.isEndLevelPowerUp) { + for (let i = 0; i < powerUp.length; i++) powerUp[i].effect(); + } powerUps.totalPowerUps = powerUp.length let holdTarget; //if player is holding something this remembers it before it gets deleted @@ -752,8 +755,31 @@ const game = { //check for double crouch //crouch playerHead.position.y - player.position.y = 9.7 //positive //standing playerHead.position.y - player.position.y = -30 //negative + // mech.undoCrouch() if (!mech.crouch && ((playerHead.position.y - player.position.y) > 0)) { - // mech.undoCrouch() + Matter.Body.translate(playerHead, { + x: 0, + y: 40 + }); + if ((playerHead.position.y - player.position.y) > 0) { + Matter.Body.translate(playerHead, { + x: 0, + y: 40 + }); + if ((playerHead.position.y - player.position.y) > 0) { + Matter.Body.translate(playerHead, { + x: 0, + y: 40 + }); + if ((playerHead.position.y - player.position.y) > 0) { + Matter.Body.translate(playerHead, { + x: 0, + y: 40 + }); + } + } + } + } else if (mech.crouch && ((playerHead.position.y - player.position.y) > 10)) { Matter.Body.translate(playerHead, { x: 0, y: 40 diff --git a/js/index.js b/js/index.js index 24f1661..aefdc73 100644 --- a/js/index.js +++ b/js/index.js @@ -196,6 +196,12 @@ const build = {
damage difficulty scale: ${(b.dmgScale*100).toFixed(2) }%
harm difficulty scale: ${(game.dmgScale*100).toFixed(0)}%
heal difficulty scale: ${(game.healScale*100).toFixed(1)}% +
+ + copy build url + + + `; let countGuns = 0 let countMods = 0 @@ -217,15 +223,15 @@ const build = { if (mod.mods[i].isFieldMod) { text += `
-
-
+
+
        ${mod.mods[i].name} ${isCount}
${mod.mods[i].description}
` } else if (mod.mods[i].isGunMod) { text += `
-
-
+
+
        ${mod.mods[i].name} ${isCount}
${mod.mods[i].description}
` } else { @@ -299,15 +305,19 @@ const build = { if (mod.mods[i].isFieldMod) { modID.innerHTML = `
-
-
+
+
        ${mod.mods[i].name} ${isCount}
${mod.mods[i].description}` + + //
+ //
+ // border: #fff solid 0px; } else if (mod.mods[i].isGunMod) { modID.innerHTML = `
-
-
+
+
        ${mod.mods[i].name} ${isCount}
${mod.mods[i].description}` } else { @@ -319,7 +329,7 @@ const build = { modID.setAttribute("onClick", `javascript: build.choosePowerUp(this,${i},'mod')`); } } else { - modID.innerHTML = `
  ${mod.mods[i].name}
requires: ${mod.mods[i].requires}` + modID.innerHTML = `
${mod.mods[i].name}
requires: ${mod.mods[i].requires}` if (!modID.classList.contains("build-grid-disabled")) { modID.classList.add("build-grid-disabled"); modID.onclick = null @@ -343,7 +353,7 @@ const build = { reset - + share @@ -371,12 +381,13 @@ const build = { for (let i = 0, len = b.guns.length; i < len; i++) { text += `
  ${b.guns[i].name}
${b.guns[i].description}
` } + for (let i = 0, len = mod.mods.length; i < len; i++) { if (!mod.mods[i].isCustomHide) { if (!mod.mods[i].allowed()) { // || mod.mods[i].name === "+1 cardinality") { //|| mod.mods[i].name === "leveraged investment" - text += `
  ${mod.mods[i].name}
requires: ${mod.mods[i].requires}
` - } else if (mod.mods[i].count > 1) { - text += `
  ${mod.mods[i].name} (${mod.mods[i].count}x)
${mod.mods[i].description}
` + text += `
${mod.mods[i].name}
requires: ${mod.mods[i].requires}
` + // } else if (mod.mods[i].count > 1) { + // text += `
  ${mod.mods[i].name} (${mod.mods[i].count}x)
${mod.mods[i].description}
` } else { text += `
  ${mod.mods[i].name}
${mod.mods[i].description}
` } @@ -409,7 +420,7 @@ const build = { document.getElementById("field-0").classList.add("build-field-selected"); document.getElementById("build-grid").style.display = "grid" }, - shareURL() { + shareURL(isCustom = false) { let url = "https://landgreen.github.io/sidescroller/index.html?" let count = 0; @@ -429,11 +440,16 @@ const build = { } url += `&field=${encodeURIComponent(mech.fieldUpgrades[mech.fieldMode].name.trim())}` url += `&difficulty=${game.difficultyMode}` - url += `&level=${Math.abs(Number(document.getElementById("starting-level").value))}` - url += `&noPower=${Number(document.getElementById("no-power-ups").checked)}` + if (isCustom) { + url += `&level=${Math.abs(Number(document.getElementById("starting-level").value))}` + url += `&noPower=${Number(document.getElementById("no-power-ups").checked)}` + alert('n-gon build URL copied to clipboard.\nPaste into browser address bar.') + } else { + game.makeTextLog("n-gon build URL copied to clipboard.
Paste into browser address bar.", 300) + } + console.log('n-gon build URL copied to clipboard.\nPaste into browser address bar.') console.log(url) game.copyToClipBoard(url) - alert('n-gon build URL copied to clipboard.\nPaste into browser address bar.') }, startBuildRun() { build.isCustomSelection = false; @@ -497,40 +513,40 @@ document.getElementById("build-button").addEventListener("click", () => { //setu } } openCustomBuildMenu(); - if (!game.firstRun) { //if player has already died once load that previous build - build.choosePowerUp(document.getElementById(`field-${field}`), field, 'field') - for (let i = 0; i < inventory.length; i++) { - build.choosePowerUp(document.getElementById(`gun-${inventory[i]}`), inventory[i], 'gun') - } - for (let i = 0; i < modList.length; i++) { - for (let j = 0; j < modList[i]; j++) { - build.choosePowerUp(document.getElementById(`mod-${i}`), i, 'mod', true) - } - } - //update mod text //disable not allowed mods - for (let i = 0, len = mod.mods.length; i < len; i++) { - const modID = document.getElementById("mod-" + i) - if (!mod.mods[i].isCustomHide) { - if (mod.mods[i].allowed() || mod.mods[i].count > 0) { - if (mod.mods[i].count > 1) { - modID.innerHTML = `
  ${mod.mods[i].name} (${mod.mods[i].count}x)
${mod.mods[i].description}` - } else { - modID.innerHTML = `
  ${mod.mods[i].name}
${mod.mods[i].description}` - } - if (modID.classList.contains("build-grid-disabled")) { - modID.classList.remove("build-grid-disabled"); - modID.setAttribute("onClick", `javascript: build.choosePowerUp(this,${i},'mod')`); - } - } else { - modID.innerHTML = `
  ${mod.mods[i].name}
requires: ${mod.mods[i].requires}` - if (!modID.classList.contains("build-grid-disabled")) { - modID.classList.add("build-grid-disabled"); - modID.onclick = null - } - } - } - } - } + // if (!game.firstRun) { //if player has already died once load that previous build + // build.choosePowerUp(document.getElementById(`field-${field}`), field, 'field') + // for (let i = 0; i < inventory.length; i++) { + // build.choosePowerUp(document.getElementById(`gun-${inventory[i]}`), inventory[i], 'gun') + // } + // for (let i = 0; i < modList.length; i++) { + // for (let j = 0; j < modList[i]; j++) { + // build.choosePowerUp(document.getElementById(`mod-${i}`), i, 'mod', true) + // } + // } + // //update mod text //disable not allowed mods + // for (let i = 0, len = mod.mods.length; i < len; i++) { + // const modID = document.getElementById("mod-" + i) + // if (!mod.mods[i].isCustomHide) { + // if (mod.mods[i].allowed() || mod.mods[i].count > 0) { + // if (mod.mods[i].count > 1) { + // modID.innerHTML = `
  ${mod.mods[i].name} (${mod.mods[i].count}x)
${mod.mods[i].description}` + // } else { + // modID.innerHTML = `
  ${mod.mods[i].name}
${mod.mods[i].description}` + // } + // if (modID.classList.contains("build-grid-disabled")) { + // modID.classList.remove("build-grid-disabled"); + // modID.setAttribute("onClick", `javascript: build.choosePowerUp(this,${i},'mod')`); + // } + // } else { + // modID.innerHTML = `
${mod.mods[i].name}
requires: ${mod.mods[i].requires}` + // if (!modID.classList.contains("build-grid-disabled")) { + // modID.classList.add("build-grid-disabled"); + // modID.onclick = null + // } + // } + // } + // } + // } }); // ************************************************************************************************ diff --git a/js/level.js b/js/level.js index 9fc4eb5..caf4e5f 100644 --- a/js/level.js +++ b/js/level.js @@ -19,7 +19,8 @@ const level = { // mech.setField("plasma torch") // b.giveGuns("wave beam") // mod.giveMod("micro-extruder") - // for (let i = 0; i < 15; i++) mod.giveMod("supply chain") + // mod.giveMod("piezoelectricity") + // for (let i = 0; i < 15; i++) mod.giveMod("plasma jet") @@ -59,14 +60,16 @@ const level = { b.respawnBots(); mech.resetHistory(); if (mod.isArmorFromPowerUps) { - mod.armorFromPowerUps += 0.05 * powerUps.totalPowerUps + const gain = Math.min(0.04 * powerUps.totalPowerUps, 0.44) + mod.armorFromPowerUps += gain mech.setMaxHealth(); - if (powerUps.totalPowerUps) game.makeTextLog(" max health increased by " + (0.05 * powerUps.totalPowerUps * 100).toFixed(0) + "%", 300) + if (powerUps.totalPowerUps) game.makeTextLog(" max health increased by " + (gain * 100).toFixed(0) + "%", 300) } if (mod.isHealLowHealth) { const len = Math.floor((mech.maxHealth - mech.health) / 0.5) for (let i = 0; i < len; i++) { powerUps.spawn(mech.pos.x + 60 * (Math.random() - 0.5), mech.pos.y + 60 * (Math.random() - 0.5), "heal", false); + // powerUps.heal.spawn(mech.pos.x + 60 * (Math.random() - 0.5), mech.pos.y + 60 * (Math.random() - 0.5), 50); } } if (mod.isPerpetualReroll) powerUps.spawn(mech.pos.x + 60 * (Math.random() - 0.5), mech.pos.y + 60 * (Math.random() - 0.5), "reroll", false); diff --git a/js/mods.js b/js/mods.js index 9c9617b..7892503 100644 --- a/js/mods.js +++ b/js/mods.js @@ -110,8 +110,8 @@ const mod = { if (mod.isDamageFromBulletCount) dmg *= 1 + bullet.length * 0.0038 if (mod.isRerollDamage) dmg *= 1 + 0.04 * powerUps.reroll.rerolls if (mod.isOneGun && b.inventory.length < 2) dmg *= 1.25 - if (mod.isNoFireDamage && mech.cycle > mech.fireCDcycle + 120) dmg *= 1.5 - if (mod.isSpeedDamage) dmg *= 1 + Math.min(0.33, player.speed * 0.011) + if (mod.isNoFireDamage && mech.cycle > mech.fireCDcycle + 120) dmg *= 1.66 + if (mod.isSpeedDamage) dmg *= 1 + Math.min(0.4, player.speed * 0.013) if (mod.isBotDamage) dmg *= 1 + 0.02 * mod.totalBots() return dmg * mod.slowFire * mod.aimDamage }, @@ -485,7 +485,7 @@ const mod = { }, { name: "reaction inhibitor", - description: "mobs spawn with 12% less health", + description: "mobs spawn with 11% less health", maxCount: 3, count: 0, allowed() { @@ -493,7 +493,7 @@ const mod = { }, requires: "any mob death mod", effect: () => { - mod.mobSpawnWithHealth *= 0.88 + mod.mobSpawnWithHealth *= 0.89 //set all mobs at full health to 0.85 for (let i = 0; i < mob.length; i++) { @@ -973,7 +973,7 @@ const mod = { }, { name: "anticorrelation", - description: "increase damage by 50%
after not using your gun or field for 2 seconds", + description: "increase damage by 66%
after not using your gun or field for 2 seconds", maxCount: 1, count: 0, allowed() { @@ -989,7 +989,7 @@ const mod = { }, { name: "non-Newtonian armor", - description: "for 10 seconds after receiving harm
reduce harm by 50%", + description: "for 10 seconds after receiving harm
reduce harm by 66%", maxCount: 1, count: 0, allowed() { @@ -1021,7 +1021,7 @@ const mod = { }, { name: "liquid cooling", - description: `freeze all mobs for 4 seconds
after receiving harm`, + description: `freeze all mobs for 5 seconds
after receiving harm`, maxCount: 1, count: 0, allowed() { @@ -1118,7 +1118,7 @@ const mod = { }, { name: "piezoelectricity", - description: "colliding with mobs overfills energy by 200
reduce harm by 15%", + description: "colliding with mobs gives you 400 energy
reduce harm by 15%", maxCount: 1, count: 0, allowed() { @@ -1127,7 +1127,7 @@ const mod = { requires: "not mass-energy equivalence", effect() { mod.isPiezo = true; - mech.energy += 2; + mech.energy += 4; }, remove() { mod.isPiezo = false; @@ -1135,7 +1135,7 @@ const mod = { }, { name: "ground state", - description: "reduce harm by 60%
you no longer passively regenerate energy", + description: "reduce harm by 66%
you no longer passively regenerate energy", maxCount: 1, count: 0, allowed() { @@ -1159,7 +1159,7 @@ const mod = { allowed() { return !mod.isEnergyLoss && !mod.isPiezo && !mod.isRewindAvoidDeath && !mod.isSpeedHarm && mech.fieldUpgrades[mech.fieldMode].name !== "negative mass field" }, - requires: "not exothermic process, piezoelectricity, CPT, 1st law, negative mass field", + requires: "not exothermic process, piezoelectricity, CPT, 1st law, negative mass", effect: () => { mech.health = 0 // mech.displayHealth(); @@ -1309,8 +1309,8 @@ const mod = { } }, { - name: "crystallized armor", - description: "increase maximum health by 5 for each
unused power up at the end of a level", + name: "inductive coupling", + description: "for each unused power up at the end of a level
add 4 max health (up to 44 health per level)", maxCount: 1, count: 0, allowed() { @@ -1326,6 +1326,22 @@ const mod = { mech.setMaxHealth(); } }, + { + name: "transceiver chip", + description: "at the end of each level
gain the full effect of unused power ups", + maxCount: 1, + count: 0, + allowed() { + return mod.isArmorFromPowerUps + }, + requires: "crystallized armor", + effect() { + mod.isEndLevelPowerUp = true; + }, + remove() { + mod.isEndLevelPowerUp = false; + } + }, { name: "negentropy", description: `at the start of each level
spawn a heal for every 50 missing health`, @@ -1649,7 +1665,7 @@ const mod = { }, { name: "catabolism", - description: "gain ammo when you fire while out of ammo
drains 2% of max health", + description: "when you fire while out of ammo
gain 3 ammo, but lose 5 health", maxCount: 1, count: 0, allowed() { @@ -1657,10 +1673,10 @@ const mod = { }, requires: "not mass-energy equivalence
not exciton-lattice", effect: () => { - mod.isAmmoFromHealth = 0.02; + mod.isAmmoFromHealth = true; }, remove() { - mod.isAmmoFromHealth = 0; + mod.isAmmoFromHealth = false; } }, { @@ -2733,7 +2749,7 @@ const mod = { }, { name: "thermoelectric effect", - description: "killing mobs with ice IX gives 4 health
and overloads energy by 100", + description: "killing mobs with ice IX gives 4 health
and 100 energy", isGunMod: true, maxCount: 9, count: 0, @@ -2818,7 +2834,7 @@ const mod = { // }, { name: "half-wave rectifier", - description: "charging the rail gun overfills your energy
instead of draining it", + description: "charging the rail gun gives you energy
instead of draining it", isGunMod: true, maxCount: 1, count: 0, @@ -3155,7 +3171,7 @@ const mod = { }, { name: "pair production", - description: "power ups overfill your energy by 300", + description: "picking up a power up gives you 250 energy", isFieldMod: true, maxCount: 1, count: 0, @@ -3539,7 +3555,7 @@ const mod = { }, { name: "Penrose process", - description: "after a block falls into a wormhole
your energy overfills by 50", + description: "after a block falls into a wormhole
you gain 50 energy", isFieldMod: true, maxCount: 1, count: 0, @@ -3857,5 +3873,6 @@ const mod = { isLowEnergyDamage: null, isRewindBot: null, isRewindGrenade: null, - isExtruder: null + isExtruder: null, + isEndLevelPowerUp: null } \ No newline at end of file diff --git a/js/player.js b/js/player.js index 5f905d9..b9be3b9 100644 --- a/js/player.js +++ b/js/player.js @@ -353,31 +353,9 @@ const mech = { game.makeGunHUD(); //update gun HUD } - - function pixelWindows() { - - //pixel graphics - let imgData = ctx.getImageData(0, 0, canvas.width, canvas.height); //copy current canvas pixel data - let data = imgData.data; - //change random pixels - //strange draw offset - // const off = canvas.height * canvas.width * 4 / 16 - for (let i = 0; i < data.length; i += 4) { - index = i % canvas.width - data[index + 0] = data[index + 0]; // red - data[index + 1] = data[index + 1]; // red - data[index + 2] = data[index + 2]; // red - data[index + 3] = data[index + 3]; // red - } - ctx.putImageData(imgData, 0, 0); //draw new pixel data to canvas - - } - - game.wipe = function() { //set wipe to have trails ctx.fillStyle = "rgba(255,255,255,0)"; ctx.fillRect(0, 0, canvas.width, canvas.height); - // pixelWindows() } function randomizeEverything() { @@ -423,6 +401,7 @@ const mech = { mech.displayHealth(); document.getElementById("text-log").style.opacity = 0; //fade out any active text logs document.getElementById("fade-out").style.opacity = 1; //slowly fades out + // build.shareURL(false) setTimeout(function() { World.clear(engine.world); Engine.clear(engine); @@ -475,14 +454,14 @@ const mech = { harmReduction() { let dmg = 1 dmg *= mech.fieldHarmReduction - if (mod.isSpeedHarm) dmg *= 1 - Math.min(player.speed * 0.018, 0.5) + if (mod.isSpeedHarm) dmg *= 1 - Math.min(player.speed * 0.0185, 0.55) if (mod.isSlowFPS) dmg *= 0.85 if (mod.isPiezo) dmg *= 0.85 if (mod.isHarmReduce && mech.fieldUpgrades[mech.fieldMode].name === "negative mass field" && mech.isFieldActive) dmg *= 0.6 if (mod.isBotArmor) dmg *= 0.97 ** mod.totalBots() - if (mod.isHarmArmor && mech.lastHarmCycle + 600 > mech.cycle) dmg *= 0.5; + if (mod.isHarmArmor && mech.lastHarmCycle + 600 > mech.cycle) dmg *= 0.33; if (mod.isNoFireDefense && mech.cycle > mech.fireCDcycle + 120) dmg *= 0.6 - if (mod.energyRegen === 0) dmg *= 0.4 //0.22 + 0.78 * mech.energy //77% damage reduction at zero energy + if (mod.energyRegen === 0) dmg *= 0.33 //0.22 + 0.78 * mech.energy //77% damage reduction at zero energy if (mod.isTurret && mech.crouch) dmg *= 0.5; if (mod.isEntanglement && b.inventory[0] === b.activeGun) { for (let i = 0, len = b.inventory.length; i < len; i++) dmg *= 0.87 // 1 - 0.15 @@ -675,7 +654,7 @@ const mech = { mech.defaultFPSCycle = mech.cycle + 20 + Math.min(90, Math.floor(200 * dmg)) if (mod.isHarmFreeze) { //freeze all mobs for (let i = 0, len = mob.length; i < len; i++) { - mobs.statusSlow(mob[i], 240) + mobs.statusSlow(mob[i], 300) } } } else { @@ -1641,7 +1620,7 @@ const mech = { effect() { mech.fieldMeterColor = "#f0f" mech.hold = function() { - mech.isExtruderOn = false + b.isExtruderOn = false if (mech.isHolding) { mech.drawHold(mech.holdingTarget); mech.holding(); @@ -1663,9 +1642,10 @@ const mech = { if (mod.isExtruder) { if (input.field) { - mech.wasExtruderOn = true + b.wasExtruderOn = true } else { - mech.wasExtruderOn = false + b.wasExtruderOn = false + b.canExtruderFire = true } ctx.lineWidth = 5; ctx.strokeStyle = "#f07" @@ -1680,7 +1660,7 @@ const mech = { } } } - if (mech.wasExtruderOn && mech.isExtruderOn) ctx.lineTo(mech.pos.x + 15 * Math.cos(mech.angle), mech.pos.y + 15 * Math.sin(mech.angle)) + if (b.wasExtruderOn && b.isExtruderOn) ctx.lineTo(mech.pos.x + 15 * Math.cos(mech.angle), mech.pos.y + 15 * Math.sin(mech.angle)) ctx.stroke(); } } diff --git a/js/powerup.js b/js/powerup.js index 14b307c..cdd2220 100644 --- a/js/powerup.js +++ b/js/powerup.js @@ -170,8 +170,12 @@ const powerUps = { mech.setMaxEnergy(); } }, - spawn() { //used to spawn a heal with a specific size / heal amount, not normally used - + spawn(x, y, size) { //used to spawn a heal with a specific size / heal amount, not normally used + powerUps.directSpawn(x, y, "heal", false, null, size) + if (Math.random() < mod.duplicationChance()) { + powerUps.directSpawn(x, y, "heal", false, null, size) + powerUp[powerUp.length - 1].isBonus = true + } } }, ammo: { @@ -318,15 +322,15 @@ const powerUps = { if (mod.mods[choose].isFieldMod) { text += `
-
-
+
+
        ${mod.mods[choose].name} ${isCount}
${mod.mods[choose].description}
` } else if (mod.mods[choose].isGunMod) { text += `
-
-
+
+
        ${mod.mods[choose].name} ${isCount}
${mod.mods[choose].description}
` } else { @@ -455,7 +459,7 @@ const powerUps = { } }, onPickUp(where) { - if (mod.isMassEnergy && mech.energy < mech.maxEnergy * 2.5) mech.energy += 3; + if (mod.isMassEnergy) mech.energy += 2.5; if (mod.isMineDrop) b.mine({ x: where.x, y: where.y @@ -656,7 +660,7 @@ const powerUps = { ) { powerUps.directSpawn(x, y, target, moving, mode, size) if (Math.random() < mod.duplicationChance()) { - powerUps.directSpawn(x, y, target, moving, mode) + powerUps.directSpawn(x, y, target, moving, mode, size) powerUp[powerUp.length - 1].isBonus = true } } diff --git a/js/spawn.js b/js/spawn.js index bba1cb6..801962f 100644 --- a/js/spawn.js +++ b/js/spawn.js @@ -930,6 +930,7 @@ const spawn = { let targets = [] //track who is in the node boss, for shields mobs.spawn(x, y, 6, radius, "#b386e8"); let me = mob[mob.length - 1]; + Matter.Body.setDensity(me, 0.002); //extra dense //normal is 0.001 //makes effective life much larger me.isBoss = true; targets.push(me.id) //add to shield protection me.friction = 0; @@ -991,6 +992,7 @@ const spawn = { for (let i = 0; i < nodes; ++i) { spawn.stabber(x + sideLength * Math.sin(i * angle), y + sideLength * Math.cos(i * angle), radius, 12); + Matter.Body.setDensity(mob[mob.length - 1], 0.002); //extra dense //normal is 0.001 //makes effective life much larger targets.push(mob[mob.length - 1].id) //track who is in the node boss, for shields } diff --git a/style.css b/style.css index 794a7b5..754418a 100644 --- a/style.css +++ b/style.css @@ -585,15 +585,16 @@ em { .mod { /* background: rgb(116, 102, 238); */ - background: hsl(253, 80%, 67%); + /* background: hsl(253, 57%, 52%); */ + background: hsl(255, 100%, 71%); } -.grey { +/* .grey { background: #afb6c2; -} +} */ .gun { - background: rgb(10, 79, 198); + background: rgb(0, 80, 218); } .heal { diff --git a/todo.txt b/todo.txt index d426ffe..8db3d91 100644 --- a/todo.txt +++ b/todo.txt @@ -1,12 +1,17 @@ ******************************************************** NEXT PATCH ******************************************************** +your build url can now be copied in the pause screen -mods for guns and fields have an extra circle in selection menus +mod: inductive coupling - 4 max health per power up, but limited to 44 max health per level (replaces crystalized armor) +mod: transceiver chip - use all the power ups left over at the end of a level +mod: catabolism - does a flat 5 damage to your health for 3 ammo (was 2% of max health for 1 ammo) ******************************************************** BUGS ******************************************************** -entering custom, after dieing makes all mods look white (not disabled) - this goes away after clicking something so it seems to be only a graphical issue +give worm hole pair production? + +2nd mod for crystalized armor + no cap for health power ups? (not able to reproduce, might be fixed) possible bug with neutron rewind status doesn't apply correctly for spawned neutron bombs that are stuck to a shield @@ -20,8 +25,9 @@ mod and mob are too similar (always) is there a way to check if the player is stuck inside the map or block trigger a short term non-collide if that occurs -(8+ reports before potential fix) bug - crouch and worm hole? -> crouch locked in - test this on a slower computer, doesn't occur on my computer +(12+ reports) bug - crouch and worm hole? -> crouch locked in + doesn't occur on my computer? + you can spoof it with mech.crouch = true in console players have extra gravity might be from the short jump code add in a check every 7 seconds to try and fix it @@ -38,6 +44,15 @@ mod and mob are too similar ******************************************************** TODO ******************************************************** +make a reset hit box function as a way to fix crouch bug + +mod that requires integrated armament + +mod - reset level + you trade a mod for a chance at killing a new level boss and farming more ammo + resets health, ammo (but not mods, fields, guns, ... ?) + scramble level order? or same level + mechanic - Your energy regen is only active when field and gun have not been used for 5 seconds. be able to open up custom mode in the normal game