diff --git a/js/bullet.js b/js/bullet.js index f77a635..7e121c8 100644 --- a/js/bullet.js +++ b/js/bullet.js @@ -2104,7 +2104,7 @@ const b = { for (let i = 0, len = mob.length; i < len; ++i) { if (mob[i].shield) { const dist = Vector.magnitude(Vector.sub(this.position, mob[i].position)) - mob[i].radius; - if (dist < this.explodeRad) mob[i].health *= 0.8 + if (dist < this.explodeRad) mob[i].health *= 0.2 } } const dist = Vector.magnitude(Vector.sub(this.position, player.position)) @@ -2669,7 +2669,7 @@ const b = { } else if (mech.energy > 0.005) { // charging on mouse down mech.fireCDcycle = Infinity //can't fire until mouse is released const lastCharge = this.charge - let chargeRate = (mech.crouch) ? 0.975 : 0.987 + let chargeRate = (mech.crouch) ? 0.98 : 0.984 chargeRate *= Math.pow(b.fireCD, 0.03) this.charge = this.charge * chargeRate + (1 - chargeRate) // this.charge converges to 1 if (mod.isRailTimeSlow) { @@ -2950,6 +2950,7 @@ const b = { } } }, + { name: "pulse", description: "convert 25% of your energy into a pulsed laser
instantly initiates a fusion explosion", @@ -3101,6 +3102,41 @@ const b = { } }, // { + // name: "maser", + // description: "emit a beam of collimated coherent light
drains energy instead of ammunition", + // ammo: 0, + // ammoPack: Infinity, + // have: false, + // isEasyToAim: false, + // fire() { + // if (mech.energy < 0.002) { + // mech.fireCDcycle = mech.cycle + 100; // cool down if out of energy + // } else { + // // mech.energy -= mech.fieldRegen + 0.002 * mod.isLaserDiode + + // let range = 2000 + // const looking = Vector.mult(Vector.rotate({ + // x: 1, + // y: 0 + // }, mech.angle), range) + // const endpoint = Matter.Vector.add(mech.pos, looking) + // const hits = Matter.Query.ray(body, mech.pos, endpoint, 100) + // for (let i = 0; i < hits.length; i++) { + + + // } + // // console.log(hits, target, range) + + + // //draw beam + // ctx.beginPath(); + // ctx.moveTo(mech.pos.x, mech.pos.y); + // ctx.lineTo(endpoint.x, endpoint.y); + // ctx.stroke(); + // } + // } + // }, + // { // name: "dwarf star", //14 // description: "drop a mine that gravitational pulls in matter", // ammo: 0, diff --git a/js/level.js b/js/level.js index ea41a18..91aa2bb 100644 --- a/js/level.js +++ b/js/level.js @@ -18,7 +18,7 @@ const level = { // mech.isStealth = true; // mod.giveMod("bot upgrades"); // mod.nailBotCount += 10 - // b.giveGuns("ice IX") + // b.giveGuns("maser") // mech.setField("plasma torch") // level.testing(); @@ -50,8 +50,8 @@ const level = { mech.maxHealth += 0.05 * powerUps.totalPowerUps if (powerUps.totalPowerUps) game.makeTextLog(" max health increased by " + (0.05 * powerUps.totalPowerUps * 100).toFixed(0) + "%", 300) } - if (mod.isHealLowHealth && mech.health < mech.maxHealth * 0.66 * game.healScale) { - mech.health = mech.maxHealth * 0.66 * game.healScale + if (mod.isHealLowHealth && mech.health < mech.maxHealth * game.healScale) { + mech.health = mech.maxHealth * game.healScale mech.displayHealth(); } }, @@ -188,15 +188,15 @@ const level = { spawn.mapRect(level.exit.x, level.exit.y + 20, 100, 20); level.defaultZoom = 2000 game.zoomTransition(level.defaultZoom) - document.body.style.backgroundColor = "#444"; + document.body.style.backgroundColor = "#d5d5d5"; - level.fillBG.push({ //full map white - x: -375, - y: -3700, - width: 2975, - height: 3800, - color: "#ddd" - }); + // level.fillBG.push({ //full map white + // x: -375, + // y: -3700, + // width: 2975, + // height: 3800, + // color: "#ddd" + // }); level.fillBG.push({ //exit room x: -300, @@ -223,13 +223,13 @@ const level = { const portal3 = level.portal({ x: 1850, - y: -550 + y: -585 }, -Math.PI / 2, { //up x: 2425, y: -600 }, -2 * Math.PI / 3) //up left - const hazard = level.hazard(175, -2050, 1050, 10, 0.15, "hsl(0, 100%, 50%)") //laser - const hazard2 = level.hazard(1775, -2550, 150, 10, 0.15, "hsl(0, 100%, 50%)") //laser + const hazard = level.hazard(350, -2025, 700, 10, 0.4, "hsl(0, 100%, 50%)") //laser + const hazard2 = level.hazard(1775, -2550, 150, 10, 0.4, "hsl(0, 100%, 50%)") //laser const button = level.button(2100, -2600) level.custom = () => { @@ -287,11 +287,13 @@ const level = { powerUps.chooseRandomPowerUp(powerUpPos[1].x, powerUpPos[1].y); //outer wall - spawn.mapRect(-500, -3800, 200, 4000); //left map wall - spawn.mapRect(2500, -2975, 200, 2825); //right map middle wall above right portal + spawn.mapRect(-1400, -3800, 1100, 3900); //left map wall + spawn.mapRect(2500, -2975, 1200, 2825); //right map middle wall above right portal + spawn.mapRect(2700, -3600, 1000, 3650); + // far far right wall right of portals // spawn.mapRect(2500, -1425, 200, 1275); // below right portal - spawn.mapRect(-400, -3800, 3100, 200); //map ceiling - spawn.mapRect(-400, 0, 3100, 200); //floor + spawn.mapRect(-1400, -4800, 5100, 1200); //map ceiling + spawn.mapRect(-1400, 0, 5100, 1200); //floor //lower entrance /exit // spawn.mapRect(300, -550, 50, 350); //right entrance wall @@ -299,19 +301,26 @@ const level = { // spawn.mapRect(1075, -100, 575, 200); // spawn.bodyRect(312, -200, 25, 200); // spawn.bodyRect(1775, -75, 100, 100); - spawn.mapRect(1075, -375, 50, 225); - spawn.bodyRect(1087, -150, 25, 150); + spawn.mapRect(300, -375, 50, 225); + spawn.bodyRect(312, -150, 25, 140); + spawn.mapRect(300, -10, 50, 50); //upper entrance / exit spawn.mapRect(-400, -1050, 750, 50); spawn.mapRect(300, -1050, 50, 300); - spawn.bodyRect(312, -750, 25, 200); + spawn.bodyRect(312, -750, 25, 190); + spawn.mapRect(300, -560, 50, 50); + // spawn.mapRect(1400, -1025, 50, 300); // spawn.mapRect(1400, -1025, 50, 825); spawn.mapRect(600, -600, 275, 75); spawn.bodyRect(675, -725, 125, 125); - spawn.mapRect(1075, -1050, 550, 400); - spawn.mapRect(-400, -550, 2175, 250); + // spawn.mapRect(1075, -1050, 550, 400); + // spawn.mapRect(1150, -1000, 150, 575); + spawn.mapRect(1150, -1000, 250, 575); + spawn.mapRect(1600, -550, 175, 250); + + spawn.mapRect(-400, -550, 1800, 250); spawn.mapRect(-200, -1700, 150, 25); //platform above exit room spawn.mapRect(-200, -1325, 350, 25); @@ -319,7 +328,8 @@ const level = { // spawn.mapRect(1425, -550, 350, 250); spawn.mapRect(1925, -550, 500, 250); spawn.mapRect(2425, -450, 100, 150); - spawn.mapRect(1750, -360, 225, 60); + spawn.mapRect(1750, -390, 225, 90); + //portal 1 bottom spawn.mapRect(2525, -200, 175, 250); //right portal back wall @@ -333,14 +343,15 @@ const level = { spawn.mapRect(1400, -3625, 50, 200); spawn.mapRect(350, -3625, 50, 225); spawn.mapRect(350, -3260, 50, 60); - spawn.bodyRect(362, -3400, 25, 140); + // spawn.bodyRect(362, -3400, 25, 140); spawn.mapRect(200, -3250, 1250, 50); spawn.mapRect(1400, -3260, 50, 310); spawn.bodyRect(1412, -3425, 25, 165); - spawn.mapRect(-150, -3000, 150, 25); - spawn.mapRect(-350, -2750, 175, 200); + // spawn.mapRect(-150, -3000, 150, 25); + // spawn.mapRect(-350, -2925, 175, 25); + spawn.mapRect(-150, -2925, 150, 25); //portal 2 spawn.mapRect(-300, -2600, 300, 675); //left platform @@ -350,18 +361,18 @@ const level = { spawn.mapRect(0, -1975, 175, 50); spawn.mapRect(1225, -1975, 175, 50); - spawn.mapRect(150, -2150, 25, 225); - spawn.mapRect(1225, -2150, 25, 225); + spawn.mapRect(150, -2100, 200, 175); + spawn.mapRect(1050, -2100, 200, 175); //mobs - spawn.randomMob(1075, -3500, 0); + spawn.randomMob(1075, -3500, -0.3); // spawn.randomMob(-75, -3425, 0.2); - spawn.randomMob(1475, -225, 0); - spawn.randomMob(2075, -150, 0); - spawn.randomMob(2175, -700, 0); - spawn.randomMob(-75, -850, 0.1); - spawn.randomMob(1300, -600, 0.1); - spawn.randomMob(550, -3400, 0.1); + spawn.randomMob(1475, -225, -0.3); + spawn.randomMob(2075, -150, -0.2); + spawn.randomMob(2175, -700, -0.2); + spawn.randomMob(-75, -850, -0.1); + spawn.randomMob(1300, -600, -0.1); + spawn.randomMob(550, -3400, 0); if (game.difficulty > 50) { spawn.randomMob(2300, -2775, -0.5); spawn.randomMob(600, -925, -0.5); @@ -370,7 +381,7 @@ const level = { spawn.randomMob(-75, -1475, 0); spawn.randomBoss(600, -2600, 0); } - if (game.difficulty < 30) { + if (game.difficulty < 32) { spawn.randomMob(700, -1650, 0); spawn.randomMob(600, -3500, 0.2); spawn.randomMob(-75, -1175, 0.2); @@ -604,7 +615,7 @@ const level = { spawn.mapRect(level.exit.x, level.exit.y + 20, 100, 100); //exit bump spawn.boost(1500, 0, 900); - spawn.bomberBoss(2900, -500) + // spawn.bomberBoss(2900, -500) // spawn.launcherBoss(1200, -500) // spawn.laserTargetingBoss(1600, -400) // spawn.spawner(1600, -500) @@ -613,7 +624,7 @@ const level = { // spawn.sniper(1800, -120) // spawn.sniper(2200, -120) // spawn.cellBossCulture(1600, -500) - // spawn.shooter(1600, -500) + spawn.starter(1600, -500, 60) // spawn.striker(1600, -500) // spawn.shield(mob[mob.length - 1], 1200, -500, 1); diff --git a/js/mob.js b/js/mob.js index f95a327..106d29b 100644 --- a/js/mob.js +++ b/js/mob.js @@ -1007,7 +1007,7 @@ const mobs = { this.removeConsBB(); this.alive = false; //triggers mob removal in mob[i].replace(i) if (this.dropPowerUp) { - if (mod.isEnergyLoss) mech.energy *= 0.66; + if (mod.isEnergyLoss) mech.energy *= 0.75; powerUps.spawnRandomPowerUp(this.position.x, this.position.y); mech.lastKillCycle = mech.cycle; //tracks the last time a kill was made, mostly used in game.checks() if (Math.random() < mod.sporesOnDeath) { diff --git a/js/mods.js b/js/mods.js index eb244d7..4ad0a02 100644 --- a/js/mods.js +++ b/js/mods.js @@ -91,9 +91,9 @@ const mod = { maxCount: 1, count: 0, allowed() { - return true + return mech.maxEnergy > 1 || mod.isEnergyRecovery || mod.isPiezo || mod.energySiphon > 0 }, - requires: "", + requires: "increased energy regen or max energy", effect: () => { mod.isEnergyDamage = true // used in mech.grabPowerUp }, @@ -103,7 +103,7 @@ const mod = { }, { name: "acute stress response", - description: "increase damage by 33%
after a mob dies drain 33% energy", + description: "increase damage by 33%
if a mob dies drain stored energy by 25%", maxCount: 1, count: 0, allowed() { @@ -232,16 +232,16 @@ const mod = { }, { name: "Ψ(t) collapse", - description: "33% decreased delay after firing
if you have no rerolls", + description: "40% decreased delay after firing
if you have no rerolls", maxCount: 1, count: 0, allowed() { - return powerUps.reroll.rerolls === 0 + return powerUps.reroll.rerolls === 0 && !mod.manyWorlds }, requires: "no rerolls", effect() { mod.isRerollHaste = true; - mod.rerollHaste = 0.666; + mod.rerollHaste = 0.6; b.setFireCD(); }, remove() { @@ -269,7 +269,7 @@ const mod = { }, { name: "auto-loading heuristics", - description: "20% decreased delay after firing", + description: "25% decreased delay after firing", maxCount: 9, count: 0, allowed() { @@ -277,7 +277,7 @@ const mod = { }, requires: "", effect() { - mod.fireRate *= 0.8 + mod.fireRate *= 0.75 b.setFireCD(); }, remove() { @@ -441,23 +441,6 @@ const mod = { mod.laserBotCount = 0; } }, - { - name: "plasma-bot", - description: "a bot uses energy to emit short range plasma
plasma damages and pushes mobs", - maxCount: 1, - count: 0, - allowed() { - return mech.fieldUpgrades[mech.fieldMode].name === "plasma torch" - }, - requires: "plasma torch", - effect() { - mod.plasmaBotCount++; - b.plasmaBot(); - }, - remove() { - mod.plasmaBotCount = 0; - } - }, { name: "bot fabrication", description: "anytime you collect 4 rerolls
use them to build a random bot", @@ -531,7 +514,7 @@ const mod = { }, { name: "bot replication", - description: "duplicate your permanent bots
remove 90% of your ammo", + description: "duplicate your permanent bots
remove all of your ammo", maxCount: 1, count: 0, // isNonRefundable: true, @@ -542,9 +525,7 @@ const mod = { effect() { //remove ammo for (let i = 0, len = b.guns.length; i < len; ++i) { - if (b.guns[i].ammo != Infinity) { - b.guns[i].ammo = Math.floor(b.guns[i].ammo * 0.1); - } + if (b.guns[i].ammo != Infinity) b.guns[i].ammo = 0; } game.updateGunHUD(); //double bots @@ -577,9 +558,9 @@ const mod = { maxCount: 1, count: 0, allowed() { - return true + return mech.harmReduction() < 1 }, - requires: "", + requires: "some harm reduction", effect() { mod.isDroneOnDamage = true; for (let i = 0; i < 4; i++) { @@ -812,7 +793,7 @@ const mod = { }, { name: "waste energy recovery", - description: "regen 6% of max energy every second
active for 5 seconds after any mob dies", + description: "if a mob has died in the last 5 seconds
regen 6% of max energy every second", maxCount: 1, count: 0, allowed() { @@ -828,7 +809,7 @@ const mod = { }, { name: "scrap recycling", - description: "heal up to 1% of max health every second
active for 5 seconds after any mob dies", + description: "if a mob has died in the last 5 seconds
heal up to 1% of max health every second", maxCount: 1, count: 0, allowed() { @@ -925,19 +906,19 @@ const mod = { // } // }, { - name: "recursive healing", - description: "healing power ups trigger 1 more time", - maxCount: 9, + name: "adiabatic healing", + description: "heal power ups are 100% more effective", + maxCount: 3, count: 0, allowed() { return (mech.health < 0.7 || build.isCustomSelection) && !mod.isEnergyHealth }, requires: "not mass-energy equivalence", effect() { - mod.recursiveHealing += 1 + mod.largerHeals++; }, remove() { - mod.recursiveHealing = 1; + mod.largerHeals = 1; } }, { @@ -1147,9 +1128,9 @@ const mod = { maxCount: 1, count: 0, allowed() { - return !mod.isSuperDeterminism + return !mod.isSuperDeterminism && !mod.isRerollHaste }, - requires: "not superdeterminism", + requires: "not superdeterminism or Ψ(t) collapse", effect: () => { mod.manyWorlds = true; }, @@ -2062,6 +2043,23 @@ const mod = { mod.isPlasmaRange = 1; } }, + { + name: "plasma-bot", + description: "a bot uses energy to emit short range plasma
plasma damages and pushes mobs", + maxCount: 1, + count: 0, + allowed() { + return mech.fieldUpgrades[mech.fieldMode].name === "plasma torch" + }, + requires: "plasma torch", + effect() { + mod.plasmaBotCount++; + b.plasmaBot(); + }, + remove() { + mod.plasmaBotCount = 0; + } + }, { name: "degenerate matter", description: "reduce harm by 40%
while negative mass field is active", @@ -2361,7 +2359,7 @@ const mod = { isDroneOnDamage: null, isAcidDmg: null, isAnnihilation: null, - recursiveHealing: null, + largerHeals: null, squirrelFx: null, isCrit: null, bayesian: null, diff --git a/js/player.js b/js/player.js index 1fb01c1..2f39415 100644 --- a/js/player.js +++ b/js/player.js @@ -454,27 +454,21 @@ const mech = { return dmg }, damage(dmg) { - // , noTransition = false mech.lastHarmCycle = mech.cycle - if (mod.isDroneOnDamage) { //chance to build a drone on damage from mod const len = (dmg - 0.06 * Math.random()) * 40 for (let i = 0; i < len; i++) { if (Math.random() < 0.5) b.drone() //spawn drone } } - if (mod.isEnergyHealth) { - mech.energy -= dmg; - if (mech.energy < 0 || isNaN(mech.energy)) { - if (mod.isDeathAvoid && powerUps.reroll.rerolls) { //&& Math.random() < 0.5 + mech.energy -= dmg * 1.2; //20% extra damage for energy as health for balance reasons + if (mech.energy < 0 || isNaN(mech.energy)) { //taking deadly damage + if (mod.isDeathAvoid && powerUps.reroll.rerolls) { powerUps.reroll.changeRerolls(-1) - mech.energy = mech.maxEnergy - // if (mech.energy < 0.05) mech.energy = 0.05 mech.immuneCycle = mech.cycle + 120 //disable this.immuneCycle bonus seconds game.makeTextLog(` death avoided
1/${powerUps.reroll.rerolls} rerolls consumed
`, 420) - game.wipe = function () { //set wipe to have trails ctx.fillStyle = "rgba(255,255,255,0.03)"; ctx.fillRect(0, 0, canvas.width, canvas.height); @@ -486,7 +480,7 @@ const mech = { }, 2000); return; - } else { + } else { //death mech.health = 0; mech.energy = 0; mech.death(); diff --git a/js/powerup.js b/js/powerup.js index ada13f8..664f682 100644 --- a/js/powerup.js +++ b/js/powerup.js @@ -106,12 +106,11 @@ const powerUps = { name: "heal", color: "#0eb", size() { - return 40 * Math.sqrt(0.1 + Math.random() * 0.5); + return 40 * (game.healScale ** 0.25) * Math.sqrt(mod.largerHeals) * Math.sqrt(0.1 + Math.random() * 0.5); //(game.healScale ** 0.25) gives a smaller radius as heal scale goes down }, effect() { if (!mod.isEnergyHealth && mech.alive) { - let heal = 0 - for (let i = 0; i < mod.recursiveHealing; i++) heal += ((this.size / 40) ** 2) + const heal = mod.largerHeals * (this.size / 40 / Math.sqrt(mod.largerHeals) / (game.healScale ** 0.25)) ** 2 //heal scale is undone here because heal scale is properly affected on mech.addHealth() if (heal > 0) { game.makeTextLog("
  heal " + (Math.min(mech.maxHealth - mech.health, heal) * game.healScale * 100).toFixed(0) + "%", 300) mech.addHealth(heal); @@ -432,7 +431,7 @@ const powerUps = { if (game.difficultyMode < 2) { //easy and normal mode powerUps.randomPowerUpCounter += 0.5; - } else if (game.difficultyMode === 3) { //hard mode + } else if (game.difficultyMode === 2) { //hard mode powerUps.randomPowerUpCounter += 1; } else { //why mode powerUps.randomPowerUpCounter += 1.33; diff --git a/todo.txt b/todo.txt index 6d083dc..97e3ca5 100644 --- a/todo.txt +++ b/todo.txt @@ -1,23 +1,17 @@ -mod: upgrade all bots (current and future bots) -some difficulty scaling changes (harm ramps a bit faster at high levels) +heal power ups scale in size to indicate mod effects, and level based heal scaling +testingChamber changes ************** TODO - n-gon ************** +new gun - deploy a turret that last for 20 seconds + fire nails at nearby targets once a second. + use mine code and bot code -too many mods are dropping at high levels on hard +minigun: high caliber - rework + slow down the bullets even more and increase the size? + remove and actually make a full gun like this? -mod: upgrade all your current bots - upgrade should be equal to a 50% increases in value for the bot - nail-bot fires faster - foam bot fires larger radius foam - larger boom-bot explosions - laser-bot does more damage - plasma-bot uses less energy - -testChamber - too much block clutter near portals - make reverse path viable - removing block from button releases boss? +gun: hit scan bullets? portals: portal while holding block sometimes send player back to original portal @@ -66,26 +60,12 @@ button: blocks that are on the button at an angle will slowly slide off the butt hazards should slow blocks, bullets, mobs? mob damage? -rotor doesn't work with - plasma torch - seems to have no effect - pilot wave - maybe rewrite pilot wave to apply a force from an angle, like plasma torch - this would be probably too much work, but worth a try - time dilation field (mostly fixed, but it would be nice if it started up faster after a pause) - sporangium and neutron bomb (mostly fixed, but it would be nice if it sticked instead of bounced) - -new gun - deploy a turret that last for 20 seconds - fire nails at nearby targets once a second. - use mine code and bot code - field that pushes blocks and mobs away charges up on mouse down and triggers on mouse up drain mana while charging up maybe push effect should last 10 cycles to give a more gentle feeling - -mod - AoE radiation might work when the effect ends - or maybe just anytime another mob is near + mod - AoE radiation might work when the effect ends + or maybe just anytime another mob is near mob that flashes the player (makes the graphics not update for a couple seconds)