added requirement text, thermal runaway mod

This commit is contained in:
landgreen
2020-02-17 18:32:10 -08:00
parent b9ecfbc997
commit 3ec77ed6fa
7 changed files with 138 additions and 66 deletions

View File

@@ -15,6 +15,7 @@ const b = {
isModImmortal: null, isModImmortal: null,
modSpores: null, modSpores: null,
isModImmuneExplosion: null, isModImmuneExplosion: null,
isModExplodeMob: null,
isModDroneOnDamage: null, isModDroneOnDamage: null,
modAcidDmg: null, modAcidDmg: null,
isModAcidDmg: null, isModAcidDmg: null,
@@ -61,8 +62,9 @@ const b = {
count: 0, count: 0,
maxCount: 9, maxCount: 9,
allowed() { allowed() {
return true return b.haveGunCheck("minigun") || b.haveGunCheck("shotgun") || b.haveGunCheck("super balls") || b.haveGunCheck("foam")
}, },
requires: "minigun, shotgun, super balls, foam",
effect() { effect() {
b.modBulletSize += 0.13 b.modBulletSize += 0.13
}, },
@@ -76,8 +78,9 @@ const b = {
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
return mech.health > 0.8 || level.isBuildRun return mech.health > 0.8 || build.isCustomSelection
}, },
requires: "health above 80%",
effect() { effect() {
b.isModAcidDmg = true; b.isModAcidDmg = true;
b.modOnHealthChange(); b.modOnHealthChange();
@@ -88,21 +91,6 @@ const b = {
game.playerDmgColor = "rgba(0,0,0,0.7)" game.playerDmgColor = "rgba(0,0,0,0.7)"
} }
}, },
{
name: "fracture analysis",
description: "<strong>5x</strong> physical <strong class='color-d'>damage</strong> to unaware enemies<br><em>unaware enemies don't have a health bar</em>",
maxCount: 1,
count: 0,
allowed() {
return true
},
effect() {
b.isModCrit = true;
},
remove() {
b.isModCrit = false;
}
},
{ {
name: "kinetic bombardment", name: "kinetic bombardment",
description: "do up to 33% more <strong class='color-d'>damage</strong> at a distance<br><em>increase maxes out at about 40 steps away</em>", description: "do up to 33% more <strong class='color-d'>damage</strong> at a distance<br><em>increase maxes out at about 40 steps away</em>",
@@ -111,6 +99,7 @@ const b = {
allowed() { allowed() {
return true return true
}, },
requires: "",
effect() { effect() {
b.isModFarAwayDmg = true; //used in mob.damage() b.isModFarAwayDmg = true; //used in mob.damage()
}, },
@@ -118,14 +107,31 @@ const b = {
b.isModFarAwayDmg = false; b.isModFarAwayDmg = false;
} }
}, },
{
name: "fracture analysis",
description: "<strong>5x</strong> physical <strong class='color-d'>damage</strong> to unaware enemies<br><em>unaware enemies don't have a health bar</em>",
maxCount: 1,
count: 0,
allowed() {
return b.isModFarAwayDmg
},
requires: "kinetic bombardment",
effect() {
b.isModCrit = true;
},
remove() {
b.isModCrit = false;
}
},
{ {
name: "quasistatic equilibrium", name: "quasistatic equilibrium",
description: "do extra <strong class='color-d'>damage</strong> at low health<br><em>up to <strong>50%</strong> increase when near death</em>", description: "do extra <strong class='color-d'>damage</strong> at low health<br><em>up to <strong>50%</strong> increase when near death</em>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
return mech.health < 0.75 || level.isBuildRun return mech.health < 0.8 || build.isCustomSelection
}, },
requires: "health below 80%",
effect() { effect() {
b.isModLowHealthDmg = true; //used in mob.damage() b.isModLowHealthDmg = true; //used in mob.damage()
}, },
@@ -133,6 +139,38 @@ const b = {
b.isModLowHealthDmg = false; b.isModLowHealthDmg = false;
} }
}, },
{
name: "reaction inhibitor",
description: "mobs <strong>die</strong> if their life goes below <strong>12%</strong>",
maxCount: 1,
count: 0,
allowed() {
return b.isModLowHealthDmg
},
requires: "quasistatic equilibrium",
effect: () => {
b.modMobDieAtHealth = 0.15
},
remove() {
b.modMobDieAtHealth = 0.05;
}
},
{
name: "thermal runaway",
description: "mobs <strong class='color-e'>explode</strong> when they <strong>die</strong>",
maxCount: 1,
count: 0,
allowed() {
return b.modMobDieAtHealth > 0.05
},
requires: "reaction inhibitor",
effect: () => {
b.isModExplodeMob = true;
},
remove() {
b.isModExplodeMob = false;
}
},
{ {
name: "high explosives", name: "high explosives",
description: "<strong class='color-e'>explosions</strong> do <strong>+20%</strong> more <strong class='color-d'>damage</strong><br><strong class='color-e'>explosive</strong> area is +44% <strong>larger</strong>", description: "<strong class='color-e'>explosions</strong> do <strong>+20%</strong> more <strong class='color-d'>damage</strong><br><strong class='color-e'>explosive</strong> area is +44% <strong>larger</strong>",
@@ -141,6 +179,7 @@ const b = {
allowed() { allowed() {
return b.haveGunCheck("missiles") || b.haveGunCheck("flak") || b.haveGunCheck("grenades") || b.haveGunCheck("vacuum bomb") || b.haveGunCheck("pulse"); return b.haveGunCheck("missiles") || b.haveGunCheck("flak") || b.haveGunCheck("grenades") || b.haveGunCheck("vacuum bomb") || b.haveGunCheck("pulse");
}, },
requires: "an explosive gun",
effect: () => { effect: () => {
b.modExplosionRadius += 0.2; b.modExplosionRadius += 0.2;
}, },
@@ -154,16 +193,17 @@ const b = {
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
return (b.modExplosionRadius > 1) return b.modExplosionRadius > 1
}, },
requires: "high explosives",
effect: () => { effect: () => {
b.isModImmuneExplosion = true; b.isModImmuneExplosion = true;
}, },
remove() { remove() {
b.isModImmuneExplosion = false; b.isModImmuneExplosion = false;
} }
}, },
{ {
name: "auto-loading heuristics", name: "auto-loading heuristics",
description: "your <strong>delay</strong> after firing is <strong>+14% shorter</strong>", description: "your <strong>delay</strong> after firing is <strong>+14% shorter</strong>",
@@ -172,6 +212,7 @@ const b = {
allowed() { allowed() {
return true return true
}, },
requires: "",
effect() { effect() {
b.modFireRate *= 0.86 b.modFireRate *= 0.86
}, },
@@ -187,6 +228,7 @@ const b = {
allowed() { allowed() {
return true return true
}, },
requires: "",
effect() { effect() {
b.modNoAmmo = 1 b.modNoAmmo = 1
}, },
@@ -202,6 +244,7 @@ const b = {
allowed() { allowed() {
return mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing" || b.haveGunCheck("spores") || b.haveGunCheck("drones") || b.haveGunCheck("super balls") || b.haveGunCheck("foam") return mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing" || b.haveGunCheck("spores") || b.haveGunCheck("drones") || b.haveGunCheck("super balls") || b.haveGunCheck("foam")
}, },
requires: "drones, spores, super balls, or foam",
effect() { effect() {
b.isModBulletsLastLonger += 0.33 b.isModBulletsLastLonger += 0.33
}, },
@@ -209,21 +252,7 @@ const b = {
b.isModBulletsLastLonger = 1; b.isModBulletsLastLonger = 1;
} }
}, },
{
name: "reaction inhibitor",
description: "mobs <strong>die</strong> if their life goes below <strong>12%</strong>",
maxCount: 1,
count: 0,
allowed() {
return true
},
effect: () => {
b.modMobDieAtHealth = 0.15
},
remove() {
b.modMobDieAtHealth = 0.05;
}
},
{ {
name: "zoospore vector", name: "zoospore vector",
description: "enemies discharge <strong style='letter-spacing: 2px;'>spores</strong> on <strong>death</strong><br>+11% chance", description: "enemies discharge <strong style='letter-spacing: 2px;'>spores</strong> on <strong>death</strong><br>+11% chance",
@@ -232,6 +261,7 @@ const b = {
allowed() { allowed() {
return true return true
}, },
requires: "",
effect() { effect() {
b.modSpores += 0.11; b.modSpores += 0.11;
for (let i = 0; i < 10; i++) { for (let i = 0; i < 10; i++) {
@@ -250,6 +280,7 @@ const b = {
allowed() { allowed() {
return true return true
}, },
requires: "",
effect() { effect() {
b.modLaserBotCount++; b.modLaserBotCount++;
b.laserBot(); b.laserBot();
@@ -266,6 +297,7 @@ const b = {
allowed() { allowed() {
return true return true
}, },
requires: "",
effect() { effect() {
b.modNailBotCount++; b.modNailBotCount++;
b.nailBot(); b.nailBot();
@@ -282,6 +314,7 @@ const b = {
allowed() { allowed() {
return true return true
}, },
requires: "",
effect() { effect() {
b.isModDroneOnDamage = true; b.isModDroneOnDamage = true;
for (let i = 0; i < 4; i++) { for (let i = 0; i < 4; i++) {
@@ -300,6 +333,7 @@ const b = {
allowed() { allowed() {
return mech.fieldUpgrades[mech.fieldMode].name !== "time dilation field" && mech.fieldUpgrades[mech.fieldMode].name !== "phase decoherence field" return mech.fieldUpgrades[mech.fieldMode].name !== "time dilation field" && mech.fieldUpgrades[mech.fieldMode].name !== "phase decoherence field"
}, },
requires: "not time dilation field<br><strong>requires</strong> not phase decoherence field",
effect() { effect() {
b.modBlockDmg += 0.7 //if you change this value also update the for loop in the electricity graphics in mech.pushMass b.modBlockDmg += 0.7 //if you change this value also update the for loop in the electricity graphics in mech.pushMass
}, },
@@ -315,6 +349,7 @@ const b = {
allowed() { allowed() {
return mech.fieldUpgrades[mech.fieldMode].name !== "time dilation field" && mech.fieldUpgrades[mech.fieldMode].name !== "phase decoherence field" return mech.fieldUpgrades[mech.fieldMode].name !== "time dilation field" && mech.fieldUpgrades[mech.fieldMode].name !== "phase decoherence field"
}, },
requires: "not time dilation field<br><strong>requires</strong> not phase decoherence field",
effect() { effect() {
mech.fieldRange = 175 * 1.4 mech.fieldRange = 175 * 1.4
}, },
@@ -330,6 +365,7 @@ const b = {
allowed() { allowed() {
return true return true
}, },
requires: "",
effect() { effect() {
b.isModEntanglement = true b.isModEntanglement = true
}, },
@@ -345,6 +381,7 @@ const b = {
allowed() { allowed() {
return true return true
}, },
requires: "",
effect() { effect() {
b.isModEnergyRecovery = true; b.isModEnergyRecovery = true;
}, },
@@ -360,6 +397,7 @@ const b = {
allowed() { allowed() {
return b.isModEnergyRecovery return b.isModEnergyRecovery
}, },
requires: "waste energy recovery",
effect() { effect() {
b.isModHealthRecovery = true; b.isModHealthRecovery = true;
}, },
@@ -375,6 +413,7 @@ const b = {
allowed() { allowed() {
return b.isModEnergyRecovery return b.isModEnergyRecovery
}, },
requires: "waste energy recovery",
effect() { effect() {
b.isModEnergyLoss = true; b.isModEnergyLoss = true;
}, },
@@ -390,6 +429,7 @@ const b = {
allowed() { allowed() {
return true return true
}, },
requires: "",
effect() { // good with melee builds, content skipping builds effect() { // good with melee builds, content skipping builds
b.modSquirrelFx += 0.2; b.modSquirrelFx += 0.2;
mech.Fx = 0.016 * b.modSquirrelFx; mech.Fx = 0.016 * b.modSquirrelFx;
@@ -409,6 +449,7 @@ const b = {
allowed() { allowed() {
return b.modSquirrelFx > 1 return b.modSquirrelFx > 1
}, },
requires: "squirrel-cage rotor",
effect() { effect() {
b.isModStomp = true b.isModStomp = true
}, },
@@ -424,6 +465,7 @@ const b = {
allowed() { allowed() {
return true return true
}, },
requires: "",
effect() { effect() {
b.modCollisionImmuneCycles += 120; b.modCollisionImmuneCycles += 120;
mech.collisionImmune = mech.cycle + b.modCollisionImmuneCycles; //player is immune to collision damage for 30 cycles mech.collisionImmune = mech.cycle + b.modCollisionImmuneCycles; //player is immune to collision damage for 30 cycles
@@ -438,8 +480,9 @@ const b = {
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
return b.modCollisionImmuneCycles > 120 || b.isModPiezo return b.modCollisionImmuneCycles > 120
}, },
requires: "Pauli exclusion",
effect() { effect() {
b.isModAnnihilation = true b.isModAnnihilation = true
}, },
@@ -455,6 +498,7 @@ const b = {
allowed() { allowed() {
return true return true
}, },
requires: "",
effect() { effect() {
b.isModPiezo = true; b.isModPiezo = true;
mech.fieldMeter = mech.fieldEnergyMax; mech.fieldMeter = mech.fieldEnergyMax;
@@ -471,6 +515,7 @@ const b = {
allowed() { allowed() {
return true return true
}, },
requires: "",
effect() { effect() {
b.modEnergySiphon += 0.15; b.modEnergySiphon += 0.15;
mech.fieldMeter = mech.fieldEnergyMax mech.fieldMeter = mech.fieldEnergyMax
@@ -487,6 +532,7 @@ const b = {
allowed() { allowed() {
return true return true
}, },
requires: "",
effect() { effect() {
b.modHealthDrain += 0.015; b.modHealthDrain += 0.015;
}, },
@@ -502,6 +548,7 @@ const b = {
allowed() { allowed() {
return true return true
}, },
requires: "",
effect() { effect() {
mech.fieldEnergyMax += 0.5 mech.fieldEnergyMax += 0.5
mech.fieldMeter += 0.5 mech.fieldMeter += 0.5
@@ -512,12 +559,13 @@ const b = {
}, },
{ {
name: "supersaturation", name: "supersaturation",
description: "<strong class='color-h'>heal</strong> <strong>+50%</strong> beyond your <strong>max health</strong>", description: "increase your <strong>maximum</strong> <strong class='color-h'>health</strong> by <strong>+50%</strong>",
maxCount: 9, maxCount: 9,
count: 0, count: 0,
allowed() { allowed() {
return true return true
}, },
requires: "",
effect() { effect() {
mech.maxHealth += 0.50 mech.maxHealth += 0.50
mech.addHealth(0.50) mech.addHealth(0.50)
@@ -532,8 +580,9 @@ const b = {
maxCount: 9, maxCount: 9,
count: 0, count: 0,
allowed() { allowed() {
return mech.health < 0.7 || level.isBuildRun return mech.health < 0.7 || build.isCustomSelection
}, },
requires: "health below 70%",
effect() { effect() {
b.modRecursiveHealing += 1 b.modRecursiveHealing += 1
}, },
@@ -543,12 +592,13 @@ const b = {
}, },
{ {
name: "mass-energy equivalence", name: "mass-energy equivalence",
description: "<strong>power ups</strong> overcharge your <strong class='color-f'>energy</strong><br>temporarily gain <strong>150%</strong> of maximum", description: "<strong>power ups</strong> overfill your <strong class='color-f'>energy</strong><br>temporarily gain <strong>50%</strong> above your max",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
return true return true
}, },
requires: "",
effect: () => { effect: () => {
b.isModMassEnergy = true // used in mech.grabPowerUp b.isModMassEnergy = true // used in mech.grabPowerUp
mech.fieldMeter = mech.fieldEnergyMax * 2 mech.fieldMeter = mech.fieldEnergyMax * 2
@@ -565,6 +615,7 @@ const b = {
allowed() { allowed() {
return true return true
}, },
requires: "",
effect() { effect() {
b.isModImmortal = true; b.isModImmortal = true;
}, },
@@ -580,6 +631,7 @@ const b = {
allowed() { allowed() {
return true return true
}, },
requires: "",
effect: () => { effect: () => {
b.isModBayesian = 0.20; b.isModBayesian = 0.20;
}, },
@@ -589,12 +641,13 @@ const b = {
}, },
{ {
name: "catabolism", name: "catabolism",
description: "when you <strong>fire</strong> while <strong>out</strong> of <strong>ammo</strong><br>convert <strong>3%</strong> of current health into <strong>ammo</strong>", description: "convert <strong>3%</strong> of current health into <strong>ammo</strong><br>when you <strong>fire</strong> while <strong>out</strong> of <strong>ammo</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
return true return true
}, },
requires: "",
effect: () => { effect: () => {
b.isModAmmoFromHealth = 0.03; b.isModAmmoFromHealth = 0.03;
}, },
@@ -610,6 +663,7 @@ const b = {
allowed() { allowed() {
return true return true
}, },
requires: "",
effect: () => { effect: () => {
b.isModNoAmmo = true; b.isModNoAmmo = true;
for (let i = 0; i < 6; i++) { //if you change the six also change it in Born rule for (let i = 0; i < 6; i++) { //if you change the six also change it in Born rule
@@ -633,6 +687,7 @@ const b = {
allowed() { allowed() {
return true return true
}, },
requires: "",
effect: () => { effect: () => {
b.isModFourOptions = true; b.isModFourOptions = true;
}, },
@@ -646,8 +701,9 @@ const b = {
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
return (b.modCount > 6) && !level.isBuildRun return (b.modCount > 6) && !build.isCustomSelection
}, },
requires: "more than 6 mods",
effect: () => { effect: () => {
let count = b.modCount let count = b.modCount
if (b.isModNoAmmo) count - 6 //remove the 6 bonus mods when getting rid of leveraged investment if (b.isModNoAmmo) count - 6 //remove the 6 bonus mods when getting rid of leveraged investment
@@ -669,6 +725,7 @@ const b = {
allowed() { allowed() {
return b.haveGunCheck("drones") || mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing" return b.haveGunCheck("drones") || mech.fieldUpgrades[mech.fieldMode].name === "nano-scale manufacturing"
}, },
requires: "drones",
effect() { effect() {
b.isModDroneCollide = true b.isModDroneCollide = true
}, },
@@ -684,6 +741,7 @@ const b = {
allowed() { allowed() {
return b.haveGunCheck("spores") || b.modSpores > 0 || b.isModStomp return b.haveGunCheck("spores") || b.modSpores > 0 || b.isModStomp
}, },
requires: "spores",
effect() { effect() {
b.isModFastSpores = true b.isModFastSpores = true
}, },
@@ -699,6 +757,7 @@ const b = {
allowed() { allowed() {
return b.haveGunCheck("super balls") return b.haveGunCheck("super balls")
}, },
requires: "super balls",
effect() { effect() {
b.modSuperBallNumber++ b.modSuperBallNumber++
}, },
@@ -714,6 +773,7 @@ const b = {
allowed() { allowed() {
return b.haveGunCheck("laser") return b.haveGunCheck("laser")
}, },
requires: "laser",
effect() { effect() {
b.modLaserReflections++; b.modLaserReflections++;
b.modLaserDamage += 0.015; //base is 0.05 b.modLaserDamage += 0.015; //base is 0.05
@@ -733,6 +793,7 @@ const b = {
allowed() { allowed() {
return b.haveGunCheck("flak") return b.haveGunCheck("flak")
}, },
requires: "flak",
effect() { effect() {
for (i = 0, len = b.guns.length; i < len; i++) { //find which gun is flak for (i = 0, len = b.guns.length; i < len; i++) { //find which gun is flak
if (b.guns[i].name === "flak") b.guns[i].ammoPack = b.guns[i].defaultAmmoPack * (2 + this.count); if (b.guns[i].name === "flak") b.guns[i].ammoPack = b.guns[i].defaultAmmoPack * (2 + this.count);
@@ -752,6 +813,7 @@ const b = {
// allowed() { // allowed() {
// return b.haveGunCheck("mines") // return b.haveGunCheck("mines")
// }, // },
// requires: "",
// effect() { // effect() {
// } // }
@@ -986,11 +1048,17 @@ const b = {
dist = Vector.magnitude(sub); dist = Vector.magnitude(sub);
if (dist < radius) { if (dist < radius) {
if (!b.isModImmuneExplosion && mech.fieldMeter > 0.1) { if (b.isModImmuneExplosion) {
mech.damage(radius * 0.0002); const drain = Math.max(radius * 0.0006, 0.2)
if (mech.fieldMeter > drain) {
mech.fieldMeter -= drain
} else { } else {
mech.fieldMeter -= Math.max(radius * 0.0006, 0.1) mech.damage(radius * 0.0001); //do half damage if have the mod, but out of mana
} }
} else {
mech.damage(radius * 0.0002); //normal player damage from explosions
}
knock = Vector.mult(Vector.normalise(sub), -Math.sqrt(dmg) * player.mass / 30); knock = Vector.mult(Vector.normalise(sub), -Math.sqrt(dmg) * player.mass / 30);
player.force.x += knock.x; player.force.x += knock.x;
player.force.y += knock.y; player.force.y += knock.y;

View File

@@ -61,6 +61,7 @@ const build = {
document.getElementById("pause-grid-left").style.display = "none" document.getElementById("pause-grid-left").style.display = "none"
document.getElementById("pause-grid-right").style.display = "none" document.getElementById("pause-grid-right").style.display = "none"
}, },
isCustomSelection: false,
choosePowerUp(who, index, type) { choosePowerUp(who, index, type) {
if (type === "gun") { if (type === "gun") {
let isDeselect = false let isDeselect = false
@@ -91,23 +92,30 @@ const build = {
if (b.mods[index].count < b.mods[index].maxCount) { if (b.mods[index].count < b.mods[index].maxCount) {
if (!who.classList.contains("build-grid-selected")) who.classList.add("build-grid-selected"); if (!who.classList.contains("build-grid-selected")) who.classList.add("build-grid-selected");
b.giveMod(index) b.giveMod(index)
if (b.mods[index].count > 1) who.innerHTML = `<div class="grid-title"><div class="circle-grid mod"></div> &nbsp; ${b.mods[index].name} (${b.mods[index].count}x)</div> ${b.mods[index].description}` // if (b.mods[index].count > 1) who.innerHTML = `<div class="grid-title"><div class="circle-grid mod"></div> &nbsp; ${b.mods[index].name} (${b.mods[index].count}x)</div> ${b.mods[index].description}`
} else { } else {
b.removeMod(index); b.removeMod(index);
who.innerHTML = `<div class="grid-title"><div class="circle-grid mod"></div> &nbsp; ${b.mods[index].name}</div> ${b.mods[index].description}` // who.innerHTML = `<div class="grid-title"><div class="circle-grid mod"></div> &nbsp; ${b.mods[index].name}</div> ${b.mods[index].description}`
who.classList.remove("build-grid-selected"); who.classList.remove("build-grid-selected");
} }
} }
//disable not allowed mods //update mod text //disable not allowed mods
for (let i = 0, len = b.mods.length; i < len; i++) { for (let i = 0, len = b.mods.length; i < len; i++) {
const modID = document.getElementById("mod-" + i) const modID = document.getElementById("mod-" + i)
if (b.mods[i].allowed()) { if (b.mods[i].allowed()) {
if (b.mods[i].count > 1) {
modID.innerHTML = `<div class="grid-title"><div class="circle-grid mod"></div> &nbsp; ${b.mods[i].name} (${b.mods[i].count}x)</div>${b.mods[i].description}</div>`
} else {
modID.innerHTML = `<div class="grid-title"><div class="circle-grid mod"></div> &nbsp; ${b.mods[i].name}</div>${b.mods[i].description}</div>`
}
if (modID.classList.contains("build-grid-disabled")) { if (modID.classList.contains("build-grid-disabled")) {
modID.classList.remove("build-grid-disabled"); modID.classList.remove("build-grid-disabled");
modID.setAttribute("onClick", `javascript: build.choosePowerUp(this,${i},'mod')`); modID.setAttribute("onClick", `javascript: build.choosePowerUp(this,${i},'mod')`);
} }
} else { } else {
modID.innerHTML = `<div class="grid-title"><div class="circle-grid grey"></div> &nbsp; ${b.mods[i].name}</div><span style="color:#666;"><strong>requires:</strong> ${b.mods[i].requires}</span></div>`
if (!modID.classList.contains("build-grid-disabled")) { if (!modID.classList.contains("build-grid-disabled")) {
modID.classList.add("build-grid-disabled"); modID.classList.add("build-grid-disabled");
modID.onclick = null modID.onclick = null
@@ -122,7 +130,6 @@ const build = {
} }
}, },
populateGrid() { populateGrid() {
level.isBuildRun = true;
let text = ` let text = `
<div style="display: flex; justify-content: space-around; align-items: center;"> <div style="display: flex; justify-content: space-around; align-items: center;">
<svg class="SVG-button" onclick="build.startBuildRun()" width="115" height="51"> <svg class="SVG-button" onclick="build.startBuildRun()" width="115" height="51">
@@ -154,7 +161,7 @@ const build = {
} }
for (let i = 0, len = b.mods.length; i < len; i++) { for (let i = 0, len = b.mods.length; i < len; i++) {
if (!b.mods[i].allowed()) { // || b.mods[i].name === "+1 cardinality") { //|| b.mods[i].name === "leveraged investment" if (!b.mods[i].allowed()) { // || b.mods[i].name === "+1 cardinality") { //|| b.mods[i].name === "leveraged investment"
text += `<div id="mod-${i}" class="build-grid-module build-grid-disabled"><div class="grid-title"><div class="circle-grid mod"></div> &nbsp; ${b.mods[i].name}</div> ${b.mods[i].description}</div>` text += `<div id="mod-${i}" class="build-grid-module build-grid-disabled"><div class="grid-title"><div class="circle-grid grey"></div> &nbsp; ${b.mods[i].name}</div><span style="color:#666;"><strong>requires:</strong> ${b.mods[i].requires}</span></div>`
} else if (b.mods[i].count > 1) { } else if (b.mods[i].count > 1) {
text += `<div id="mod-${i}" class="build-grid-module" onclick="build.choosePowerUp(this,${i},'mod')"><div class="grid-title"><div class="circle-grid mod"></div> &nbsp; ${b.mods[i].name} (${b.mods[i].count}x)</div> ${b.mods[i].description}</div>` text += `<div id="mod-${i}" class="build-grid-module" onclick="build.choosePowerUp(this,${i},'mod')"><div class="grid-title"><div class="circle-grid mod"></div> &nbsp; ${b.mods[i].name} (${b.mods[i].count}x)</div> ${b.mods[i].description}</div>`
} else { } else {
@@ -183,13 +190,14 @@ const build = {
game.makeGunHUD(); game.makeGunHUD();
b.setupAllMods(); b.setupAllMods();
build.isCustomSelection = true;
build.populateGrid(); build.populateGrid();
document.getElementById("field-0").classList.add("build-grid-selected"); document.getElementById("field-0").classList.add("build-grid-selected");
document.getElementById("build-grid").style.display = "grid" document.getElementById("build-grid").style.display = "grid"
}, },
startBuildRun() { startBuildRun() {
build.isCustomSelection = false;
spawn.setSpawnList(); //gives random mobs, not starter mobs spawn.setSpawnList(); //gives random mobs, not starter mobs
spawn.setSpawnList(); spawn.setSpawnList();
if (b.inventory.length > 0) { if (b.inventory.length > 0) {

View File

@@ -18,7 +18,7 @@ const level = {
// mech.setField("negative mass field") // mech.setField("negative mass field")
// for (let i = 0; i < 9; i++) { // for (let i = 0; i < 9; i++) {
// b.giveMod("waste energy recovery"); // b.giveMod("waste energy recovery");
// b.giveMod("scrap recycling"); // b.giveMod("thermal runaway");
// b.giveMod("acute stress response"); // b.giveMod("acute stress response");
// } // }

View File

@@ -973,6 +973,7 @@ const mobs = {
b.spore(this) //spawn drone b.spore(this) //spawn drone
} }
} }
if (b.isModExplodeMob) b.explosion(this.position, Math.min(500, Math.sqrt(this.mass + 2) * 80))
} }
}, },

View File

@@ -411,7 +411,6 @@ const mech = {
} }
game.replaceTextLog = true; game.replaceTextLog = true;
game.makeTextLog("your quantum probability has stabilized", 1000); game.makeTextLog("your quantum probability has stabilized", 1000);
document.title = "n-gon: L" + (game.difficulty) + " " + level.levels[level.onLevel];
}, 8000); }, 8000);
} else if (mech.alive) { //normal death code here } else if (mech.alive) { //normal death code here

View File

@@ -215,15 +215,16 @@ summary {
} }
.build-grid-selected { .build-grid-selected {
background-color: #919ba8; background-color: #76808d;
} }
.build-grid-selected:hover { .build-grid-selected:hover {
background-color: #919ba8; background-color: #76808d;
} }
.build-grid-disabled { .build-grid-disabled {
opacity: 0.15; opacity: 0.5;
color: #ccc;
} }
#info { #info {
@@ -444,6 +445,10 @@ em {
background: #96e; background: #96e;
} }
.grey {
background: #ccc;
}
.gun { .gun {
background: #149; background: #149;
} }

View File

@@ -1,19 +1,10 @@
************** TODO - n-gon ************** ************** TODO - n-gon **************
level - decrease all lips from 15 to 10 (under the new gravity players get stuck)
consider making jumping cost energy (like stamina) consider making jumping cost energy (like stamina)
should walking cost energy too? should walking cost energy too?
add in requirements to custom mode
grey out mods that don't meet requirements
make custom undo method for mods
this makes toggleing mods on and off easier in custom
mod - acute stress response
permanently increase damage by 30%
for 5 seconds after a mob dies
drain energy down to zero
mod - nano-scale field makes spores instead of drones mod - nano-scale field makes spores instead of drones
mod - mines - fire something instead of needles on activation mod - mines - fire something instead of needles on activation