remove keyword

added CSS style for "remove/eject" keyword
tech: deprecated - gain 1.05x damage for each tech removed this game
tech: externality - 1.1x damage, removing this gives 40 ammo power ups
paradigm shift no longer has a 3% failure rate
  minus 3->4 health
  it can remove applied science tech
removing strange loop gives a random removetech

tech: marginal utility - give a specific gun 2x ammo per ammo power up
tech: interest - research, ammo, coupling, health increases by 6% at the start of each level
tech: Pareto efficiency - give each gun randomly 5x or 0.2x ammo per ammo power up

aperture 6->4s cycles between 1 to 2 -> 0.8 to 3 damage
mass-energy no longer has a reduction in defense effects
  but it costs 2 research now
1st ionization energy 11->14 max energy per heal
colony: 1.5->1.6x spores 40->33% chance to spawn something different
laser cost formula changed to be independent of field regen
  this makes the effects of cost and fire rate 33% bigger
  free-electron laser 3.5->3x energy cost
options exchange - the first time you click cancel it randomizes choices
  allows a free trigger from other cancel tech
pseudoscience gets 3->2 free researches
alternator harpoon has 0->0.03x energy cost
coupling for pilot wave gives 1.04->1.05x block damage

several bugs fixes
This commit is contained in:
landgreen
2024-03-31 19:45:15 -07:00
parent 38ef45a651
commit 1728b53921
19 changed files with 929 additions and 1022 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 61 KiB

BIN
img/Pareto efficiency.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

BIN
img/deprecated.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

BIN
img/externality.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

BIN
img/interest.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

BIN
img/marginal utility.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

View File

@@ -11,6 +11,7 @@
<meta property="og:title" content="n-gon">
<meta name="twitter:title" content="n-gon">
<meta name="twitter:description" content="Browser-based side scrolling video game with the matter.js physics engine.">
<!-- <meta http-equiv="refresh" content="0; url=https://example.com/newlocation"> -->
<title>n-gon</title>
<link rel="stylesheet" href="style.css">
<link rel='shortcut icon' href='favicon.ico' type='image/x-icon' />

View File

