ideal gas law

ideal gas law - lose all your current foam ammo;  foam gun gets 1200% more ammo from ammo power ups
pressure vessel - has 25% more charges produced as you hold

slashBoss is a bit slower and has a bit longer between slashes
reactor SprayBoss: slower to fire, slower to move, smaller bullets, fewer in number
  just a tiny nerf though

bug fixes
This commit is contained in:
landgreen
2022-05-21 10:43:57 -07:00
parent 6e1e256a1f
commit 25037cac0d
7 changed files with 103 additions and 79 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@@ -767,12 +767,14 @@ const b = {
// }, // },
fireworks(where, size) { //can occur after grenades detonate fireworks(where, size) { //can occur after grenades detonate
const cycle = () => { const cycle = () => {
if (simulation.paused || m.isBodiesAsleep) { requestAnimationFrame(cycle) } else { if (m.alive) {
count++ if (simulation.paused || m.isBodiesAsleep) { requestAnimationFrame(cycle) } else {
if (count < 110 && m.alive) requestAnimationFrame(cycle); count++
if (!(count % 10)) { if (count < 110) requestAnimationFrame(cycle);
const unit = Vector.rotate({ x: 1, y: 0 }, 6.28 * Math.random()) if (!(count % 10)) {
b.explosion(Vector.add(where, Vector.mult(unit, size * (count * 0.01 + 0.02 * Math.random()))), size * (0.4 + Math.random() * 0.35), `hsla(${360*Math.random()},100%,66%,0.6)`); //makes bullet do explosive damage at end const unit = Vector.rotate({ x: 1, y: 0 }, 6.28 * Math.random())
b.explosion(Vector.add(where, Vector.mult(unit, size * (count * 0.01 + 0.02 * Math.random()))), size * (0.4 + Math.random() * 0.35), `hsla(${360*Math.random()},100%,66%,0.6)`); //makes bullet do explosive damage at end
}
} }
} }
} }
@@ -782,12 +784,14 @@ const b = {
starburst(where, size) { //can occur after grenades detonate starburst(where, size) { //can occur after grenades detonate
const color = `hsla(${360*Math.random()},100%,66%,0.6)` const color = `hsla(${360*Math.random()},100%,66%,0.6)`
const cycle = () => { const cycle = () => {
if (simulation.paused || m.isBodiesAsleep) { requestAnimationFrame(cycle) } else { if (m.alive) {
count++ if (simulation.paused || m.isBodiesAsleep) { requestAnimationFrame(cycle) } else {
if (count < 21 && m.alive) requestAnimationFrame(cycle); count++
if (count % 2) { if (count < 21) requestAnimationFrame(cycle);
const unit = Vector.rotate({ x: 1, y: 0 }, curl * 6.28 * count / 18 + off) if (count % 2) {
b.explosion(Vector.add(where, Vector.mult(unit, size * 0.75)), size * 0.7, color); //makes bullet do explosive damage at end const unit = Vector.rotate({ x: 1, y: 0 }, curl * 6.28 * count / 18 + off)
b.explosion(Vector.add(where, Vector.mult(unit, size * 0.75)), size * 0.7, color); //makes bullet do explosive damage at end
}
} }
} }
} }
@@ -800,27 +804,29 @@ const b = {
// size *= b.explosionRange() // size *= b.explosionRange()
const range = size * Math.sqrt(b.explosionRange()) const range = size * Math.sqrt(b.explosionRange())
const cycle = () => { const cycle = () => {
if (simulation.paused || m.isBodiesAsleep) { requestAnimationFrame(cycle) } else { if (m.alive) {
if (count < 30 && m.alive) requestAnimationFrame(cycle); if (simulation.paused || m.isBodiesAsleep) { requestAnimationFrame(cycle) } else {
if (count === 0) { if (count < 30 && m.alive) requestAnimationFrame(cycle);
const color = `hsla(${360*Math.random()},100%,66%,0.6)` if (count === 0) {
b.explosion(where, size * 0.8, color); const color = `hsla(${360*Math.random()},100%,66%,0.6)`
} b.explosion(where, size * 0.8, color);
if (count === 8) {
const color = `hsla(${360*Math.random()},100%,66%,0.6)`
for (let i = 0, len = 6; i < len; i++) {
const unit = Vector.rotate({ x: 1, y: 0 }, 6.28 * i / len)
b.explosion(Vector.add(where, Vector.mult(unit, 1.2 * range)), size * 0.6, color); //makes bullet do explosive damage at end
} }
} if (count === 8) {
if (count === 16) { const color = `hsla(${360*Math.random()},100%,66%,0.6)`
const color = `hsla(${360*Math.random()},100%,66%,0.6)` for (let i = 0, len = 6; i < len; i++) {
for (let i = 0, len = 10; i < len; i++) { const unit = Vector.rotate({ x: 1, y: 0 }, 6.28 * i / len)
const unit = Vector.rotate({ x: 1, y: 0 }, 6.28 * i / len) b.explosion(Vector.add(where, Vector.mult(unit, 1.2 * range)), size * 0.6, color); //makes bullet do explosive damage at end
b.explosion(Vector.add(where, Vector.mult(unit, 1.75 * range)), size * 0.45, color); //makes bullet do explosive damage at end }
} }
if (count === 16) {
const color = `hsla(${360*Math.random()},100%,66%,0.6)`
for (let i = 0, len = 10; i < len; i++) {
const unit = Vector.rotate({ x: 1, y: 0 }, 6.28 * i / len)
b.explosion(Vector.add(where, Vector.mult(unit, 1.75 * range)), size * 0.45, color); //makes bullet do explosive damage at end
}
}
count++
} }
count++
} }
} }
let count = 0 let count = 0
@@ -6167,7 +6173,7 @@ const b = {
name: "foam", //8 name: "foam", //8
description: "spray bubbly foam that <strong>sticks</strong> to mobs<br><strong class='color-s'>slows</strong> mobs and does <strong class='color-d'>damage</strong> over time", description: "spray bubbly foam that <strong>sticks</strong> to mobs<br><strong class='color-s'>slows</strong> mobs and does <strong class='color-d'>damage</strong> over time",
ammo: 0, ammo: 0,
ammoPack: 24, ammoPack: 24, //set in froth flotation
have: false, have: false,
charge: 0, charge: 0,
isDischarge: false, isDischarge: false,
@@ -6208,7 +6214,7 @@ const b = {
ctx.fill(); ctx.fill();
if (this.isDischarge && m.cycle % 2) { if (this.isDischarge && m.cycle % 2) {
this.charge-- this.charge -= 0.75
const spread = (input.down ? 0.04 : 0.5) * (Math.random() - 0.5) const spread = (input.down ? 0.04 : 0.5) * (Math.random() - 0.5)
const radius = 5 + 8 * Math.random() + (tech.isAmmoFoamSize && this.ammo < 300) * 12 const radius = 5 + 8 * Math.random() + (tech.isAmmoFoamSize && this.ammo < 300) * 12
const SPEED = (input.down ? 1.2 : 1) * 10 - radius * 0.4 + Math.min(5, Math.sqrt(this.charge)); const SPEED = (input.down ? 1.2 : 1) * 10 - radius * 0.4 + Math.min(5, Math.sqrt(this.charge));

View File

@@ -23,7 +23,7 @@ const level = {
// tech.giveTech("flame test") // tech.giveTech("flame test")
// tech.giveTech("pyrotechnics") // tech.giveTech("pyrotechnics")
// for (let i = 0; i < 10; i++) tech.giveTech("replication") // for (let i = 0; i < 10; i++) tech.giveTech("replication")
// tech.giveTech("acetone peroxide") // tech.giveTech("eternalism")
// for (let i = 0; i < 10; i++) tech.giveTech("ammonium nitrate") // for (let i = 0; i < 10; i++) tech.giveTech("ammonium nitrate")
// for (let i = 0; i < 10; i++) powerUps.directSpawn(450, -50, "tech"); // for (let i = 0; i < 10; i++) powerUps.directSpawn(450, -50, "tech");
// for (let i = 0; i < 10; i++) powerUps.directSpawn(450, -50, "research"); // for (let i = 0; i < 10; i++) powerUps.directSpawn(450, -50, "research");
@@ -41,6 +41,8 @@ const level = {
// simulation.enableConstructMode() //used to build maps in testing mode // simulation.enableConstructMode() //used to build maps in testing mode
// level.temple(); // level.temple();
// level.testing(); //not in rotation, used for testing // level.testing(); //not in rotation, used for testing
// spawn.slashBoss(1900, -500)
if (simulation.isTraining) { level.walk(); } else { level.intro(); } //normal starting level ************************************************ if (simulation.isTraining) { level.walk(); } else { level.intro(); } //normal starting level ************************************************
// powerUps.research.changeRerolls(3000) // powerUps.research.changeRerolls(3000)
// for (let i = 0; i < 30; i++) powerUps.spawn(player.position.x + Math.random() * 50, player.position.y - Math.random() * 50, "tech", false); // for (let i = 0; i < 30; i++) powerUps.spawn(player.position.x + Math.random() * 50, player.position.y - Math.random() * 50, "tech", false);
@@ -2652,7 +2654,7 @@ const level = {
// spawn.slashBoss(1900, -500) // spawn.slashBoss(1900, -500)
// spawn.launcherBoss(3200, -500) // spawn.launcherBoss(3200, -500)
// spawn.laserTargetingBoss(1700, -500) // spawn.laserTargetingBoss(1700, -500)
spawn.powerUpBoss(1900, -500) // spawn.powerUpBoss(1900, -500)
// spawn.powerUpBossBaby(3200, -500) // spawn.powerUpBossBaby(3200, -500)
// spawn.snakeBoss(1700, -500) // spawn.snakeBoss(1700, -500)
// spawn.streamBoss(3200, -500) // spawn.streamBoss(3200, -500)
@@ -2758,7 +2760,7 @@ const level = {
if (Math.random() < 0.33) { if (Math.random() < 0.33) {
for (let i = 0, len = scale * 0.1; i < len; ++i) spawn.bounceBoss(1487 + 200 * i, -1525, 80, false); //spawn 1-2 at difficulty 15 for (let i = 0, len = scale * 0.1; i < len; ++i) spawn.bounceBoss(1487 + 200 * i, -1525, 80, false); //spawn 1-2 at difficulty 15
} else if (Math.random() < 0.5) { } else if (Math.random() < 0.5) {
for (let i = 0, len = scale * 0.17; i < len; ++i) spawn.sprayBoss(1487 + 200 * i, -1525, 30, false) //spawn 2-3 at difficulty 15 for (let i = 0, len = scale * 0.16; i < len; ++i) spawn.sprayBoss(1487 + 200 * i, -1525, 30, false) //spawn 2-3 at difficulty 15
} else { } else {
for (let i = 0, len = scale * 0.23; i < len; ++i) spawn.mineBoss(1487 + 200 * i, -1525, 50, false); //spawn 3-4 at difficulty 15 for (let i = 0, len = scale * 0.23; i < len; ++i) spawn.mineBoss(1487 + 200 * i, -1525, 50, false); //spawn 3-4 at difficulty 15
} }

View File

@@ -237,6 +237,7 @@ const powerUps = {
} }
}, },
choose(type, index) { choose(type, index) {
console.log('choose')
if (type === "gun") { if (type === "gun") {
b.giveGuns(index) b.giveGuns(index)
let text = `b.giveGuns("<span class='color-text'>${b.guns[index].name}</span>")` let text = `b.giveGuns("<span class='color-text'>${b.guns[index].name}</span>")`
@@ -248,9 +249,7 @@ const powerUps = {
} else if (type === "field") { } else if (type === "field") {
m.setField(index) m.setField(index)
} else if (type === "tech") { } else if (type === "tech") {
setTimeout(() => { setTimeout(() => { powerUps.lastTechIndex = index }, 10);
powerUps.lastTechIndex = index
}, 10);
simulation.makeTextLog(`<span class='color-var'>tech</span>.giveTech("<span class='color-text'>${tech.tech[index].name}</span>")`); simulation.makeTextLog(`<span class='color-var'>tech</span>.giveTech("<span class='color-text'>${tech.tech[index].name}</span>")`);
tech.giveTech(index) tech.giveTech(index)
} }
@@ -280,8 +279,16 @@ const powerUps = {
if (!simulation.paused) { if (!simulation.paused) {
if (tech.isNoDraftPause) { if (tech.isNoDraftPause) {
// powerUps.spawn(m.pos.x, m.pos.y, "ammo");
document.getElementById("choose-grid").style.opacity = "0.7" const cycle = () => {
m.fireCDcycle = m.cycle + 5; //fire cooldown
if (simulation.isChoosing && m.alive) requestAnimationFrame(cycle)
}
requestAnimationFrame(cycle);
document.getElementById("choose-grid").style.opacity = "0.8"
} else { } else {
simulation.paused = true; simulation.paused = true;
document.getElementById("choose-grid").style.opacity = "1" document.getElementById("choose-grid").style.opacity = "1"

View File

@@ -3556,8 +3556,8 @@ const spawn = {
let me = mob[mob.length - 1]; let me = mob[mob.length - 1];
me.isBoss = true; me.isBoss = true;
me.inertia = Infinity; //no rotation me.inertia = Infinity; //no rotation
me.burstFireFreq = 18 + Math.floor(14 * simulation.CDScale) me.burstFireFreq = 22 + Math.floor(15 * simulation.CDScale)
me.burstTotalPhases = 3 + Math.floor(2 / simulation.CDScale) me.burstTotalPhases = 3.5 + Math.floor(1.5 / simulation.CDScale)
me.frictionStatic = 0; me.frictionStatic = 0;
me.friction = 0; me.friction = 0;
me.frictionAir = 0; me.frictionAir = 0;
@@ -3605,8 +3605,8 @@ const spawn = {
if (this.speed < 0.01) { if (this.speed < 0.01) {
Matter.Body.setVelocity(this, Vector.mult(Vector.normalise(Vector.sub(player.position, this.position)), 0.1)); Matter.Body.setVelocity(this, Vector.mult(Vector.normalise(Vector.sub(player.position, this.position)), 0.1));
} else { } else {
if (Math.abs(this.velocity.y) < 13) Matter.Body.setVelocity(this, { x: this.velocity.x, y: this.velocity.y * 1.07 }); if (Math.abs(this.velocity.y) < 12) Matter.Body.setVelocity(this, { x: this.velocity.x, y: this.velocity.y * 1.07 });
if (Math.abs(this.velocity.x) < 10) Matter.Body.setVelocity(this, { x: this.velocity.x * 1.07, y: this.velocity.y }); if (Math.abs(this.velocity.x) < 9) Matter.Body.setVelocity(this, { x: this.velocity.x * 1.07, y: this.velocity.y });
} }
} }
me.burstFire = function() { me.burstFire = function() {
@@ -3640,8 +3640,8 @@ const spawn = {
if (this.phaseCycle > -1) { if (this.phaseCycle > -1) {
Matter.Body.rotate(this, 0.02) Matter.Body.rotate(this, 0.02)
for (let i = 0, len = this.vertices.length; i < len; i++) { //fire a bullet from each vertex for (let i = 0, len = this.vertices.length; i < len; i++) { //fire a bullet from each vertex
spawn.sniperBullet(this.vertices[i].x, this.vertices[i].y, 8, 4); spawn.sniperBullet(this.vertices[i].x, this.vertices[i].y, 6, 4);
const velocity = Vector.mult(Vector.normalise(Vector.sub(this.position, this.vertices[i])), -20) const velocity = Vector.mult(Vector.normalise(Vector.sub(this.position, this.vertices[i])), -17)
Matter.Body.setVelocity(mob[mob.length - 1], { Matter.Body.setVelocity(mob[mob.length - 1], {
x: velocity.x, x: velocity.x,
y: velocity.y y: velocity.y
@@ -3929,9 +3929,9 @@ const spawn = {
me.damageReduction = 0.1 / (tech.isScaleMobsWithDuplication ? 1 + tech.duplicationChance() : 1) me.damageReduction = 0.1 / (tech.isScaleMobsWithDuplication ? 1 + tech.duplicationChance() : 1)
me.startingDamageReduction = me.damageReduction me.startingDamageReduction = me.damageReduction
me.isInvulnerable = false me.isInvulnerable = false
me.frictionAir = 0.01 me.frictionAir = 0.02
me.seeAtDistance2 = 1000000; me.seeAtDistance2 = 1000000;
me.accelMag = 0.001 + 0.0003 * simulation.accelScale; me.accelMag = 0.0004 + 0.00015 * simulation.accelScale;
Matter.Body.setDensity(me, 0.0005); //normal is 0.001 Matter.Body.setDensity(me, 0.0005); //normal is 0.001
me.collisionFilter.mask = cat.bullet | cat.player | cat.body | cat.map me.collisionFilter.mask = cat.bullet | cat.player | cat.body | cat.map
me.memory = Infinity; me.memory = Infinity;
@@ -3939,7 +3939,7 @@ const spawn = {
me.lockedOn = null; me.lockedOn = null;
me.torqueMagnitude = 0.00024 * me.inertia * (Math.random() > 0.5 ? -1 : 1); me.torqueMagnitude = 0.00024 * me.inertia * (Math.random() > 0.5 ? -1 : 1);
me.delay = 60 + 60 * simulation.CDScale; me.delay = 70 + 70 * simulation.CDScale;
me.cd = 0; me.cd = 0;
me.swordRadius = 0; me.swordRadius = 0;
me.swordVertex = 1 me.swordVertex = 1

View File

@@ -602,9 +602,9 @@ const tech = {
frequency: 1, frequency: 1,
frequencyDefault: 1, frequencyDefault: 1,
allowed() { allowed() {
return !tech.isAmmoFromHealth return !tech.isAmmoFromHealth && !tech.isEnergyNoAmmo
}, },
requires: "not catabolism", requires: "not catabolism, ideal gas law",
effect() { effect() {
tech.isEnergyNoAmmo = true; tech.isEnergyNoAmmo = true;
}, },
@@ -913,7 +913,7 @@ const tech = {
{ {
name: "zoospore vector", name: "zoospore vector",
link: `<a target="_blank" href='https://en.wikipedia.org/wiki/Disease_vector' class="link">zoospore vector</a>`, link: `<a target="_blank" href='https://en.wikipedia.org/wiki/Disease_vector' class="link">zoospore vector</a>`,
description: "mobs produce <strong class='color-p' style='letter-spacing: 2px;'>spores</strong> when they <strong>die</strong><br><strong>11%</strong> chance", description: "mobs produce <strong class='color-p' style='letter-spacing: 2px;'>spores</strong> when they <strong>die</strong><br><strong>10%</strong> chance",
maxCount: 9, maxCount: 9,
count: 0, count: 0,
frequency: 1, frequency: 1,
@@ -923,7 +923,7 @@ const tech = {
}, },
requires: "no other mob death tech", requires: "no other mob death tech",
effect() { effect() {
tech.sporesOnDeath += 0.11; tech.sporesOnDeath += 0.1;
// if (tech.isSporeWorm) { // if (tech.isSporeWorm) {
// for (let i = 0; i < 4; i++) b.worm(m.pos) // for (let i = 0; i < 4; i++) b.worm(m.pos)
// } else { // } else {
@@ -5657,7 +5657,7 @@ const tech = {
}, },
{ {
name: "surface tension", name: "surface tension",
description: "<strong>foam</strong> bubbles have improved adhesion which<br>does <strong>41%</strong> more <strong class='color-d'>damage</strong> per second", description: "<strong>foam</strong> bubbles have improved adhesion which<br>does <strong>41%</strong> more <strong class='color-d'>damage</strong>",
isGunTech: true, isGunTech: true,
maxCount: 9, maxCount: 9,
count: 0, count: 0,
@@ -5676,7 +5676,7 @@ const tech = {
}, },
{ {
name: "foam fractionation", name: "foam fractionation",
description: "<strong>foam</strong> gun bubbles are <strong>100%</strong> larger<br>when you have below <strong>300</strong> <strong>foam</strong>", description: "<strong>foam</strong> gun bubbles are <strong>100%</strong> larger<br>when you have below <strong>300</strong> <strong class='color-ammo'>ammo</strong>",
isGunTech: true, isGunTech: true,
maxCount: 1, maxCount: 1,
count: 0, count: 0,
@@ -5693,6 +5693,33 @@ const tech = {
tech.isAmmoFoamSize = false; tech.isAmmoFoamSize = false;
} }
}, },
{
name: "ideal gas law",
description: `flush away <strong>all</strong> of your current <strong>foam</strong> <strong class='color-ammo'>ammo</strong><br>gain <strong>1200%</strong> more <strong>foam</strong> <strong class='color-ammo'>ammo</strong> from ${powerUps.orb.ammo(1)}`,
isGunTech: true,
maxCount: 1,
count: 0,
frequency: 2,
frequencyDefault: 2,
allowed() {
return tech.haveGunCheck("foam") && !tech.isEnergyNoAmmo
},
requires: "foam, not exciton",
ammoLost: 0,
effect() {
b.guns[8].ammoPack = b.guns[8].ammoPack * 12;
this.ammoLost = b.guns[8].ammo
b.guns[8].ammo = 0
simulation.updateGunHUD()
},
remove() {
if (this.count) {
b.guns[8].ammoPack = 24
b.guns[8].ammo += this.ammoLost
simulation.updateGunHUD()
}
}
},
{ {
name: "pressure vessel", name: "pressure vessel",
description: "the <strong>foam</strong> gun builds up pressure as you fire<br>that discharges <strong>foam</strong> after firing", description: "the <strong>foam</strong> gun builds up pressure as you fire<br>that discharges <strong>foam</strong> after firing",
@@ -10187,5 +10214,5 @@ const tech = {
foamDamage: null, foamDamage: null,
isClusterExplode: null, isClusterExplode: null,
isCircleExplode: null, isCircleExplode: null,
isPetalsExplode: null isPetalsExplode: null,
} }

View File

@@ -1,34 +1,16 @@
******************************************************** NEXT PATCH ************************************************** ******************************************************** NEXT PATCH **************************************************
grenade now has 3 fireworks options, you can only have 1 at a time ideal gas law - lose all your current foam ammo; foam gun gets 1200% more ammo from ammo power ups
flame test, fireworks, pyrotechnics pressure vessel - has 25% more charges produced as you hold
implosion has been removed
controlled explosion 3->4 research
base matter wave moves 20% faster slashBoss is a bit slower and has a bit longer between slashes
gun science renamed ordnance reactor SprayBoss: slower to fire, slower to move, smaller bullets, fewer in number
just a tiny nerf though
bug fixes bug fixes
******************************************************** TODO ******************************************************** ******************************************************** TODO ********************************************************
buff early matter wave without phonon
more fireworks themed grenade tech
shooting star - fire a series of explosions higher and higher up, also increase radius with height
tech - neutron bombs deal 100% more damage, but finishes detonating much faster
tech - neutron bombs will explode into a small iridum explosion after it expires
tech: damage mobs in your last 10 seconds of history
field tech?
time dilation?
tech: eternalism - don't pause time during draft
bugs?
requirements change after draft is generated
check for requirements onclick and give random tech if not met?
tech expansion: should also make other fields do things tech expansion: should also make other fields do things
how to make the description work how to make the description work
change description based on your current field? change description based on your current field?