const mod = { totalCount: null, setupAllMods() { for (let i = 0, len = mod.mods.length; i < len; i++) { mod.mods[i].remove(); mod.mods[i].count = 0 } mod.totalCount = 0; game.updateModHUD(); }, removeMod(index) { mod.mods[index].remove(); mod.mods[index].count = 0; game.updateModHUD(); }, giveMod(index = 'random') { if (index === 'random') { let options = []; for (let i = 0; i < mod.mods.length; i++) { if (mod.mods[i].count < mod.mods[i].maxCount && mod.mods[i].allowed()) options.push(i); } // give a random mod from the mods I don't have if (options.length > 0) { let newMod = options[Math.floor(Math.random() * options.length)] mod.giveMod(newMod) } } else { if (isNaN(index)) { //find index by name let found = false; for (let i = 0; i < mod.mods.length; i++) { if (index === mod.mods[i].name) { index = i; found = true; break; } } if (!found) return //if name not found don't give any mod } mod.mods[index].effect(); //give specific mod mod.mods[index].count++ mod.totalCount++ //used in power up randomization game.updateModHUD(); } }, giveBasicMod(index = 'random') { // if (isNaN(index)) { //find index by name // let found = false; // for (let i = 0; i < mod.mods.length; i++) { // if (index === mod.mods[i].name) { // index = i; // found = true; // break; // } // } // if (!found) return //if name not found don't give any mod // } mod.basicMods[index].effect(); //give specific mod mod.mods[index].count++ mod.totalCount++ //used in power up randomization game.updateModHUD(); }, haveGunCheck(name) { for (i = 0, len = b.inventory.length; i < len; i++) { if (b.guns[b.inventory[i]].name === name) return true } return false }, damageFromMods() { let dmg = 1 if (mod.isLowHealthDmg) dmg *= (3 / (2 + Math.min(mech.health, 1))) //up to 50% dmg at zero player health //if this changes all update display in modonHealthChange() if (mod.isHarmDamage && mech.lastHarmCycle + 300 > mech.cycle) dmg *= 2; if (mod.isEnergyLoss) dmg *= 1.33; if (mod.isRest && player.speed < 1) dmg *= 1.20; if (mod.isEnergyDamage) dmg *= 1 + mech.energy / 5.5; if (mod.isDamageFromBulletCount) dmg *= 1 + bullet.length * 0.007 return dmg }, onHealthChange() { //used with acid mod if (mod.isAcidDmg && mech.health > 0.8) { mod.acidDmg = 0.5 if (!build.isCustomSelection) { setTimeout(function () { if (document.getElementById("mod-acid")) document.getElementById("mod-acid").innerHTML = " (on)" }, 10); } } else { mod.acidDmg = 0 if (!build.isCustomSelection) { setTimeout(function () { if (document.getElementById("mod-acid")) document.getElementById("mod-acid").innerHTML = " (off)" }, 10); } } // if (mod.isLowHealthDmg) { // if (!build.isCustomSelection) { // setTimeout(function () { // if (document.getElementById("mod-low-health-damage")) document.getElementById("mod-low-health-damage").innerHTML = " +" + (((3 / (2 + Math.min(mech.health, 1))) - 1) * 100).toFixed(0) + "%" // }, 10); // } // } }, resetModText() { setTimeout(function () { if (document.getElementById("mod-acid")) document.getElementById("mod-acid").innerHTML = ""; if (document.getElementById("mod-low-health-damage")) document.getElementById("mod-low-health-damage").innerHTML = ""; }, 10); }, mods: [{ name: "capacitor", // nameInfo: "", description: "increase damage based on stored energy
+1% damage for every 5.5% energy", maxCount: 1, count: 0, allowed() { return true }, requires: "", effect: () => { mod.isEnergyDamage = true // used in mech.grabPowerUp }, remove() { mod.isEnergyDamage = false; } }, { name: "rest frame", // nameInfo: "", description: "increase damage by 20% when not moving", maxCount: 1, count: 0, allowed() { return true }, requires: "", effect: () => { mod.isRest = true // used in mech.grabPowerUp }, remove() { mod.isRest = false; } }, { name: "kinetic bombardment", description: "do up to 33% more damage at a distance
increase maxes out at about 40 steps away", maxCount: 1, count: 0, allowed() { return true }, requires: "", effect() { mod.isFarAwayDmg = true; //used in mob.damage() }, remove() { mod.isFarAwayDmg = false; } }, { name: "fracture analysis", description: "bullets do 5x damage to unaware mobs
unaware mobs don't have a health bar", maxCount: 1, count: 0, allowed() { return true }, requires: "", effect() { mod.isCrit = true; }, remove() { mod.isCrit = false; } }, { name: "negative feedback", // nameInfo: "", description: "do extra damage at low health
up to 50% increase when near death", maxCount: 1, count: 0, allowed() { return mech.health < 0.8 || build.isCustomSelection }, requires: "health below 80%", effect() { mod.isLowHealthDmg = true; //used in mob.damage() }, remove() { mod.isLowHealthDmg = false; } }, { name: "radiative equilibrium", description: "after receiving any harm
do 2x damage for 5 seconds", maxCount: 1, count: 0, allowed() { return true }, requires: "", effect() { mod.isHarmDamage = true; }, remove() { mod.isHarmDamage = false; } }, { name: "acute stress response", description: "increase damage by 33%
but, after a mob dies lose 1/3 your energy", maxCount: 1, count: 0, allowed() { return !mod.isEnergyHealth }, requires: "mass-energy equivalence", effect() { mod.isEnergyLoss = true; }, remove() { mod.isEnergyLoss = false; } }, { name: "auto-loading heuristics", description: "your delay after firing is +15% shorter", maxCount: 9, count: 0, allowed() { return true }, requires: "", effect() { mod.fireRate *= 0.85 }, remove() { mod.fireRate = 1; } }, { name: "desublimated ammunition", description: "use 50% less ammo when crouching", maxCount: 1, count: 0, allowed() { return true }, requires: "", effect() { mod.noAmmo = 1 }, remove() { mod.noAmmo = 0; } }, { name: "mass driver", description: "blocks do 2x more damage to mobs
charge throws more quickly for less energy", maxCount: 1, count: 0, allowed() { return true }, requires: "", effect() { mod.throwChargeRate = 2 }, remove() { mod.throwChargeRate = 1 } }, { name: "laser-bot", description: "a bot defends the space around you
uses a short range laser that drains energy", maxCount: 9, count: 0, allowed() { return true }, requires: "", effect() { mod.laserBotCount++; b.laserBot(); }, remove() { mod.laserBotCount = 0; } }, { name: "nail-bot", description: "a bot fires nails at targets in line of sight", maxCount: 9, count: 0, allowed() { return true }, requires: "", effect() { mod.nailBotCount++; b.nailBot(); }, remove() { mod.nailBotCount = 0; } }, { name: "foam-bot", description: "a bot fires foam at targets in line of sight", maxCount: 9, count: 0, allowed() { return true }, requires: "", effect() { mod.foamBotCount++; b.foamBot(); }, remove() { mod.foamBotCount = 0; } }, { name: "scrap bots", description: "+12% chance to build a bot after killing a mob
the bot will follow you until you exit the map", maxCount: 6, count: 0, allowed() { return mod.foamBotCount + mod.nailBotCount + mod.laserBotCount > 0 }, requires: "a bot", effect() { mod.isBotSpawner += 0.12; }, remove() { mod.isBotSpawner = 0; } }, { name: "self-replication", description: "duplicate your permanent bots
remove 80% of your ammo", maxCount: 1, count: 0, isNonRefundable: true, allowed() { return mod.foamBotCount + mod.nailBotCount + mod.laserBotCount > 2 }, requires: "3 or more bots", 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.2); } } //double bots for (let i = 0; i < mod.nailBotCount; i++) { b.nailBot(); } mod.nailBotCount *= 2 for (let i = 0; i < mod.laserBotCount; i++) { b.laserBot(); } mod.laserBotCount *= 2 for (let i = 0; i < mod.foamBotCount; i++) { b.foamBot(); } mod.foamBotCount *= 2 }, remove() {} }, // { // name: "ablative mines", // description: "rebuild your broken parts as a mine
chance to occur after being harmed", // maxCount: 1, // count: 0, // allowed() { // return true // }, // requires: "", // effect() { // mod.isMineOnDamage = true; // b.mine({ // x: mech.pos.x, // y: mech.pos.y - 80 // }, { // x: 0, // y: 0 // }) // }, // remove() { // mod.isMineOnDamage = false; // } // }, { name: "ablative drones", description: "rebuild your broken parts as drones
chance to occur after being harmed", maxCount: 1, count: 0, allowed() { return true }, requires: "", effect() { mod.isDroneOnDamage = true; for (let i = 0; i < 4; i++) { b.drone() //spawn drone } }, remove() { mod.isDroneOnDamage = false; } }, { name: "zoospore vector", description: "mobs discharge spores on death
+11% chance", maxCount: 9, count: 0, allowed() { return true }, requires: "", effect() { mod.sporesOnDeath += 0.11; for (let i = 0; i < 10; i++) { b.spore(player) } }, remove() { mod.sporesOnDeath = 0; } }, { name: "thermal runaway", description: "mobs explode when they die
be careful", maxCount: 1, count: 0, allowed() { return true }, requires: "", effect: () => { mod.isExplodeMob = true; }, remove() { mod.isExplodeMob = false; } }, { name: "impact shear", description: "mobs release +2 nails when they die
nails target nearby mobs", maxCount: 9, count: 0, allowed() { return true }, requires: "", effect: () => { mod.nailsDeathMob += 2 }, remove() { mod.nailsDeathMob = 0; } }, { name: "reaction inhibitor", description: "mobs die if their life goes below 12%", maxCount: 1, count: 0, allowed() { return true }, requires: "", effect: () => { mod.mobDieAtHealth = 0.15 }, remove() { mod.mobDieAtHealth = 0.05; } }, { name: "scrap recycling", description: "heal up to 1% of max health every second
active for 5 seconds after a mob dies", maxCount: 1, count: 0, allowed() { return !mod.isEnergyHealth }, requires: "not mass-energy equivalence", effect() { mod.isHealthRecovery = true; }, remove() { mod.isHealthRecovery = false; } }, { name: "waste energy recovery", description: "regen 6% of max energy every second
active for 5 seconds after a mob dies", maxCount: 1, count: 0, allowed() { return true }, requires: "", effect() { mod.isEnergyRecovery = true; }, remove() { mod.isEnergyRecovery = false; } }, { name: "squirrel-cage rotor", description: "jump higher and move faster
reduced harm from falling ", maxCount: 9, count: 0, allowed() { return true }, requires: "", effect() { // good with melee builds, content skipping builds mod.squirrelFx += 0.2; mech.Fx = 0.016 * mod.squirrelFx; mech.jumpForce += 0.038; }, remove() { mod.squirrelFx = 1; mech.Fx = 0.016; //if this changes update the values in definePlayerMass mech.jumpForce = 0.42; //was 0.38 at 0.0019 gravity } }, { name: "Pauli exclusion", description: `immune to harm for +1 seconds
activates after being harmed from a collision`, maxCount: 9, count: 0, allowed() { return true }, requires: "", effect() { mod.collisionImmuneCycles += 60; mech.immuneCycle = mech.cycle + mod.collisionImmuneCycles; //player is immune to collision damage for 30 cycles }, remove() { mod.collisionImmuneCycles = 30; } }, { name: "clock gating", description: `reduce all harm by 15%
slow time by 50% after receiving harm`, maxCount: 1, count: 0, allowed() { return game.fpsCapDefault > 45 }, requires: "FPS above 45", effect() { mod.isSlowFPS = true; }, remove() { mod.isSlowFPS = false; } }, { name: "entanglement", nameInfo: "", description: "16% less harm for each gun in your inventory
while your first gun is equipped", maxCount: 1, count: 0, allowed() { return true }, requires: "", effect() { mod.isEntanglement = true setTimeout(function () { game.boldActiveGunHUD(); }, 1000); }, remove() { mod.isEntanglement = false; } }, { name: "mass-energy equivalence", description: "you can't die if your energy is above zero
your health is permanently set to zero", maxCount: 1, count: 0, allowed() { return !mod.isPiezo && !mod.isEnergyLoss }, requires: "not piezoelectricity
or acute stress response", effect: () => { mech.health = 0 mod.onHealthChange(); mech.displayHealth(); document.getElementById("health-bg").style.display = "none" document.getElementById("dmg").style.backgroundColor = "#0cf"; mod.isEnergyHealth = true; }, remove() { mod.isEnergyHealth = false; document.getElementById("health-bg").style.display = "inline" document.getElementById("dmg").style.backgroundColor = "#f67"; mech.health = mech.energy; } }, { name: "piezoelectricity", description: "colliding with mobs fills your energy
15% less harm from mob collisions", maxCount: 1, count: 0, allowed() { return !mod.isEnergyHealth }, requires: "not mass-energy equivalence", effect() { mod.isPiezo = true; mech.energy = mech.maxEnergy; }, remove() { mod.isPiezo = false; } }, { name: "ground state", description: "reduce harm by 50%
you no longer passively regenerate energy", maxCount: 1, count: 0, allowed() { return mod.isPiezo }, requires: "piezoelectricity", effect: () => { mod.energyRegen = 0; mech.fieldRegen = mod.energyRegen; }, remove() { mod.energyRegen = 0.001; mech.fieldRegen = mod.energyRegen; } }, { name: "energy conservation", description: "+13% of damage done recovered as energy", maxCount: 9, count: 0, allowed() { return true }, requires: "", effect() { mod.energySiphon += 0.13; }, remove() { mod.energySiphon = 0; } }, { name: "entropy exchange", description: "heal for +1.5% of damage done", maxCount: 9, count: 0, allowed() { return !mod.isEnergyHealth }, requires: "not mass-energy equivalence", effect() { mod.healthDrain += 0.015; }, remove() { mod.healthDrain = 0; } }, { name: "overcharge", description: "increase your maximum energy by +50%", maxCount: 9, count: 0, allowed() { return true }, requires: "", effect() { mech.maxEnergy += 0.5 mech.energy += 0.5 }, remove() { mech.maxEnergy = 1; } }, { name: "supersaturation", description: "increase your maximum health by +50%", maxCount: 9, count: 0, allowed() { return !mod.isEnergyHealth }, requires: "not mass-energy equivalence", effect() { mech.maxHealth += 0.50 mech.addHealth(0.50) }, remove() { mech.maxHealth = 1; mod.onHealthChange(); mech.displayHealth(); } }, { name: "recursive healing", description: "healing power ups trigger +1 more time", maxCount: 9, count: 0, allowed() { return (mech.health < 0.7 || build.isCustomSelection) && !mod.isEnergyHealth }, requires: "not mass-energy equivalence", effect() { mod.recursiveHealing += 1 }, remove() { mod.recursiveHealing = 1; } }, { name: "pair production", description: "power ups overfill your energy
temporarily gain twice your max energy", maxCount: 1, count: 0, allowed() { return true }, requires: "", effect: () => { mod.isMassEnergy = true // used in mech.grabPowerUp mech.energy = mech.maxEnergy * 2 }, remove() { mod.isMassEnergy = false; } }, { name: "Bayesian inference", description: "37% chance for double power ups to drop
ammo will no longer spawn", maxCount: 1, count: 0, allowed() { return true }, requires: "", effect: () => { mod.bayesian = 0.37; }, remove() { mod.bayesian = 0; } }, { name: "catabolism", description: "gain ammo when you fire while out of ammo
drains 3% of current remaining health", maxCount: 1, count: 0, allowed() { return !mod.isEnergyHealth }, requires: "not mass-energy equivalence", effect: () => { mod.isAmmoFromHealth = 0.03; }, remove() { mod.isAmmoFromHealth = 0; } }, { name: "cardinality", description: "2 extra choices when selecting power ups", maxCount: 1, count: 0, allowed() { return !mod.isDeterminism }, requires: "not determinism", effect: () => { mod.isExtraChoice = true; }, remove() { mod.isExtraChoice = false; } }, { name: "determinism", description: "spawn 5 mods
power ups are limited to one choice", maxCount: 1, count: 0, // isNonRefundable: true, allowed() { return !mod.isExtraChoice }, requires: "not cardinality", effect: () => { mod.isDeterminism = true; for (let i = 0; i < 5; i++) { //if you change the six also change it in Born rule powerUps.spawn(mech.pos.x, mech.pos.y, "mod"); if (Math.random() < mod.bayesian) powerUps.spawn(mech.pos.x, mech.pos.y, "mod"); } }, remove() { mod.isDeterminism = false; } }, { name: "many-worlds", description: "after choosing a gun, field, or mod
spawn a reroll, if you have none", maxCount: 1, count: 0, allowed() { return true }, requires: "", effect: () => { mod.manyWorlds = true; }, remove() { mod.manyWorlds = false; } }, { name: "anthropic principle", nameInfo: "", description: "heal to 50% health instead of dying
consumes 1 reroll", maxCount: 1, count: 0, allowed() { return powerUps.reroll.rerolls > 0 || build.isCustomSelection }, requires: "at least 1 reroll", effect() { mod.isDeathAvoid = true; setTimeout(function () { powerUps.reroll.changeRerolls(0) }, 1000); }, remove() { mod.isDeathAvoid = false; } }, { name: "quantum immortality", description: "after dying, continue in an alternate reality
spawn 3 rerolls", maxCount: 1, count: 0, allowed() { return true }, requires: "", effect() { mod.isImmortal = true; powerUps.spawn(mech.pos.x, mech.pos.y, "reroll", false); powerUps.spawn(mech.pos.x, mech.pos.y, "reroll", false); powerUps.spawn(mech.pos.x, mech.pos.y, "reroll", false); }, remove() { mod.isImmortal = false; } }, { name: "Born rule", description: "remove all current mods
spawn new mods to replace them", maxCount: 1, count: 0, isNonRefundable: true, allowed() { return (mod.totalCount > 6) && !build.isCustomSelection }, requires: "more than 6 mods", effect: () => { //remove bullets //mostly to get rid of bots for (let i = 0; i < bullet.length; ++i) Matter.World.remove(engine.world, bullet[i]); bullet = []; let count = mod.totalCount + 1 if (mod.isDeterminism) count -= 5 //remove the 5 bonus mods when getting rid of determinism mod.setupAllMods(); // remove all mods for (let i = 0; i < count; i++) { // spawn new mods power ups powerUps.spawn(mech.pos.x, mech.pos.y, "mod"); } //have state is checked in mech.death() }, remove() {} }, { name: "reallocation", description: "convert 1 random mod into 2 new guns
recursive mods lose all stacks", maxCount: 1, count: 0, isNonRefundable: true, allowed() { return (mod.totalCount > 0) && !build.isCustomSelection }, requires: "at least 1 mod", effect: () => { 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)] mod.mods[choose].remove(); // remove a random mod form the list of mods you have mod.mods[choose].count = 0; game.updateModHUD(); for (let i = 0; i < 2; i++) { powerUps.spawn(mech.pos.x, mech.pos.y, "gun"); if (Math.random() < mod.bayesian) powerUps.spawn(mech.pos.x, mech.pos.y, "gun"); } }, remove() {} }, //************************************************** //************************************************** gun //************************************************** mods //************************************************** { name: "Lorentzian topology", description: "your bullets last +33% longer", maxCount: 3, count: 0, allowed() { return mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing" || mod.haveGunCheck("spores") || mod.haveGunCheck("drones") || mod.haveGunCheck("super balls") || mod.haveGunCheck("foam") || mod.haveGunCheck("wave beam") || mod.haveGunCheck("ice IX") || mod.haveGunCheck("neutron bomb") }, requires: "drones, spores, super balls, foam
wave beam, ice IX, neutron bomb", effect() { mod.isBulletsLastLonger += 0.33 }, remove() { mod.isBulletsLastLonger = 1; } }, { name: "microstates", description: "+7% damage for every 10 active bullets", maxCount: 1, count: 0, allowed() { return mod.isBulletsLastLonger > 1 }, requires: "Lorentzian topology", effect() { mod.isDamageFromBulletCount = true }, remove() { mod.isDamageFromBulletCount = false } }, { name: "fluoroantimonic acid", nameInfo: "", description: "each bullet does instant acid damage
active when you are above 80% base health", maxCount: 1, count: 0, allowed() { return (mech.health > 0.8 || build.isCustomSelection) && (mod.haveGunCheck("mine") || mod.haveGunCheck("minigun") || mod.haveGunCheck("shotgun") || mod.haveGunCheck("super balls") || mod.haveGunCheck("spores") || mod.haveGunCheck("drones") || mod.haveGunCheck("ice IX")) }, requires: "health above 80%", effect() { mod.isAcidDmg = true; mod.onHealthChange(); }, remove() { mod.acidDmg = 0; mod.isAcidDmg = false; game.playerDmgColor = "rgba(0,0,0,0.7)" } }, { name: "depleted uranium rounds", description: `your bullets are +16% larger
increased mass and physical damage`, count: 0, maxCount: 9, allowed() { return mod.haveGunCheck("minigun") || mod.haveGunCheck("shotgun") || mod.haveGunCheck("super balls") }, requires: "minigun, shotgun, super balls", effect() { mod.bulletSize += 0.16 }, remove() { mod.bulletSize = 1; } }, { name: "ice crystal nucleation", description: "your minigun uses energy to condense
unlimited freezing bullets from water vapor", maxCount: 1, count: 0, allowed() { return mod.haveGunCheck("minigun") }, requires: "minigun", effect() { mod.isIceCrystals = true; for (i = 0, len = b.guns.length; i < len; i++) { //find which gun if (b.guns[i].name === "minigun") { b.guns[i].ammoPack = Infinity b.guns[i].recordedAmmo = b.guns[i].ammo b.guns[i].ammo = Infinity game.updateGunHUD(); break; } } }, remove() { mod.isIceCrystals = false; for (i = 0, len = b.guns.length; i < len; i++) { //find which gun if (b.guns[i].name === "minigun") { b.guns[i].ammoPack = b.guns[i].defaultAmmoPack; b.guns[i].ammo = b.guns[i].recordedAmmo game.updateGunHUD(); break; } } } }, { name: "shotgun spin-statistics", description: "firing the shotgun makes you
immune to harm while on cooldown", maxCount: 1, count: 0, allowed() { return mod.haveGunCheck("shotgun") }, requires: "shotgun", effect() { mod.isShotgunImmune = true; }, remove() { mod.isShotgunImmune = false; } }, { name: "nailshot", description: "the shotgun fires nails
effective at a distance", maxCount: 1, count: 0, allowed() { return mod.haveGunCheck("shotgun") }, requires: "shotgun", effect() { mod.isNailShot = true; }, remove() { mod.isNailShot = false; } }, { name: "super duper", description: "fire +2 additional super balls", maxCount: 9, count: 0, allowed() { return mod.haveGunCheck("super balls") && !mod.oneSuperBall }, requires: "super balls", effect() { mod.superBallNumber += 2 }, remove() { mod.superBallNumber = 4; } }, { name: "super ball", description: "fire one large super ball
that stuns mobs for 3 second", maxCount: 1, count: 0, allowed() { return mod.haveGunCheck("super balls") && mod.superBallNumber === 4 }, requires: "super balls", effect() { mod.oneSuperBall = true; }, remove() { mod.oneSuperBall = false; } }, { name: "flechettes cartridges", description: "flechettes release three needles in each shot
ammo cost are increases by 3x", maxCount: 1, count: 0, allowed() { return mod.haveGunCheck("flechettes") }, requires: "flechettes", effect() { mod.isFlechetteMultiShot = true; //cut current ammo by 1/3 for (i = 0, len = b.guns.length; i < len; i++) { //find which gun if (b.guns[i].name === "flechettes") b.guns[i].ammo = Math.ceil(b.guns[i].ammo / 3); } //cut ammo packs by 1/3 for (i = 0, len = b.guns.length; i < len; i++) { //find which gun if (b.guns[i].name === "flechettes") b.guns[i].ammoPack = Math.ceil(b.guns[i].defaultAmmoPack / 3); } game.updateGunHUD(); }, remove() { mod.isFlechetteMultiShot = false; for (i = 0, len = b.guns.length; i < len; i++) { //find which gun if (b.guns[i].name === "flechettes") b.guns[i].ammo = Math.ceil(b.guns[i].ammo * 3); } for (i = 0, len = b.guns.length; i < len; i++) { //find which gun if (b.guns[i].name === "flechettes") b.guns[i].ammoPack = b.guns[i].defaultAmmoPack; } game.updateGunHUD(); } }, { name: "irradiated needles", description: "needles are exposed to plutonium-238
2x damage spread over 6 seconds", maxCount: 1, count: 0, allowed() { return mod.haveGunCheck("flechettes") }, requires: "flechettes", effect() { mod.isDotFlechette = true; }, remove() { mod.isDotFlechette = false; } }, { name: "piercing needles", description: "needles penetrate mobs
potentially hitting multiple targets", maxCount: 1, count: 0, allowed() { return mod.haveGunCheck("flechettes") }, requires: "flechettes", effect() { mod.pierce = true; }, remove() { mod.pierce = false; } }, { name: "wave packet", description: "wave beam emits two oscillating particles
wave particles do 40% less damage", maxCount: 1, count: 0, allowed() { return mod.haveGunCheck("wave beam") }, requires: "wave beam", effect() { mod.waveHelix = 2 }, remove() { mod.waveHelix = 1 } }, { name: "phase velocity", description: "the wave beam propagates faster in solids", maxCount: 1, count: 0, allowed() { return mod.haveGunCheck("wave beam") && !mod.isWaveReflect }, requires: "wave beam", effect() { mod.waveSpeedMap = 3 //needs to be 3 for pocket universe require check mod.waveSpeedBody = 1.9 }, remove() { mod.waveSpeedMap = 0.08 mod.waveSpeedBody = 0.25 } }, { name: "pocket universe", description: "wave beam bullets last 5x longer
bullets are confined to a region around player", maxCount: 1, count: 0, allowed() { return mod.haveGunCheck("wave beam") && mod.waveSpeedMap !== 3 }, requires: "wave beam", effect() { mod.isWaveReflect = true }, remove() { mod.isWaveReflect = false } }, { name: "high explosives", description: "explosions do +20% more damage
explosive area is +44% larger", maxCount: 3, count: 0, allowed() { return mod.haveGunCheck("missiles") || mod.haveGunCheck("flak") || mod.haveGunCheck("grenades") || mod.haveGunCheck("vacuum bomb") || mod.haveGunCheck("pulse") || mod.isMissileField; }, requires: "an explosive gun", effect: () => { mod.explosionRadius += 0.2; }, remove() { mod.explosionRadius = 1; } }, { name: "electric reactive armor", description: "explosions give you energy
instead of harming you", maxCount: 1, count: 0, allowed() { return mod.haveGunCheck("missiles") || mod.haveGunCheck("flak") || mod.haveGunCheck("grenades") || mod.haveGunCheck("vacuum bomb") || mod.haveGunCheck("pulse") || mod.isMissileField; }, requires: "an explosive gun", effect: () => { mod.isImmuneExplosion = true; }, remove() { mod.isImmuneExplosion = false; } }, { name: "recursion", description: "after missiles explode
they launch +1 smaller missile", maxCount: 9, count: 0, allowed() { return mod.haveGunCheck("missiles") || mod.isMissileField }, requires: "missiles", effect() { mod.babyMissiles++ }, remove() { mod.babyMissiles = 0; } }, { name: "MIRV", description: "launch 3 small missiles instead of 1
1.5x increase in delay after firing", maxCount: 1, count: 0, allowed() { return mod.haveGunCheck("missiles") }, requires: "missiles", effect() { mod.is3Missiles = true; }, remove() { mod.is3Missiles = false; } }, { name: "optimized shell packing", description: "flak ammo drops contain 3x more shells", maxCount: 3, count: 0, allowed() { return mod.haveGunCheck("flak") }, requires: "flak", effect() { for (i = 0, len = b.guns.length; i < len; i++) { //find which gun if (b.guns[i].name === "flak") b.guns[i].ammoPack = b.guns[i].defaultAmmoPack * (3 + this.count); } }, remove() { for (i = 0, len = b.guns.length; i < len; i++) { //find which gun if (b.guns[i].name === "flak") b.guns[i].ammoPack = b.guns[i].defaultAmmoPack; } } }, { name: "fragmentation grenade", description: "grenades are loaded with +5 nails
on detonation nails are ejected towards mobs", maxCount: 9, count: 0, allowed() { return mod.haveGunCheck("grenades") }, requires: "grenades", effect() { mod.grenadeFragments += 5 }, remove() { mod.grenadeFragments = 0 } }, { name: "rocket-propelled grenade", description: "grenades are rapidly accelerated forward
map collisions trigger an explosion", maxCount: 1, count: 0, allowed() { return mod.haveGunCheck("grenades") }, requires: "grenades", effect() { mod.isRPG = true; }, remove() { mod.isRPG = false; } }, { name: "electromagnetic pulse", description: "vacuum bomb's explosion destroys shields
and does 20% more damage", maxCount: 1, count: 0, allowed() { return mod.haveGunCheck("vacuum bomb") }, requires: "vacuum bomb", effect() { mod.isVacuumShield = true; }, remove() { mod.isVacuumShield = false; } }, { name: "water shielding", description: "increase neutron bomb's range by 20%
player is immune to its harmful effects", maxCount: 1, count: 0, allowed() { return mod.haveGunCheck("neutron bomb") }, requires: "neutron bomb", effect() { mod.isNeutronImmune = true }, remove() { mod.isNeutronImmune = false } }, { name: "inertial confinement", description: "neutron bomb's initial detonation
stuns nearby mobs for +1 seconds", maxCount: 3, count: 0, allowed() { return mod.haveGunCheck("neutron bomb") }, requires: "neutron bomb", effect() { mod.isNeutronStun += 60; }, remove() { mod.isNeutronStun = 0; } }, { name: "mine reclamation", description: "retrieve ammo from all undetonated mines
and 20% of mines after detonation", maxCount: 1, count: 0, allowed() { return mod.haveGunCheck("mine") }, requires: "mine", effect() { mod.isMineAmmoBack = true; }, remove() { mod.isMineAmmoBack = false; } }, { name: "irradiated nails", description: "nails are made with a cobalt-60 alloy
66% extra damage over 6 seconds", maxCount: 1, count: 0, allowed() { return mod.nailBotCount + mod.grenadeFragments + mod.nailsDeathMob > 1 || mod.haveGunCheck("mine") || mod.isRailNails || mod.isNailShot }, requires: "nails", effect() { mod.isNailPoison = true; }, remove() { mod.isNailPoison = false; } }, { name: "tinsellated flagella", description: "spores accelerate 50% faster", maxCount: 1, count: 0, allowed() { return mod.haveGunCheck("spores") || mod.sporesOnDeath > 0 || mod.isSporeField }, requires: "spores", effect() { mod.isFastSpores = true }, remove() { mod.isFastSpores = false } }, { name: "diplochory", description: "spores use the player for dispersal
until they locate a viable host", maxCount: 1, count: 0, allowed() { return mod.haveGunCheck("spores") || mod.sporesOnDeath > 0 || mod.isSporeField }, requires: "spores", effect() { mod.isSporeFollow = true }, remove() { mod.isSporeFollow = false } }, { name: "mutualism", description: "spores do 2x damage
spores borrow 1% health until they die", maxCount: 1, count: 0, allowed() { return mod.haveGunCheck("spores") || mod.sporesOnDeath > 0 || mod.isSporeField }, requires: "spores", effect() { mod.isMutualism = true }, remove() { mod.isMutualism = false } }, { name: "brushless motor", description: "drones accelerate 50% faster", maxCount: 1, count: 0, allowed() { return mod.haveGunCheck("drones") || (mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing" && !(mod.isSporeField || mod.isMissileField || mod.isIceField)) }, requires: "drones", effect() { mod.isFastDrones = true }, remove() { mod.isFastDrones = false } }, { name: "heavy water", description: "ice IX is synthesized with unstable isotopes
does radioactive damage over 3 seconds", maxCount: 1, count: 0, allowed() { return mod.haveGunCheck("ice IX") || (mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing" && mod.isIceField) }, requires: "ice IX", effect() { mod.isAlphaRadiation = true }, remove() { mod.isAlphaRadiation = false; } }, { name: "necrophoresis", description: "foam splits into 3 copies
when the mob it is stuck to dies", maxCount: 1, count: 0, allowed() { return mod.haveGunCheck("foam") || mod.foamBotCount > 1 }, requires: "foam", effect() { mod.isFoamGrowOnDeath = true }, remove() { mod.isFoamGrowOnDeath = false; } }, { name: "fragmenting projectiles", description: "rail gun fragments into nails
after hitting mobs at high speeds", maxCount: 1, count: 0, allowed() { return mod.haveGunCheck("rail gun") }, requires: "rail gun", effect() { mod.isRailNails = true; }, remove() { mod.isRailNails = false; } }, { name: "laser diodes", description: "lasers drain 37% less energy
effects laser gun, pulse gun, and laser-bot", maxCount: 1, count: 0, allowed() { return mod.haveGunCheck("pulse") || mod.haveGunCheck("laser") || mod.laserBotCount > 1 }, requires: "laser", effect() { mod.isLaserDiode = 0.63; //100%-37% }, remove() { mod.isLaserDiode = 1; } }, { name: "specular reflection", description: "laser beams gain +1 reflection
+50% laser damage and energy drain", maxCount: 9, count: 0, allowed() { return mod.haveGunCheck("laser") }, requires: "laser", effect() { mod.laserReflections++; mod.laserDamage += 0.045; //base is 0.08 mod.laserFieldDrain += 0.001 //base is 0.002 }, remove() { mod.laserReflections = 2; mod.laserDamage = 0.09; mod.laserFieldDrain = 0.002; } }, { name: "shock wave", description: "mobs caught in pulse's explosion are stunned", maxCount: 1, count: 0, allowed() { return mod.haveGunCheck("pulse") }, requires: "pulse", effect() { mod.isPulseStun = true; }, remove() { mod.isPulseStun = false; } }, //************************************************** //************************************************** field //************************************************** mods //************************************************** { name: "flux pinning", description: "blocking with perfect diamagnetism
stuns mobs for +1 second", maxCount: 9, count: 0, allowed() { return mech.fieldUpgrades[mech.fieldMode].name === "perfect diamagnetism" }, requires: "perfect diamagnetism", effect() { mod.isStunField += 60; }, remove() { mod.isStunField = 0; } }, { name: "timelike world line", description: "time dilation increases your time rate by 2x
while energy drain is decreased by 2x", maxCount: 1, count: 0, allowed() { return mech.fieldUpgrades[mech.fieldMode].name === "time dilation field" }, requires: "time dilation field", effect() { mod.isTimeSkip = true; }, remove() { mod.isTimeSkip = false; } }, { name: "plasma jet", description: "increase plasma torch's range by 33%", maxCount: 9, count: 0, allowed() { return mech.fieldUpgrades[mech.fieldMode].name === "plasma torch" }, requires: "plasma torch", effect() { mod.isPlasmaRange += 0.33; }, remove() { mod.isPlasmaRange = 1; } }, { name: "degenerate matter", description: "negative mass field
harm reduction is increased to 80%", maxCount: 1, count: 0, allowed() { return mech.fieldUpgrades[mech.fieldMode].name === "negative mass field" }, requires: "negative mass field", effect() { mod.isHarmReduce = true mech.fieldHarmReduction = 0.2; }, remove() { mod.isHarmReduce = false; if (mech.fieldUpgrades[mech.fieldMode].name === "negative mass field") mech.setField("negative mass field") //reset harm reduction } }, { name: "annihilation", description: "after touching mobs, they are annihilated", maxCount: 1, count: 0, allowed() { return mech.fieldUpgrades[mech.fieldMode].name === "negative mass field" }, requires: "negative mass field", effect() { mod.isAnnihilation = true }, remove() { mod.isAnnihilation = false; } }, { name: "Hawking radiation", description: "negative mass field leaks virtual particles
mobs inside the field take damage", maxCount: 1, count: 0, allowed() { return mech.fieldUpgrades[mech.fieldMode].name === "negative mass field" }, requires: "negative mass field", effect() { mod.isHawking = true; }, remove() { mod.isHawking = 0; } }, { name: "bremsstrahlung radiation", description: "blocking with your field does damage", maxCount: 9, count: 0, allowed() { return mech.fieldUpgrades[mech.fieldMode].name === "standing wave harmonics" }, requires: "standing wave harmonics", effect() { mod.blockDmg += 0.5 //if you change this value also update the for loop in the electricity graphics in mech.pushMass }, remove() { mod.blockDmg = 0; } }, { name: "frequency resonance", description: "standing wave harmonics shield is retuned
increase size and blocking efficiency by 40%", maxCount: 9, count: 0, allowed() { return mech.fieldUpgrades[mech.fieldMode].name === "standing wave harmonics" }, requires: "standing wave harmonics", effect() { mech.fieldRange += 175 * 0.21 mech.fieldShieldingScale *= 0.6 }, remove() { mech.fieldRange = 175; mech.fieldShieldingScale = 1; } }, { name: "mycelium manufacturing", description: "nano-scale manufacturing is repurposed
excess energy used to grow spores", maxCount: 1, count: 0, allowed() { return mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing" && !(mod.isMissileField || mod.isIceField || mod.isFastDrones) }, requires: "nano-scale manufacturing", effect() { mod.isSporeField = true; }, remove() { mod.isSporeField = false; } }, { name: "missile manufacturing", description: "nano-scale manufacturing is repurposed
excess energy used to construct missiles", maxCount: 1, count: 0, allowed() { return mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing" && !(mod.isSporeField || mod.isIceField || mod.isFastDrones) }, requires: "nano-scale manufacturing", effect() { mod.isMissileField = true; }, remove() { mod.isMissileField = false; } }, { name: "ice IX manufacturing", description: "nano-scale manufacturing is repurposed
excess energy used to synthesize ice IX", maxCount: 1, count: 0, allowed() { return mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing" && !(mod.isSporeField || mod.isMissileField || mod.isFastDrones) }, requires: "nano-scale manufacturing", effect() { mod.isIceField = true; }, remove() { mod.isIceField = false; } }, { name: "renormalization", description: "phase decoherence adds visibility to bullets
5x less energy drain when firing", maxCount: 1, count: 0, allowed() { return mech.fieldUpgrades[mech.fieldMode].name === "phase decoherence field" }, requires: "phase decoherence field", effect() { mod.renormalization = true; }, remove() { mod.renormalization = false; } }, { name: "superposition", // description: "phase decoherence field applies a stun
to unshielded mobs for 2 seconds", description: "while phase decoherence field is active
mobs that overlap with the player are stunned", maxCount: 1, count: 0, allowed() { return mech.fieldUpgrades[mech.fieldMode].name === "phase decoherence field" }, requires: "phase decoherence field", effect() { mod.superposition = true; }, remove() { mod.superposition = false; } }, { name: "Bose Einstein condensate", description: "mobs in superposition with the pilot wave
are frozen for 2 seconds", maxCount: 1, count: 0, allowed() { return mech.fieldUpgrades[mech.fieldMode].name === "pilot wave" }, requires: "pilot wave", effect() { mod.isPilotFreeze = true }, remove() { mod.isPilotFreeze = false } }, ], //variables use for gun mod upgrades fireRate: null, explosionRadius: null, bulletSize: null, energySiphon: null, healthDrain: null, noAmmo: null, isBulletsLastLonger: null, isImmortal: null, sporesOnDeath: null, isImmuneExplosion: null, isExplodeMob: null, isDroneOnDamage: null, // isMineOnDamage: null, acidDmg: null, isAcidDmg: null, isAnnihilation: null, recursiveHealing: null, squirrelFx: null, isCrit: null, bayesian: null, isLowHealthDmg: null, isFarAwayDmg: null, isEntanglement: null, isMassEnergy: null, isExtraChoice: null, laserBotCount: null, nailBotCount: null, foamBotCount: null, collisionImmuneCycles: null, blockDmg: null, isPiezo: null, isFastDrones: null, isFastSpores: null, superBallNumber: null, oneSuperBall: null, laserReflections: null, laserDamage: null, laserFieldDrain: null, isAmmoFromHealth: null, mobDieAtHealth: null, isEnergyRecovery: null, isHealthRecovery: null, isEnergyLoss: null, isDeathAvoid: null, waveSpeedMap: null, waveSpeedBody: null, isSporeField: null, isMissileField: null, isIceField: null, isFlechetteMultiShot: null, isMineAmmoBack: null, isPlasmaRange: null, isRailNails: null, isHawking: null, babyMissiles: null, isIceCrystals: null, throwChargeRate: null, isBlockStun: null, isStunField: null, isHarmDamage: null, isAlphaRadiation: null, energyRegen: null, isVacuumShield: null, renormalization: null, grenadeFragments: null, isEnergyDamage: null, isBotSpawner: null, waveHelix: null, isSporeFollow: null, isNailPoison: null, isEnergyHealth: null, isPulseStun: null, isPilotFreeze: null, isRest: null, isRPG: null, is3Missiles: null, isDeterminism: null, isHarmReduce: null, nailsDeathMob: null, isSlowFPS: null, isNeutronStun: null, manyWorlds: null, isDamageFromBulletCount: null, isLaserDiode: null, isNailShot: null }