@@ -130,9 +130,9 @@ const b = {
// if (b.guns[i].name === name) return b.guns[i].ammo
// }
// },
giveGuns(gun = "random", ammoPacks = 10) {
if (tech.ammoCap) ammoPacks = 0.45 * tech.ammoCap
if (tech.isOneGun) b.removeAllGuns();
giveGuns(gun = "random", ammoPacks = 22) {
if (tech.ammoCap) ammoPacks = tech.ammoCap
if (tech.isOneGun) b.resetAllGuns();
if (gun === "random") {
//find what guns player doesn't have
options = []
@@ -198,8 +198,8 @@ const b = {
}
if (gunTechPool.length) {
const index = Math.floor(Math.random() * gunTechPool.length)
tech.giveTech(gunTechPool[index]) // choose from the gun pool
simulation.makeTextLog(`<span class='color-var'>tech</span>.giveTech("<span class='color-text'>${tech.tech[gunTechPool[index]].name}</span>")`)
tech.giveTech(gunTechPool[index]) // choose from the gun pool
} else {
tech.giveTech() //get normal tech if you can't find any gun tech
}
@@ -229,11 +229,12 @@ const b = {
}
b.setFireCD();
},
removeAllGuns() {
resetAllGuns() {
b.inventory = []; //removes guns and ammo
for (let i = 0, len = b.guns.length; i < len; ++i) {
b.guns[i].count = 0;
b.guns[i].have = false;
b.guns[i].ammoPack = b.guns[i].defaultAmmoPack;
if (b.guns[i].ammo != Infinity) b.guns[i].ammo = 0;
}
tech.buffedGun = 0
@@ -835,10 +836,7 @@ const b = {
suck([player], this.explodeRad * 1.3)
}
Matter.Body.setVelocity(this, {
x: 0,
y: 0
}); //keep bomb in place
Matter.Body.setVelocity(this, { x: 0, y: 0 }); //keep bomb in place
//draw suck
const radius = 2.75 * this.explodeRad * (this.endCycle - simulation.cycle) / this.suckCycles
ctx.fillStyle = "rgba(0,0,0,0.1)";
@@ -1827,7 +1825,7 @@ const b = {
friction: 1,
frictionAir: 0.4,
// thrustMag: 0.1,
drain: tech.isRailEnergy ? 0 : 0.006,
drain: tech.isRailEnergy ? 0.0002 : 0.006,
turnRate: isReturn ? 0.1 : 0.03, //0.015
drawStringControlMagnitude: 3000 + 5000 * Math.random(),
drawStringFlip: (Math.round(Math.random()) ? 1 : -1),
@@ -5816,8 +5814,8 @@ const b = {
return `use compressed air to rapidly drive <strong>nails</strong><br><em>fire rate</em> <strong>increases</strong> the longer you fire<br><strong>${this.ammoPack.toFixed(0)}</strong> nails per ${powerUps.orb.ammo()}`
},
ammo: 0,
ammoPack: 60,
defaultAmmoPack: 60,
ammoPack: 27,
defaultAmmoPack: 27,
recordedAmmo: 0,
have: false,
nextFireCycle: 0, //use to remember how longs its been since last fire, used to reset count
@@ -6131,8 +6129,8 @@ const b = {
return `fire a wide <strong>burst</strong> of short range <strong> bullets</strong><br>has a slow <strong><em>fire rate</em></strong><br><strong>${this.ammoPack.toFixed(1)}</strong> shots per ${powerUps.orb.ammo()}`
},
ammo: 0,
ammoPack: 3.5,
defaultAmmoPack: 3.5,
ammoPack: 1.6,
defaultAmmoPack: 1.6,
have: false,
do() {
//fade cross hairs
@@ -6422,7 +6420,8 @@ const b = {
return `fire <strong>3</strong> balls in a wide arc<br>balls <strong>bounce</strong> with no momentum loss<br><strong>${this.ammoPack.toFixed(0)}</strong> balls per ${powerUps.orb.ammo()}`
},
ammo: 0,
ammoPack: 9,
ammoPack: 4.05,
defaultAmmoPack: 4.05,
have: false,
// num: 5,
do() { },
@@ -6500,8 +6499,8 @@ const b = {
return `emit <strong>wave packets</strong> that propagate through <strong>solids</strong><br>waves <strong class='color-s'>slow</strong> mobs<br><strong>${this.ammoPack.toFixed(0)}</strong> wave packets per ${powerUps.orb.ammo()}`
},
ammo: 0,
ammoPack: 115,
defaultAmmoPack: 115,
ammoPack: 52,
defaultAmmoPack: 52,
have: false,
wavePacketCycle: 0,
delay: 40,
@@ -6863,7 +6862,8 @@ const b = {
return `launch <strong>homing</strong> missiles that target mobs<br>missiles <strong class='color-e'>explode</strong> on contact with mobs<br><strong>${this.ammoPack.toFixed(1)}</strong> missiles per ${powerUps.orb.ammo()}`
},
ammo: 0,
ammoPack: 5,
ammoPack: 2.3,
defaultAmmoPack: 2.3,
have: false,
fireCycle: 0,
do() { },
@@ -6971,7 +6971,8 @@ const b = {
return `lob a single <strong>bouncy</strong> projectile<br><strong class='color-e'>explodes</strong> on <strong>contact</strong> or after one second<br><strong>${this.ammoPack.toFixed(0)}</strong> grenades per ${powerUps.orb.ammo()}`
},
ammo: 0,
ammoPack: 7,
ammoPack: 3.2,
defaultAmmoPack: 3.2,
have: false,
do() { }, //do is set in b.setGrenadeMode()
fire() {
@@ -6995,7 +6996,8 @@ const b = {
return `toss a <strong class='color-p' style='letter-spacing: 2px;'>sporangium</strong> that discharges ${b.guns[6].nameString("s")}<br>${b.guns[6].nameString("s")} seek out nearby mobs<br><strong>${this.ammoPack.toFixed(1)}</strong> sporangium per ${powerUps.orb.ammo()}`
},
ammo: 0,
ammoPack: 2.6,
ammoPack: 1.22,
defaultAmmoPack: 1.22,
have: false,
nameString(suffix = "") {
if (tech.isSporeFlea) {
@@ -7020,7 +7022,7 @@ const b = {
bullet[me].maxRadius = 30;
bullet[me].restitution = 0.3;
bullet[me].minDmgSpeed = 0;
bullet[me].totalSpores = 8 + 2 * tech.isSporeFreeze + 4 * tech.isSporeColony
bullet[me].totalSpores = 8 + 2 * tech.isSporeFreeze + 5 * tech.isSporeColony
bullet[me].stuck = function () { };
bullet[me].beforeDmg = function () { };
bullet[me].do = function () {
@@ -7165,7 +7167,7 @@ const b = {
]
for (len = this.totalSpores; count < len; count++) {
if (tech.isSporeColony && Math.random() < 0.5) {
if (tech.isSporeColony && Math.random() < 0.33) {
things[Math.floor(Math.random() * things.length)]()
} else if (tech.isSporeFlea) {
things[2]()
@@ -7192,8 +7194,8 @@ const b = {
return `deploy <strong>autonomous</strong> <strong>drones</strong> that smash into mobs<br>drones <strong>collect</strong> nearby power ups<br><strong>${this.ammoPack.toFixed(0)}</strong> drones per ${powerUps.orb.ammo()}`
},
ammo: 0,
ammoPack: 16,
defaultAmmoPack: 16,
ammoPack: 7.3,
defaultAmmoPack: 7.3,
have: false,
do() { },
fire() {
@@ -7234,7 +7236,8 @@ const b = {
return `spray bubbly <strong>foam</strong> that <strong>sticks</strong> to mobs<br><strong class='color-s'>slows</strong> mobs and does <strong class='color-d'>damage</strong> over time<br><strong>${this.ammoPack.toFixed(0)}</strong> bubbles per ${powerUps.orb.ammo()}`
},
ammo: 0,
ammoPack: 28,
ammoPack: 12.6,
defaultAmmoPack: 12.6,
have: false,
charge: 0,
isDischarge: false,
@@ -7351,7 +7354,8 @@ const b = {
return `throw a <strong>self-steering</strong> harpoon that uses <strong class='color-f'>energy</strong><br>to <strong>retract</strong> and refund its <strong class='color-ammo'>ammo</strong> cost<br><strong>${this.ammoPack.toFixed(1)}</strong> harpoons per ${powerUps.orb.ammo()}`
},
ammo: 0,
ammoPack: 1.7, //update this in railgun tech
ammoPack: 0.77, //update this in railgun tech
defaultAmmoPack: 0.77,
have: false,
fire() { },
do() { },
@@ -7692,7 +7696,8 @@ const b = {
return `toss a <strong>proximity</strong> mine that <strong>sticks</strong> to walls<br>refund <strong>undetonated</strong> mines on <strong>exiting</strong> a level<br><strong>${this.ammoPack.toFixed(1)}</strong> mines per ${powerUps.orb.ammo()}`
},
ammo: 0,
ammoPack: 1.7,
ammoPack: 0.77,
defaultAmmoPack: 0.77,
have: false,
nameString(suffix = "") {
if (tech.isFoamMine) {
@@ -7761,12 +7766,12 @@ const b = {
},
{
name: "laser", //11
// description: `emit a <strong>beam</strong> of collimated coherent <strong class='color-laser'>light</strong><br>drains <strong class='color-f'>energy</strong> instead of ammo<br>drains <strong>${(0.001 + tech.laserDrain) * 100}%</strong> <strong class='color-f'>energy</strong> per second`,
descriptionFunction() {
return `emit a <strong>beam</strong> of collimated coherent <strong class='color-laser'>light</strong><br>drains <strong>${((0.001 + tech.laserDrain) * 600).toFixed(2)}</strong> <strong class='color-f'>energy</strong> per second<br>doesn't use <strong>ammo</strong>`
return `emit a <strong>beam</strong> of collimated coherent <strong class='color-laser'>light</strong><br>costs <strong>${(tech.laserDrain * 6000).toFixed(1)}</strong> <strong class='color-f'>energy</strong> per second<br>doesn't use <strong>ammo</strong>`
},
ammo: 0,
ammoPack: Infinity,
defaultAmmoPack: Infinity,
have: false,
charge: 0,
isStuckOn: false,
@@ -7903,7 +7908,7 @@ const b = {
// this.fire = this.firePhoton
},
fireLaser() {
const drain = 0.001 + tech.laserDrain / b.fireCDscale
const drain = tech.laserDrain / b.fireCDscale
if (m.energy < drain) {
m.fireCDcycle = m.cycle + 100; // cool down if out of energy
} else {
@@ -7921,7 +7926,7 @@ const b = {
},
firePulse() { },
fireSplit() {
const drain = 0.001 + tech.laserDrain / b.fireCDscale
const drain = tech.laserDrain / b.fireCDscale
if (m.energy < drain) {
m.fireCDcycle = m.cycle + 100; // cool down if out of energy
} else {
@@ -7946,7 +7951,7 @@ const b = {
}
},
fireWideBeam() {
const drain = 0.001 + tech.laserDrain / b.fireCDscale
const drain = tech.laserDrain / b.fireCDscale
if (m.energy < drain) {
m.fireCDcycle = m.cycle + 100; // cool down if out of energy
} else {
@@ -8019,7 +8024,7 @@ const b = {
}
},
fireHistory() {
drain = 0.001 + tech.laserDrain / b.fireCDscale
drain = tech.laserDrain / b.fireCDscale
if (m.energy < drain) {
m.fireCDcycle = m.cycle + 100; // cool down if out of energy
} else {

View File

@@ -292,7 +292,7 @@ function collisionChecks(event) {
}
}
let dmg = tech.blockDamage * m.dmgScale * v * obj.mass * (tech.isMobBlockFling ? 2.5 : 1) * (tech.isBlockRestitution ? 2.5 : 1) * ((m.fieldMode === 0 || m.fieldMode === 8) ? 1 + 0.04 * m.coupling : 1);
let dmg = tech.blockDamage * m.dmgScale * v * obj.mass * (tech.isMobBlockFling ? 2.5 : 1) * (tech.isBlockRestitution ? 2.5 : 1) * ((m.fieldMode === 0 || m.fieldMode === 8) ? 1 + 0.05 * m.coupling : 1);
if (mob[k].isShielded) dmg *= 0.7
mob[k].damage(dmg, true);

View File

@@ -808,14 +808,12 @@ ${simulation.isCheating ? "<br><br><em>lore disabled</em>" : ""}
tech.giveTech(index)
} else if (!tech.tech[index].isNonRefundable) {
// tech.totalCount -= tech.tech[index].count
tech.removeTech(index);
document.getElementById("tech-" + index).classList.remove("build-tech-selected");
tech.removeTech(index);
} else {
// for non refundable tech this makes it flash off for a second, but return to on to show that it can't be set off
document.getElementById("tech-" + index).classList.remove("build-tech-selected")
setTimeout(() => {
document.getElementById("tech-" + index).classList.add("build-tech-selected")
}, 50);
setTimeout(() => { document.getElementById("tech-" + index).classList.add("build-tech-selected") }, 50);
}
}
build.updateExperimentText(isAllowed)
@@ -1099,9 +1097,6 @@ ${simulation.isCheating ? "<br><br><em>lore disabled</em>" : ""}
} else { //if you have no tech (not cheating) remove all power ups that might have spawned from tech
for (let i = 0; i < powerUp.length; ++i) Matter.Composite.remove(engine.world, powerUp[i]);
powerUp = [];
// if (build.hasExperimentalMode) {
// for (let i = 0; i < 7; i++) tech.giveTech("undefined")
// }
}
document.body.style.cursor = "none";
document.body.style.overflow = "hidden"

View File

@@ -33,19 +33,22 @@ const level = {
// m.energy = 0
// simulation.molecularMode = 2
// m.damage(0.1);
// b.giveGuns("mine") //0 nail gun 1 shotgun 2 super balls 3 wave 4 missiles 5 grenades 6 spores 7 drones 8 foam 9 harpoon 10 mine 11 laser
// b.giveGuns("drones") //0 nail gun 1 shotgun 2 super balls 3 wave 4 missiles 5 grenades 6 spores 7 drones 8 foam 9 harpoon 10 mine 11 laser
// b.giveGuns("shotgun") //0 nail gun 1 shotgun 2 super balls 3 wave 4 missiles 5 grenades 6 spores 7 drones 8 foam 9 harpoon 10 mine 11 laser
// b.giveGuns("wave") //0 nail gun 1 shotgun 2 super balls 3 wave 4 missiles 5 grenades 6 spores 7 drones 8 foam 9 harpoon 10 mine 11 laser
// b.giveGuns("laser") //0 nail gun 1 shotgun 2 super balls 3 wave 4 missiles 5 grenades 6 spores 7 drones 8 foam 9 harpoon 10 mine 11 laser
// b.guns[8].ammo = 100000000
// requestAnimationFrame(() => { tech.giveTech("eternalism") });
// for (let i = 0; i < 1; ++i) tech.giveTech("beforeunload")
// for (let i = 0; i < 1; ++i) tech.giveTech("Sleipnir")
// for (let i = 0; i < 1; ++i) tech.giveTech("dark patterns")
// requestAnimationFrame(() => { tech.giveTech("optical amplifier") });
// for (let i = 0; i < 1; ++i) tech.giveTech("mass production")
// tech.giveTech("Pareto efficiency")
// for (let i = 0; i < 1; ++i) tech.giveTech("reduced tolerances")
// for (let i = 0; i < 1; ++i) tech.giveTech("Newtons 1st law")
// for (let i = 0; i < 1; ++i) tech.giveTech("Newtons 2nd law")
// requestAnimationFrame(() => { for (let i = 0; i < 1; i++) tech.giveTech("paradigm shift") });
// requestAnimationFrame(() => { for (let i = 0; i < 10; i++) b.orbitBot(m.pos, false) });
// m.skin.hexagon();
// for (let i = 0; i < 1; i++) tech.giveTech("tungsten carbide")
// m.lastKillCycle = m.cycle
// for (let i = 0; i < 1; ++i) tech.giveTech("what the block?")
// for (let i = 0; i < 1; ++i) tech.giveTech("deprecated")
// for (let i = 0; i < 1; ++i) tech.giveTech("unified field theory")
// for (let i = 0; i < 3; i++) powerUps.directSpawn(450, -50, "tech");
// for (let i = 0; i < 10; i++) powerUps.directSpawn(1750, -500, "research");
@@ -56,7 +59,7 @@ const level = {
// for (let i = 0; i < 1; ++i) spawn.laserLayer(1400, -500)
// Matter.Body.setPosition(player, { x: -200, y: -3330 });
// for (let i = 0; i < 4; ++i) spawn.laserLayer(1300, -500 + 100 * Math.random())
// for (let i = 0; i < 1; ++i) spawn.laserLayerBoss(1900, -500)
// for (let i = 0; i < 1; ++i) spawn.stinger(1900, -500)
// for (let i = 0; i < 1; ++i) spawn.dragonFlyBoss(1900, -500)
// spawn.beetleBoss(1900, -500, 25)
// spawn.zombie(-3000, -500 + 300 * Math.random(), 30, 5, "white") // zombie(x, y, radius, sides, color)
@@ -74,9 +77,9 @@ const level = {
// simulation.isAutoZoom = false; //look in close
// simulation.zoomScale *= 0.5;
// simulation.setZoom();
// for (let i = 0; i < 10; ++i) powerUps.directSpawn(m.pos.x + 50 * Math.random(), m.pos.y + 50 * Math.random(), "tech");
// for (let i = 0; i < 3; ++i) powerUps.directSpawn(m.pos.x + 50 * Math.random(), m.pos.y + 50 * Math.random(), "tech");
// for (let i = 0; i < 2; ++i) powerUps.directSpawn(m.pos.x + 450, m.pos.y + 50 * Math.random(), "boost");
// for (let i = 0; i < 20; ++i) powerUps.directSpawn(m.pos.x + 50 * Math.random(), m.pos.y + 50 * Math.random(), "heal");
// for (let i = 0; i < 100; ++i) powerUps.directSpawn(m.pos.x + 50 * Math.random(), m.pos.y + 50 * Math.random(), "ammo");
// for (let i = 0; i < 2; i++) powerUps.spawn(player.position.x + Math.random() * 50, player.position.y - Math.random() * 50, "field", false);
//lore testing
// localSettings.isTrainingNotAttempted = true
@@ -168,20 +171,49 @@ const level = {
powerUps.spawn(player.position.x + Math.random() * 50, player.position.y - Math.random() * 50, "tech", false);
}
if (tech.isHealLowHealth) {
if (tech.isEnergyHealth) {
var len = 4 * Math.max(0, m.maxEnergy - m.energy)
} else {
var len = 4 * Math.max(0, m.maxHealth - m.health)
}
const len = tech.isEnergyHealth ? 5 * Math.max(0, m.maxEnergy - m.energy) : 5 * Math.max(0, m.maxHealth - m.health)
for (let i = 0; i < len; i++) powerUps.spawn(player.position.x + 90 * (Math.random() - 0.5), player.position.y + 90 * (Math.random() - 0.5), "heal", false);
}
if (tech.interestRate > 0) {
const rate = ((level[level.levels[level.onLevel]].name === "final" || level[level.levels[level.onLevel]].name === "subway") ? 1 / 3 : 1) * tech.interestRate //this effect triggers extra times on these final levels
if (b.activeGun !== null && b.activeGun !== undefined && b.guns[b.activeGun].name !== "laser") {
const ammoPerOrb = b.guns[b.activeGun].ammoPack
const a = Math.ceil(rate * b.guns[b.activeGun].ammo / ammoPerOrb)
powerUps.spawnDelay("ammo", a);
simulation.makeTextLog(`${(rate * 100).toFixed(0)}<span class='color-symbol'>%</span> <span class='color-m'>interest</span> on <span class='color-g'>ammo</span> <span class='color-symbol'>=</span> ${a > 20 ? a + powerUps.orb.ammo(1) : powerUps.orb.ammo(a)}`)
}
if (powerUps.research.count > 0) {
const r = Math.ceil(rate * powerUps.research.count)
simulation.makeTextLog(`${(rate * 100).toFixed(0)}<span class='color-symbol'>%</span> <span class='color-m'>interest</span> on <span class='color-r'>research</span> <span class='color-symbol'>=</span> ${r > 20 ? r + powerUps.orb.research(1) : powerUps.orb.research(r)}`)
powerUps.spawnDelay("research", r);
}
if (m.coupling > 0) {
const c = Math.ceil(rate * m.coupling)
powerUps.spawnDelay("coupling", c);
simulation.makeTextLog(`${(rate * 100).toFixed(0)}<span class='color-symbol'>%</span> <span class='color-m'>interest</span> on <span class='color-coupling'>coupling</span> <span class='color-symbol'>=</span> ${c > 20 ? c + powerUps.orb.coupling(1) : powerUps.orb.coupling(c)}`)
}
const healPerOrb = (powerUps.heal.size() / 40 / (simulation.healScale ** 0.25)) ** 2
const h = Math.ceil(rate * m.health / healPerOrb)
powerUps.spawnDelay("heal", h);
simulation.makeTextLog(`${(rate * 100).toFixed(0)}<span class='color-symbol'>%</span> <span class='color-m'>interest</span> on <span class='color-h'>health</span> <span class='color-symbol'>=</span> ${h > 20 ? h + powerUps.orb.heal(1) : powerUps.orb.heal(h)}`)
// trying to spawn smaller heals
// const healPerOrb = (powerUps.heal.size() / 40 / (simulation.healScale ** 0.25)) ** 2
// console.log(healPerOrb)
// let h = tech.interestRate * m.health / healPerOrb
// console.log(tech.interestRate, m.health, healPerOrb, h)
// const overHeal = h - Math.floor(h)
// powerUps.spawn(m.pos.x, m.pos.y, "heal", true, null, Math.max(0.25, overHeal) * 40 * (simulation.healScale ** 0.25))
// if (h > healPerOrb) powerUps.spawnDelay("heal", h);
// simulation.makeTextLog(`${(Math.ceil(tech.interestRate * 100)).toFixed(0)}<span class='color-symbol'>%</span> <span class='color-m'>interest</span> on <span class='color-h'>health</span> <span class='color-symbol'>=</span> ${h > 20 ? h + powerUps.orb.heal(1) : powerUps.orb.heal(h)}`)
}
},
trainingText(say) {
simulation.lastLogTime = 0; //clear previous messages
simulation.isTextLogOpen = true
simulation.makeTextLog(`<span style="font-size: 120%;line-height: 120%;"><span style="color:#51f;">supervised.learning</span>(<span style="color:#777; font-size: 80%;">${(Date.now() / 1000).toFixed(0)} s</span>)<span class='color-symbol'>:</span><br>${say}</span>`, Infinity)
simulation.isTextLogOpen = false
// lore.trainer.text("Wow. Just a platform.")
},
trainingBackgroundColor: "#e1e1e1",
custom() { },
@@ -21080,7 +21112,7 @@ const level = {
if (m.alive) {
// tech.damage *= 2;
let text = "";
if (!tech.isSuperDeterminism) { text += `<div class='cancel' onclick='powerUps.endDraft("buff",true)'>${tech.isCancelTech ? "?" : "✕"}</div>`; };
if (!tech.isSuperDeterminism) { text += `<div class='cancel' onclick='powerUps.endDraft("buff",true)'>${(tech.isCancelTech && tech.cancelTechCount === 0) ? "?" : "✕"}</div>`; };
text += `<h3 style = 'color:#fff; text-align:left; margin: 0px;'>Blessing Of Sal</h3>`;
text += `<div class="choose-grid-module" onclick="powerUps.loadOut.choose(1)"><div class="grid-title"><div class="circle-grid tech" style="background-image: linear-gradient(lightyellow, yellow);"></div> &nbsp; Speed Boost</div>Increase speed by 5%</div>`;
text += `<div class="choose-grid-module" onclick="powerUps.loadOut.choose(2)"><div class="grid-title"><div class="circle-grid tech" style="background-image: linear-gradient(gray, lightgray);"></div> &nbsp; Defense Boost</div>Reduce damage by 5%</div>`;
@@ -24125,64 +24157,6 @@ const level = {
ctx.setLineDash([]);
}
};
// if(powerUps.pass == undefined) {
// let pass = {pass:true, activated:false};
// Object.assign(powerUps, pass)
// }
// const loadOut = {
// loadOut: {
// name: "loadOut",
// color: "#000000", //"hsl(248,100%,65%)",
// size() { return 40 },
// effect() {
// if(m.alive) {
// // tech.damage *= 2;
// let text = "";
// if (!tech.isSuperDeterminism) { text += `<div class='cancel' onclick='powerUps.endDraft("buff",true)'>${tech.isCancelTech ? "?":"✕"}</div>`; };
// text += `<h3 style = 'color:#fff; text-align:left; margin: 0px;'>Blessing Of Sal</h3>`;
// text += `<div class="choose-grid-module" onclick="powerUps.loadOut.choose(1)"><div class="grid-title"><div class="circle-grid tech" style="background-image: linear-gradient(lightyellow, yellow);"></div> &nbsp; Speed Boost</div>Increase speed by 5%</div>`;
// text += `<div class="choose-grid-module" onclick="powerUps.loadOut.choose(2)"><div class="grid-title"><div class="circle-grid tech" style="background-image: linear-gradient(gray, lightgray);"></div> &nbsp; Defense Boost</div>Reduce damage by 5%</div>`;
// text += `<div class="choose-grid-module" onclick="powerUps.loadOut.choose(3)"><div class="grid-title"><div class="circle-grid tech" style="background-image: linear-gradient(red, orange);"></div> &nbsp; Damage Boost</div>Increase damage by 10%</div>`;
// if(powerUps.pass == true) {
// text += `<div disabled class="choose-grid-module" onclick="powerUps.loadOut.choose(4)"><div class="grid-title"><div class="circle-grid tech" style="background-image: radial-gradient(black, gray);"></div> &nbsp; Blade of Sal</div>Press Shift to summon the <b style="color: ${m.eyeFillColor};">Mythical</b> <em style="color: lightblue; text-shadow: ${m.eyeFillColor} 0px 0 5px;">Las Slayer</em><div>Drains <strong class='color-f'>Energy</strong></div></div>`;
// }
// document.getElementById("choose-grid").innerHTML = text;
// powerUps.showDraft();//no known bugs ig idk, im keep this as it is
// }
// },
// choose(index) {
// if(index == 1) {
// tech.squirrelFx += 0.25;
// tech.squirrelJump += 0.1;
// m.setMovement();
// powerUps.endDraft("buff");
// } else if(index == 2) {
// simulation.dmgScale *= 0.95;
// powerUps.endDraft("buff");
// } else if(index == 3) {
// m.dmgScale *= 1.1;
// powerUps.endDraft("buff");
// } else if(index == 4) { //sword!
// powerUps.pass = false;
// addEventListener("keydown", function(event) {
// if(event.key == "Shift" && powerUps.activated == false) {
// sword()
// powerUps.activated = true;
// } else if(event.key == "Shift" && powerUps.activated == true) {
// for(let i = 0; i < mob.length; i++) {
// if(mob[i].isSword) {
// mob[i].death()
// }
// powerUps.activated = false;
// }
// }
// })
// powerUps.endDraft("buff");
// }
// }
// }
// }
// Object.assign(powerUps, loadOut)
const restoreBoss = function (x, y, radius = 30) { //ATTENTION LANDGREEN: RESTOREBOSS WILL NOT DROP ANY TECH, NOR WILL THERE BE ANY IN THE MAP. DO NOT ADD ANY TECH TO MY MAP
mobs.spawn(x, y, 8, radius, 'transparent');
let me = mob[mob.length - 1];
@@ -33022,7 +32996,7 @@ const level = {
level.defaultZoom = 1400
simulation.zoomTransition(level.defaultZoom, 1)
document.body.style.backgroundColor = level.trainingBackgroundColor
b.removeAllGuns();
b.resetAllGuns();
b.giveGuns("nail gun")
b.guns[b.activeGun].ammo = 0
simulation.updateGunHUD();
@@ -33117,7 +33091,7 @@ const level = {
level.defaultZoom = 1400
simulation.zoomTransition(level.defaultZoom, 1)
document.body.style.backgroundColor = level.trainingBackgroundColor
b.removeAllGuns();
b.resetAllGuns();
b.giveGuns("shotgun")
// b.guns[b.activeGun].ammo = 0
// simulation.updateGunHUD();
@@ -33199,7 +33173,7 @@ const level = {
level.defaultZoom = 1400
simulation.zoomTransition(level.defaultZoom, 1)
document.body.style.backgroundColor = level.trainingBackgroundColor
b.removeAllGuns();
b.resetAllGuns();
b.giveGuns("super balls")
// b.guns[b.activeGun].ammo = 0
// simulation.updateGunHUD();
@@ -33283,7 +33257,7 @@ const level = {
level.defaultZoom = 1400
simulation.zoomTransition(level.defaultZoom, 1)
document.body.style.backgroundColor = level.trainingBackgroundColor
b.removeAllGuns();
b.resetAllGuns();
b.giveGuns("wave")
// b.guns[b.activeGun].ammo = 0
// simulation.updateGunHUD();
@@ -33370,7 +33344,7 @@ const level = {
level.defaultZoom = 1400
simulation.zoomTransition(level.defaultZoom, 1)
document.body.style.backgroundColor = level.trainingBackgroundColor
b.removeAllGuns();
b.resetAllGuns();
b.giveGuns("missiles")
// b.guns[b.activeGun].ammo = 0
// simulation.updateGunHUD();
@@ -33459,7 +33433,7 @@ const level = {
level.defaultZoom = 1400
simulation.zoomTransition(level.defaultZoom, 1)
document.body.style.backgroundColor = level.trainingBackgroundColor
b.removeAllGuns();
b.resetAllGuns();
let instruction = 0
level.trainingText(`use your <strong class='color-f'>field</strong> to stack the <strong class='color-block'>blocks</strong>`)
@@ -33511,7 +33485,7 @@ const level = {
level.defaultZoom = 1400
simulation.zoomTransition(level.defaultZoom, 1)
document.body.style.backgroundColor = level.trainingBackgroundColor
b.removeAllGuns();
b.resetAllGuns();
b.giveGuns("mine")
let instruction = 0
@@ -33595,7 +33569,7 @@ const level = {
level.defaultZoom = 1400
simulation.zoomTransition(level.defaultZoom, 1)
document.body.style.backgroundColor = level.trainingBackgroundColor
b.removeAllGuns();
b.resetAllGuns();
b.giveGuns("grenades")
const elevator1 = level.elevator(550, -100, 180, 25, -840, 0.003, {
@@ -33715,7 +33689,7 @@ const level = {
level.defaultZoom = 1400
simulation.zoomTransition(level.defaultZoom, 1)
document.body.style.backgroundColor = level.trainingBackgroundColor
b.removeAllGuns();
b.resetAllGuns();
b.giveGuns("harpoon")
let instruction = 0

View File

@@ -348,7 +348,7 @@ const m = {
}
if (
!tech.tech[i].isNonRefundable &&
!tech.tech[i].isFromAppliedScience &&
// !tech.tech[i].isFromAppliedScience &&
!tech.tech[i].isAltRealityTech
) {
totalTech += tech.tech[i].count
@@ -366,6 +366,7 @@ const m = {
tech.duplication = 0;
tech.extraMaxHealth = 0;
tech.totalCount = 0;
tech.removeCount = 0;
const randomBotCount = b.totalBots()
b.zeroBotCount()
//remove all bullets, respawn bots
@@ -384,14 +385,17 @@ const m = {
b.inventoryGun = 0;
for (let i = 0, len = b.guns.length; i < len; ++i) {
b.guns[i].have = false;
if (b.guns[i].ammo !== Infinity) b.guns[i].ammo = 0;
if (b.guns[i].ammo !== Infinity) {
b.guns[i].ammo = 0;
b.guns[i].ammoPack = b.guns[i].defaultAmmoPack;
}
}
//give random guns
for (let i = 0; i < totalGuns; i++) b.giveGuns()
//randomize ammo based on ammo/ammoPack count
for (let i = 0, len = b.inventory.length; i < len; i++) {
if (b.guns[b.inventory[i]].ammo !== Infinity) b.guns[b.inventory[i]].ammo = Math.max(0, Math.floor(ammoCount / b.inventory.length * b.guns[b.inventory[i]].ammoPack * (1.15 + 0.3 * (Math.random() - 0.5))))
if (b.guns[b.inventory[i]].ammo !== Infinity) b.guns[b.inventory[i]].ammo = Math.max(0, Math.floor(ammoCount / b.inventory.length * b.guns[b.inventory[i]].ammoPack * (2.5 + 0.3 * (Math.random() - 0.5))))
}
// console.log(b.activeGun)
//randomize tech
@@ -553,9 +557,6 @@ const m = {
lastCalculatedDefense: 0, //used to decided if defense bar needs to be redrawn (in simulation.checks)
defense() {
let dmg = 1
dmg *= m.fieldHarmReduction
// if (!tech.isFlipFlopOn && tech.isFlipFlopHealth) dmg *= 0.5
// 1.25 + Math.sin(m.cycle * 0.01)
if (tech.isDiaphragm) dmg *= 0.55 + 0.35 * Math.sin(m.cycle * 0.0075);
if (tech.isZeno) dmg *= 0.15
if (tech.isFieldHarmReduction) dmg *= 0.6
@@ -566,7 +567,7 @@ const m = {
if (tech.isHarmReduceNoKill && m.lastKillCycle + 300 < m.cycle) dmg *= 0.3
if (tech.squirrelFx !== 1) dmg *= 0.8//Math.pow(0.78, (tech.squirrelFx - 1) / 0.4)
if (tech.isAddBlockMass && m.isHolding) dmg *= 0.1
if (tech.isSpeedHarm && player.speed > 0.1) dmg *= 1 - Math.min(player.speed * 0.0193, 0.88) //capped at speed of 55
if (tech.isSpeedHarm && player.speed > 0.1) dmg *= 1 - Math.min(player.speed * 0.0193, 0.8) //capped at speed of 55
if (tech.isHarmReduce && input.field) dmg *= 0.1
if (tech.isNeutronium && input.field && m.fieldCDcycle < m.cycle) dmg *= 0.05
if (tech.isBotArmor) dmg *= 0.95 ** b.totalBots()
@@ -574,7 +575,9 @@ const m = {
if (tech.isNoFireDefense && m.cycle > m.fireCDcycle + 120) dmg *= 0.3
if (tech.isTurret && m.crouch) dmg *= 0.3;
if (tech.isFirstDer && b.inventory[0] === b.activeGun) dmg *= 0.85 ** b.inventory.length
return tech.isEnergyHealth ? Math.pow(dmg, 0.5) : dmg //defense has less effect
// return tech.isEnergyHealth ? Math.pow(dmg, 0.7) : dmg //defense has less effect
// dmg *= m.fieldHarmReduction
return dmg * m.fieldHarmReduction
},
rewind(steps) { // m.rewind(Math.floor(Math.min(599, 137 * m.energy)))
if (tech.isRewindGrenade) {
@@ -1541,7 +1544,7 @@ const m = {
m.isAltSkin = true
simulation.isAutoZoom = false;
m.draw = function () {
const amplitude = 8 + 4 * Math.sin(m.cycle * 0.0075)
const amplitude = 8 + 4 * Math.sin(m.cycle * 0.01)
ctx.fillStyle = m.fillColor;
m.walk_cycle += m.flipLegs * m.Vx;
ctx.save();
@@ -1572,13 +1575,13 @@ const m = {
//zoom camera in and out
// console.log(simulation.zoomScale)
simulation.setZoom(1800 + 400 * Math.sin(m.cycle * 0.0075))
simulation.setZoom(1800 + 400 * Math.sin(m.cycle * 0.01))
}
},
dilate2() {
m.isAltSkin = true
m.draw = function () {
const amplitude = Math.sin(m.cycle * 0.0075)
const amplitude = Math.sin(m.cycle * 0.01)
ctx.fillStyle = m.fillColor;
m.walk_cycle += m.flipLegs * m.Vx;
@@ -1595,7 +1598,7 @@ const m = {
ctx.fillStyle = m.bodyGradient
ctx.fill();
ctx.strokeStyle = "#345";
ctx.lineWidth = 3 + 3 * Math.sin(m.cycle * 0.0075 + Math.PI);
ctx.lineWidth = 3 + 3 * Math.sin(m.cycle * 0.01 + Math.PI);
ctx.stroke();
// ctx.arc(12, 0, 8 + 4 * amplitude, 0, 2 * Math.PI); //big eye
ctx.beginPath();
@@ -1608,7 +1611,7 @@ const m = {
ctx.restore();
m.yOff = m.yOff * 0.85 + m.yOffGoal * 0.15; //smoothly move leg height towards height goal
powerUps.boost.draw()
simulation.setZoom(1800 + 400 * Math.sin(m.cycle * 0.0075))
simulation.setZoom(1800 + 400 * amplitude)
}
m.drawLeg = function (stroke) {
// if (simulation.mouseInGame.x > m.pos.x) {
@@ -2860,17 +2863,17 @@ const m = {
return `<span style = 'font-size:95%;'><strong>deflecting</strong> condenses ${(0.1 * couple).toFixed(2)} <strong class='color-s'>ice IX</strong></span>`
// return `<span style = 'font-size:89%;'><strong>invulnerable</strong> <strong>+${2*couple}</strong> seconds post collision</span>`
case 3: //negative mass
return `<strong>${(100 * (1 - 0.973 ** couple)).toFixed(1)}%</strong> <strong class='color-defense'>damage taken</strong>`
return `<strong>${(0.973 ** couple).toFixed(2)}x</strong> <strong class='color-defense'>damage taken</strong>`
case 4: //assembler
return `<strong>+${(0.8 * couple).toFixed(1)}</strong> <strong class='color-f'>energy</strong> per second`
case 5: //plasma
return `<strong>${(1 + 1.5 * couple).toFixed(3)}x</strong> <strong class='color-d'>damage</strong>`
case 6: //time dilation
return `<strong>+${(5 * couple).toFixed(0)}%</strong> longer <strong style='letter-spacing: 2px;'>stopped time</strong>` //<strong>movement</strong>, <strong>jumping</strong>, and
return `<strong>+${(1 + 0.05 * couple).toFixed(2)}x</strong> longer <strong style='letter-spacing: 2px;'>stopped time</strong>` //<strong>movement</strong>, <strong>jumping</strong>, and
case 7: //cloaking
return `<strong>${(1 + 3.3 * couple).toFixed(3)}x</strong> ambush <strong class='color-d'>damage</strong>`
case 8: //pilot wave
return `<strong>+${(1 + 4 * couple).toFixed(2)}%</strong> <strong class='color-block'>block</strong> collision <strong class='color-d'>damage</strong>`
return `<strong>${(1 + 0.05 * couple).toFixed(2)}x</strong> <strong class='color-block'>block</strong> collision <strong class='color-d'>damage</strong>`
case 9: //wormhole
return `<span style = 'font-size:89%;'>after eating <strong class='color-block'>blocks</strong> <strong>+${(2 * couple).toFixed(0)}</strong> <strong class='color-f'>energy</strong></span>`
case 10: //grappling hook

View File

@@ -320,16 +320,12 @@ const powerUps = {
},
endDraft(type, isCanceled = false) { //type should be a gun, tech, or field
if (isCanceled) {
if (tech.isCancelTech && Math.random() < 0.85 && type !== "entanglement") {
// powerUps.research.use('tech')
powerUps[type].effect();
return
}
if (tech.isCancelDuplication) {
tech.duplication += 0.05
const value = 0.05
tech.duplication += value
tech.maxDuplicationEvent()
simulation.makeTextLog(`tech.duplicationChance() <span class='color-symbol'>+=</span> ${0.043}`)
simulation.circleFlare(0.043);
simulation.makeTextLog(`tech.duplicationChance() <span class='color-symbol'>+=</span> ${value}`)
simulation.circleFlare(value);
}
if (tech.isCancelRerolls) {
for (let i = 0, len = 10 + 4 * Math.random(); i < len; i++) {
@@ -345,21 +341,14 @@ const powerUps = {
}
}
if (tech.isCancelCouple) powerUps.spawnDelay("coupling", 8)
// if (tech.isCancelTech && Math.random() < 0.3) {
// powerUps.spawn(m.pos.x + 40 * (Math.random() - 0.5), m.pos.y + 40 * (Math.random() - 0.5), "tech", false);
// simulation.makeTextLog(`<strong>options exchange</strong>: returns 1 <strong class='color-m'>tech</strong>`)
// }
// if (tech.isBanish && type === 'tech') { // banish researched tech by adding them to the list of banished tech
// const banishLength = tech.isDeterminism ? 1 : 3 + tech.extraChoices * 2
// for (let i = 0; i < banishLength; i++) {
// const index = powerUps.tech.choiceLog.length - i - 1
// if (powerUps.tech.choiceLog[index] && tech.tech[powerUps.tech.choiceLog[index]]) {
// tech.tech[powerUps.tech.choiceLog[index]].isBanished = true
// }
// }
// simulation.makeTextLog(`powerUps.tech.length: ${Math.max(0,powerUps.tech.lastTotalChoices - banishLength)}`)
// }
if (tech.isCancelTech && tech.cancelTechCount === 0 && type !== "entanglement") {
tech.cancelTechCount++
// powerUps.research.use('tech')
powerUps[type].effect();
return
}
}
tech.cancelTechCount = 0
if (tech.isAnsatz && powerUps.research.count < 1) {
for (let i = 0; i < 3; i++) powerUps.spawn(m.pos.x + 40 * (Math.random() - 0.5), m.pos.y + 40 * (Math.random() - 0.5), "research", false);
}
@@ -386,7 +375,7 @@ const powerUps = {
if (this.count < 5) simulation.removeEphemera(this.name)
ctx.beginPath();
ctx.arc(m.pos.x, m.pos.y, this.count, 0, 2 * Math.PI);
ctx.arc(m.pos.x, m.pos.y, Math.max(3, this.count), 0, 2 * Math.PI);
ctx.fillStyle = color
ctx.fill();
// ctx.strokeStyle = "hsla(200,50%,61%,0.18)";
@@ -504,14 +493,15 @@ const powerUps = {
},
currentRerollCount: 0,
use(type) { //runs when you actually research a list of selections, type can be field, gun, or tech
if (tech.isJunkResearch && powerUps.research.currentRerollCount < 3) {
if (tech.isJunkResearch && powerUps.research.currentRerollCount < 2) {
tech.addJunkTechToPool(0.01)
} else {
powerUps.research.changeRerolls(-1)
}
if (tech.isResearchDamage) {
tech.damage *= 1.04
simulation.makeTextLog(`<strong>1.04x</strong> <strong class='color-d'>damage</strong> from <strong>peer review</strong>`);
tech.damage *= 1.05
simulation.makeTextLog(`<strong>1.05x</strong> <strong class='color-d'>damage</strong>`);
tech.addJunkTechToPool(0.01)
}
powerUps.research.currentRerollCount++
// if (tech.isBanish && type === 'tech') { // banish researched tech
@@ -610,7 +600,7 @@ const powerUps = {
}
}
if (powerUps.healGiveMaxEnergy) {
tech.healMaxEnergyBonus += 0.11 * tech.largerHeals * (tech.isHalfHeals ? 0.5 : 1)
tech.healMaxEnergyBonus += 0.14 * tech.largerHeals * (tech.isHalfHeals ? 0.5 : 1)
m.setMaxEnergy();
}
},
@@ -636,50 +626,23 @@ const powerUps = {
const target = b.guns[b.activeGun]
if (target.ammo !== Infinity) {
if (tech.ammoCap) {
const ammoAdded = Math.ceil(target.ammoPack * 0.7 * tech.ammoCap * 0.8 * couplingExtraAmmo) //0.7 is average
target.ammo = ammoAdded
// simulation.makeTextLog(`${target.name}.<span class='color-g'>ammo</span> <span class='color-symbol'>=</span> ${ammoAdded}`)
target.ammo = Math.ceil(2 * target.ammoPack * tech.ammoCap * couplingExtraAmmo)
} else {
const ammoAdded = Math.ceil((0.7 * Math.random() + 0.7 * Math.random()) * target.ammoPack * 0.8 * couplingExtraAmmo)
target.ammo += ammoAdded
// simulation.makeTextLog(`${target.name}.<span class='color-g'>ammo</span> <span class='color-symbol'>+=</span> ${ammoAdded}`)
target.ammo += Math.ceil(2 * (Math.random() + Math.random()) * target.ammoPack * couplingExtraAmmo)
}
}
} else { //give ammo to all guns in inventory
// let textLog = ""
for (let i = 0, len = b.inventory.length; i < len; i++) {
const target = b.guns[b.inventory[i]]
if (target.ammo !== Infinity) {
if (tech.ammoCap) {
const ammoAdded = Math.ceil(target.ammoPack * 0.45 * tech.ammoCap * couplingExtraAmmo) //0.45 is average
target.ammo = ammoAdded
// textLog += `${target.name}.<span class='color-g'>ammo</span> <span class='color-symbol'>=</span> ${ammoAdded}<br>`
target.ammo = Math.ceil(target.ammoPack * tech.ammoCap * couplingExtraAmmo)
} else { //default ammo behavior
const ammoAdded = Math.ceil((0.45 * Math.random() + 0.45 * Math.random()) * target.ammoPack * couplingExtraAmmo) //Math.ceil(Math.random() * target.ammoPack)
// console.log(ammoAdded, Math.ceil((0.45 * Math.random() + 0.45 * Math.random()) * target.ammoPack))
target.ammo += ammoAdded
// textLog += `${target.name}.<span class='color-g'>ammo</span> <span class='color-symbol'>+=</span> ${ammoAdded}<br>`
target.ammo += Math.ceil((Math.random() + Math.random()) * target.ammoPack * couplingExtraAmmo)
}
}
}
// simulation.makeTextLog(textLog)
}
// } else { //give ammo to all guns in inventory
// for (let i = 0, len = b.inventory.length; i < len; i++) {
// const target = b.guns[b.inventory[i]]
// if (target.ammo !== Infinity) {
// if (tech.ammoCap) {
// const ammoAdded = Math.ceil(target.ammoPack * 0.45 * tech.ammoCap) //0.45 is average
// target.ammo = ammoAdded
// simulation.makeTextLog(`${target.name}.<span class='color-g'>ammo</span> <span class='color-symbol'>=</span> ${ammoAdded}`)
// } else {
// const ammoAdded = Math.ceil((0.45 * Math.random() + 0.45 * Math.random()) * target.ammoPack) //Math.ceil(Math.random() * target.ammoPack)
// target.ammo += ammoAdded
// simulation.makeTextLog(`${target.name}.<span class='color-g'>ammo</span> <span class='color-symbol'>+=</span> ${ammoAdded}`)
// }
// }
// }
// }
simulation.updateGunHUD();
}
}
@@ -689,7 +652,7 @@ const powerUps = {
if (tech.isSuperDeterminism) {
return `<div></div>`
} else if (tech.isCancelTech) {
} else if (tech.isCancelTech && tech.cancelTechCount === 0) {
return `<div class='cancel-card' onclick='powerUps.endDraft("${type}",true)' style="width: 115px;">randomize</div>`
} else if (level.levelsCleared === 0 && localSettings.isTrainingNotAttempted && b.inventory.length === 0) { //don't show cancel if on initial level and haven't done tutorial
return `<div class='cancel-card' style="visibility: hidden;"></div>`
@@ -701,7 +664,7 @@ const powerUps = {
let text = ""
if (type === "entanglement") {
text += `<div class='choose-grid-module entanglement flipX' onclick='powerUps.endDraft("${type}",true)'>entanglement</div>`
} else if (tech.isJunkResearch && powerUps.research.currentRerollCount < 3) {
} else if (tech.isJunkResearch && powerUps.research.currentRerollCount < 2) {
text += `<div onclick="powerUps.research.use('${type}')" class='research-card'>` // style = "margin-left: 192px; margin-right: -192px;"
text += `<div><div> <span style="position:relative;">`
text += `<div class="circle-grid junk" style="position:absolute; top:0; left:${15 * i}px ;opacity:0.8; border: 1px #fff solid;width: 1.15em;height: 1.15em;"></div>`
@@ -720,7 +683,7 @@ const powerUps = {
let text = `<div class='research-cancel'>`
if (type === "entanglement") {
text += `<span class='research-card entanglement flipX' style="width: 275px;" onclick='powerUps.endDraft("${type}",true)'><span style="letter-spacing: 6px;">entanglement</span></span>` //&zwnj;
} else if (tech.isJunkResearch && powerUps.research.currentRerollCount < 3) {
} else if (tech.isJunkResearch && powerUps.research.currentRerollCount < 2) {
text += `<span onclick="powerUps.research.use('${type}')" class='research-card' style="width: 275px;float: left;">` // style = "margin-left: 192px; margin-right: -192px;"
text += `<div><div><span style="position:relative;">`
text += `<div class="circle-grid junk" style="position:absolute; top:0; left:${15 * i}px ;opacity:0.8; border: 1px #fff solid;width: 1.15em;height: 1.15em;"></div>`
@@ -729,7 +692,7 @@ const powerUps = {
text += `<span onclick="powerUps.research.use('${type}')" class='research-card' style="width: 275px;float: left;">` // style = "margin-left: 192px; margin-right: -192px;"
text += `<div><div><span style="position:relative;">`
let researchCap = 18
if (tech.isCancelTech) researchCap -= 2
if (tech.isCancelTech && tech.cancelTechCount === 0) researchCap -= 2
if (canvas.width < 1951) researchCap -= 3
if (canvas.width < 1711) researchCap -= 4
for (let i = 0, len = Math.min(powerUps.research.count, researchCap); i < len; i++) {
@@ -741,7 +704,7 @@ const powerUps = {
}
if (tech.isSuperDeterminism) {
text += `<span class='cancel-card' style="width: 95px;float: right;background-color: #aaa;color:#888;">cancel</span>`
} else if (tech.isCancelTech) {
} else if (tech.isCancelTech && tech.cancelTechCount === 0) {
text += `<span class='cancel-card' onclick='powerUps.endDraft("${type}",true)' style="width: 115px;float: right;font-size:0.9em;padding-top:5px">randomize</span>`
} else if (level.levelsCleared === 0 && localSettings.isTrainingNotAttempted && b.inventory.length === 0) {
text += `<span class='cancel-card' style="visibility: hidden;">cancel</span>` //don't show cancel if on initial level and haven't done tutorial
@@ -1163,18 +1126,8 @@ const powerUps = {
text += powerUps.fieldText(pick, `powerUps.choose('field',${pick})`)
}
}
// if (tech.isMicroTransactions && powerUps.research.count > 0) {
// const skins = [] //find skins
// for (let i = 0; i < tech.tech.length; i++) {
// if (tech.tech[i].isSkin) skins.push(i)
// }
// const choose = skins[Math.floor(Math.seededRandom(0, skins.length))] //pick an element from the array of options
// text += `<div class="choose-grid-module" onclick="tech.giveTech(${choose});powerUps.research.changeRerolls(-1);powerUps.endDraft('tech');powerUps.tech.effect();"><div class="grid-title"><div class="circle-grid research"></div> <span style = 'font-size:90%; font-weight: 100; letter-spacing: -1.5px;'>microtransaction:</span> ${tech.tech[choose].name}</div>${tech.tech[choose].descriptionFunction ? tech.tech[choose].descriptionFunction() : tech.tech[choose].description}</div>`
// }
if (tech.isBrainstorm && !tech.isBrainstormActive && !simulation.isChoosing) {
tech.isBrainstormActive = true
let count = 1
let timeStart = performance.now()
const cycle = (timestamp) => {
@@ -1194,33 +1147,9 @@ const powerUps = {
}
}
requestAnimationFrame(cycle);
// count++
// if (count < tech.brainStormDelay * 5 && simulation.isChoosing) {
// if (!(count % tech.brainStormDelay)) {
// powerUps.tech.effect();
// document.getElementById("choose-grid").style.pointerEvents = "auto"; //turn off the normal 500ms delay
// document.body.style.cursor = "auto";
// document.getElementById("choose-grid").style.transitionDuration = "0s";
// }
// requestAnimationFrame(cycle);
// } else {
// tech.isBrainstormActive = false
// }
}
// if (localSettings.isHideImages) text += powerUps.researchText('tech')
document.getElementById("choose-grid").innerHTML = text
powerUps.showDraft();
//fade in all circles
// requestAnimationFrame(() => {
// var elements = document.getElementsByClassName('circle-grid');
// for (var i in elements) {
// if (elements.hasOwnProperty(i)) {
// elements[i].style.opacity = '1';
// }
// }
// });
}
}
},
@@ -1287,18 +1216,17 @@ const powerUps = {
}
},
},
spawnDelay(type, num) {
let count = num
spawnDelay(type, count) {
count *= 2
let cycle = () => {
if (count > 0) {
if (m.alive) requestAnimationFrame(cycle);
if (!simulation.paused && !simulation.isChoosing) { //&& !(simulation.cycle % 2)
count--
const where = {
x: m.pos.x + 50 * (Math.random() - 0.5),
y: m.pos.y + 50 * (Math.random() - 0.5)
if (!(count % 2)) {
const where = { x: m.pos.x + 50 * (Math.random() - 0.5), y: m.pos.y + 50 * (Math.random() - 0.5) }
powerUps.spawn(where.x, where.y, type);
}
powerUps.spawn(where.x, where.y, type);
}
}
}
@@ -1483,6 +1411,7 @@ const powerUps = {
// powerUp[powerUp.length - 1].isDuplicated = true
}
// remove a random tech from the list of tech you have
tech.removeCount += tech.tech[choose].count
tech.tech[choose].remove();
tech.tech[choose].count = 0;
tech.tech[choose].isLost = true;
@@ -1501,6 +1430,7 @@ const powerUps = {
}
// remove a random tech from the list of tech you have
tech.tech[choose].remove();
tech.removeCount += tech.tech[choose].count
tech.tech[choose].count = 0;
tech.tech[choose].isLost = true;
simulation.updateTechHUD();
@@ -1513,34 +1443,17 @@ const powerUps = {
},
pauseEjectTech(index) {
if ((tech.isPauseEjectTech || simulation.testing) && !simulation.isChoosing && !tech.tech[index].isNonRefundable) {
if (Math.random() < 0.03 || tech.tech[index].isFromAppliedScience || (tech.tech[index].bonusResearch !== undefined && tech.tech[index].bonusResearch > powerUps.research.count)) {
tech.removeTech(index)
} else {
powerUps.ejectTech(index)
m.damage(0.04)
}
// if (tech.tech[index].bonusResearch !== undefined && tech.tech[index].bonusResearch > powerUps.research.count) {
// tech.removeTech(index)
// } else {
// }
powerUps.ejectTech(index)
m.damage(0.04)
document.getElementById(`${index}-pause-tech`).style.textDecoration = "line-through"
document.getElementById(`${index}-pause-tech`).style.animation = ""
document.getElementById(`${index}-pause-tech`).onclick = null
}
},
// removeRandomTech() {
// const have = [] //find which tech you have
// for (let i = 0; i < tech.tech.length; i++) {
// if (tech.tech[i].count > 0) have.push(i)
// }
// if (have.length) {
// const choose = have[Math.floor(Math.random() * have.length)]
// simulation.makeTextLog(`<span class='color-var'>tech</span>.removeTech("<span class='color-text'>${tech.tech[choose].name}</span>")`)
// const totalRemoved = tech.tech[choose].count
// tech.tech[choose].count = 0;
// tech.tech[choose].remove(); // remove a random tech form the list of tech you have
// tech.tech[choose].isLost = true
// simulation.updateTechHUD();
// return totalRemoved
// }
// return 0
// },
randomize(where) { //makes a random power up convert into a random different power up
//put 10 power ups close together
const len = Math.min(10, powerUp.length)

View File

@@ -791,7 +791,7 @@ const simulation = {
input.endKeySensing();
simulation.ephemera = []
tech.setupAllTech(); //sets tech to default values
b.removeAllGuns();
b.resetAllGuns();
tech.duplication = 0;
for (i = 0, len = b.guns.length; i < len; i++) { //find which gun
if (b.guns[i].name === "laser") b.guns[i].chooseFireMethod()

View File

@@ -2835,7 +2835,7 @@ const spawn = {
for (let i = 0; i < b.inventory.length; i++) {
const gun = b.guns[b.inventory[i]]
if (gun.ammo > 0 && gun.ammo !== Infinity) {
gun.ammo -= Math.ceil((0.45 * Math.random() + 0.45 * Math.random()) * gun.ammoPack) //Math.ceil(Math.random() * target.ammoPack)
gun.ammo -= Math.ceil((Math.random() + Math.random()) * gun.ammoPack)
if (gun.ammo < 0) gun.ammo = 0
isRemovedAmmo = true
}
@@ -3317,7 +3317,7 @@ const spawn = {
this.wing(this.angle - 2.1 - flapArc * Math.sin(simulation.cycle * this.flapRate), this.flapRadius)
const seeRange = 550 + 35 * simulation.difficultyMode;
if (this.distanceToPlayer() < seeRange) {
if (this.distanceToPlayer() < 1000) {
best = {
x: null,
y: null,
@@ -5938,7 +5938,7 @@ const spawn = {
for (let i = 0; i < b.inventory.length; i++) {
const gun = b.guns[b.inventory[i]]
if (gun.ammo > 0 && gun.ammo !== Infinity) {
gun.ammo -= Math.ceil((0.6 * Math.random() + 0.6 * Math.random()) * gun.ammoPack) //Math.ceil(Math.random() * target.ammoPack)
gun.ammo -= Math.ceil(1.1 * (Math.random() + Math.random()) * gun.ammoPack)
if (gun.ammo < 0) gun.ammo = 0
isRemovedAmmo = true
}

1339
js/tech.js

File diff suppressed because it is too large Load Diff

116
style.css
View File

@@ -519,38 +519,6 @@ summary {
border-radius: 5px;
}
/* keeps 4 columns at 1440px */
/* @media (1500px <= width < 1950px) {
.experiment-grid-module, .choose-grid-module, .pause-grid-module {
line-height: 150%;
font-size: 0.72em;
}
#experiment-grid, #choose-grid, .pause-grid{
grid-template-columns: repeat(auto-fit, 360px);
}
.card-background{
height:315px;
}
.card-text {
min-height: 82px;
}
}
@media (width < 1500px) {
.experiment-grid-module, .choose-grid-module, .pause-grid-module {
line-height: 143%;
font-size: 0.68em;
}
#experiment-grid, #choose-grid, .pause-grid{
grid-template-columns: repeat(auto-fit, 340px);
}
.card-background{
height:290px;
}
.card-text {
min-height: 75px;
}
} */
.experiment-grid-module:hover .card-text {
background-color: var(--hover-card-color);
}
@@ -695,77 +663,6 @@ summary {
display: none;
}
/* #damage-bar {
position: absolute;
top: 0px;
left: 15px;
height: 6px;
width: 0px;
transition: width 0.3s linear;
opacity: 1;
z-index: 2;
pointer-events: none;
background-color: #f03;
border: 1px solid #701;
display: none;
}
#defense-bar {
position: absolute;
top: 9px;
left: 15px;
height: 5px;
width: 0px;
transition: width 0.3s linear;
opacity: 1;
z-index: 2;
pointer-events: none;
background-color: #fff;
border: 1px solid #333;
display: none;
}
#health {
position: absolute;
top: 16px;
left: 15px;
height: 20px;
width: 0px;
transition: width 1s ease-out; z-index: 2;
pointer-events: none;
background-color: #0fa;
border: 2px solid rgb(51, 162, 125);
border-radius: 8px;
display: none;
}
#health-bg {
position: absolute;
top: 18px;
left: 15px;
height: 20px;
width: 0px;
transition: width 1s ease-out;
background-color: #000;
opacity: 0.1;
z-index: 1;
pointer-events: none;
border-radius: 8px;
display: none;
} */
/* .low-health {
animation: blink 250ms infinite alternate;
}
@keyframes blink {
from {
opacity: 1;
}
to {
opacity: 0.6;
}
} */
/* background on title page */
#fade-out {
position: absolute;
@@ -926,6 +823,15 @@ summary {
text-shadow: 1.5px -1.5px hsla(243, 100%, 38%, 0.2);
}
.color-remove {
text-decoration: line-through;
/* letter-spacing: 2px; */
border-radius: 3px;
padding: 0px 3px;
background-color: hsl(255, 40%, 71%);
color: #fff;
}
.color-cloaked {
letter-spacing: 2px;
animation: cloak 6s linear infinite alternate;
@@ -1090,7 +996,7 @@ summary {
background-color: #0d9;
border: 0.05em #fff solid;
opacity: 0.85;
margin-bottom: -3px;
margin-bottom: -2px;
}
.heal-circle-energy {
@@ -1101,7 +1007,7 @@ summary {
background-color: #ff0;
border: 0.05em #000 solid;
opacity: 0.85;
margin-bottom: -3px;
margin-bottom: -2px;
}
.coupling-circle {

View File

@@ -1,24 +1,62 @@
******************************************************** NEXT PATCH **************************************************
text rework
most numbers converted from "+50%" to "1.5x"
renamed defense -> damage taken
adjusted about 20 tech to round down or up their values to less decimals
for a few I added research cost or JUNK chance to balance rounding
added CSS style for "remove/eject" keyword
tech: deprecated - gain 1.05x damage for each tech removed this game
tech: externality - 1.1x damage, removing this gives 40 ammo power ups
paradigm shift no longer has a 3% failure rate
minus 3->4 health
it can remove applied science tech
removing strange loop gives a random removetech
new community map soft by Richard0820
tech: peer review - gain +damage each time you research
self-assembly scales with health not health percent
matter.js engine reverted back to 0.18 (to fix an issue with time dilation)
tech: marginal utility - give a specific gun 2x ammo per ammo power up
tech: interest - research, ammo, coupling, health increases by 6% at the start of each level
tech: Pareto efficiency - give each gun randomly 5x or 0.2x ammo per ammo power up
aperture 6->4s cycles between 1 to 2 -> 0.8 to 3 damage
mass-energy no longer has a reduction in defense effects
but it costs 2 research now
1st ionization energy 11->14 max energy per heal
colony: 1.5->1.6x spores 40->33% chance to spawn something different
laser cost formula changed to be independent of field regen
this makes the effects of cost and fire rate 33% bigger
free-electron laser 3.5->3x energy cost
options exchange - the first time you click cancel it randomizes choices
allows a free trigger from other cancel tech
pseudoscience gets 3->2 free researches
alternator harpoon has 0->0.03x energy cost
coupling for pilot wave gives 1.04->1.05x block damage
several bugs fixes
*********************************************************** TODO *****************************************************
removeJunkTechFromPool doesn't seem to remove the correct amount
make search not case sensitive
wormholes that end inside wall check to see if the space before the wall is safe and end there instead
can use laser code
tech: - (1 + 0.01)x for each tech, gun, field you've picked up
scales with born rule, duplication, remove tech
explosions have a chance to spawn spores
infinite feedback loop with spores that explode?
make sure healing isn't effected by simulation.healScale
instead heal orb size should be scaled
but the ratio between size and heal shouldn't be effected
tech - destroys a random tech each new level and gains +damage each time
tech - destroy all but active gun and convert ammo over to main gun
List of ways to break the game
CPT + high energy regen
research->bot fabrication-> ersatz bots -> various bot upgrades
grappling hook + high fire rate + alternator + time dilation
duplication 100%
interest + coupling, research + peer review?
electronegativity and high energy?
boss - tracks the position, velocity, angle of power ups, blocks, and bullets it fires
@@ -43,10 +81,6 @@ tech - getting a new gun also gives you 2 random tech for that gun
or a field?
can these guntech tech be converted into a player choice?
tech: interest - research and ammo increases by 10% at the start of each level?
spawn research and ammo at start of new level
extend to current health?
how to reduce the number of clicks and keypresses
auto fire mode
player shoots at whatever is nearby
@@ -1093,6 +1127,7 @@ possible names for tech
sidereal - with respect to the stars (an extra rotation for time keeping)
holonomy - parallel transport of a vector leads to movement (applies to curved space)
holographic - 2-D surface can predict the 3-D space behind it? I think
conformal - similar rules for small and big scales linked to holographic principle
hypergolic - A hypergolic propellant combination used in a rocket engine is one whose components spontaneously ignite when they come into contact with each other.
swarm intelligence - for a drone tech
metaheuristic - is a higher-level procedure or heuristic designed to find, generate, or select a heuristic (partial search algorithm) that may provide a sufficiently good solution to an optimization problem, especially with incomplete or imperfect information or limited computation capacity
@@ -1141,6 +1176,8 @@ possible names for tech
configuration space - holds the position of everything
stressenergy tensor
radioisotope thermoelectric generator -
retrovirus: these things make JUNK DNA so link it somehow to that tech?
Upon infection with a retrovirus, a cell converts the retroviral RNA into DNA and sometimes the DNA will be passed on to progeny as JUNK DNA
******************************************************** CARS IMAGES ********************************************************