Skip to content

Commit

Permalink
ideal gas law
Browse files Browse the repository at this point in the history
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
  • Loading branch information
landgreen committed May 21, 2022
1 parent 6e1e256 commit 25037ca
Show file tree
Hide file tree
Showing 7 changed files with 103 additions and 79 deletions.
Binary file modified .DS_Store
Binary file not shown.
70 changes: 38 additions & 32 deletions js/bullet.js
Original file line number Diff line number Diff line change
Expand Up @@ -767,12 +767,14 @@ const b = {
// },
fireworks(where, size) { //can occur after grenades detonate
const cycle = () => {
if (simulation.paused || m.isBodiesAsleep) { requestAnimationFrame(cycle) } else {
count++
if (count < 110 && m.alive) requestAnimationFrame(cycle);
if (!(count % 10)) {
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
if (m.alive) {
if (simulation.paused || m.isBodiesAsleep) { requestAnimationFrame(cycle) } else {
count++
if (count < 110) requestAnimationFrame(cycle);
if (!(count % 10)) {
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
}
}
}
}
Expand All @@ -782,12 +784,14 @@ const b = {
starburst(where, size) { //can occur after grenades detonate
const color = `hsla(${360*Math.random()},100%,66%,0.6)`
const cycle = () => {
if (simulation.paused || m.isBodiesAsleep) { requestAnimationFrame(cycle) } else {
count++
if (count < 21 && m.alive) requestAnimationFrame(cycle);
if (count % 2) {
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
if (m.alive) {
if (simulation.paused || m.isBodiesAsleep) { requestAnimationFrame(cycle) } else {
count++
if (count < 21) requestAnimationFrame(cycle);
if (count % 2) {
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
}
}
}
}
Expand All @@ -800,27 +804,29 @@ const b = {
// size *= b.explosionRange()
const range = size * Math.sqrt(b.explosionRange())
const cycle = () => {
if (simulation.paused || m.isBodiesAsleep) { requestAnimationFrame(cycle) } else {
if (count < 30 && m.alive) requestAnimationFrame(cycle);
if (count === 0) {
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 (m.alive) {
if (simulation.paused || m.isBodiesAsleep) { requestAnimationFrame(cycle) } else {
if (count < 30 && m.alive) requestAnimationFrame(cycle);
if (count === 0) {
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 === 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
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
Expand Down Expand Up @@ -6167,7 +6173,7 @@ const b = {
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",
ammo: 0,
ammoPack: 24,
ammoPack: 24, //set in froth flotation
have: false,
charge: 0,
isDischarge: false,
Expand Down Expand Up @@ -6208,7 +6214,7 @@ const b = {
ctx.fill();

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 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));
Expand Down
8 changes: 5 additions & 3 deletions js/level.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const level = {
// tech.giveTech("flame test")
// tech.giveTech("pyrotechnics")
// 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++) powerUps.directSpawn(450, -50, "tech");
// for (let i = 0; i < 10; i++) powerUps.directSpawn(450, -50, "research");
Expand All @@ -41,6 +41,8 @@ const level = {
// simulation.enableConstructMode() //used to build maps in testing mode
// level.temple();
// level.testing(); //not in rotation, used for testing
// spawn.slashBoss(1900, -500)

if (simulation.isTraining) { level.walk(); } else { level.intro(); } //normal starting level ************************************************
// 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);
Expand Down Expand Up @@ -2652,7 +2654,7 @@ const level = {
// spawn.slashBoss(1900, -500)
// spawn.launcherBoss(3200, -500)
// spawn.laserTargetingBoss(1700, -500)
spawn.powerUpBoss(1900, -500)
// spawn.powerUpBoss(1900, -500)
// spawn.powerUpBossBaby(3200, -500)
// spawn.snakeBoss(1700, -500)
// spawn.streamBoss(3200, -500)
Expand Down Expand Up @@ -2758,7 +2760,7 @@ const level = {
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
} 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 {
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
}
Expand Down
17 changes: 12 additions & 5 deletions js/powerup.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ const powerUps = {
}
},
choose(type, index) {
console.log('choose')
if (type === "gun") {
b.giveGuns(index)
let text = `b.giveGuns("<span class='color-text'>${b.guns[index].name}</span>")`
Expand All @@ -248,9 +249,7 @@ const powerUps = {
} else if (type === "field") {
m.setField(index)
} else if (type === "tech") {
setTimeout(() => {
powerUps.lastTechIndex = index
}, 10);
setTimeout(() => { powerUps.lastTechIndex = index }, 10);
simulation.makeTextLog(`<span class='color-var'>tech</span>.giveTech("<span class='color-text'>${tech.tech[index].name}</span>")`);
tech.giveTech(index)
}
Expand Down Expand Up @@ -280,8 +279,16 @@ const powerUps = {

if (!simulation.paused) {
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 {
simulation.paused = true;
document.getElementById("choose-grid").style.opacity = "1"
Expand Down
18 changes: 9 additions & 9 deletions js/spawn.js
Original file line number Diff line number Diff line change
Expand Up @@ -3556,8 +3556,8 @@ const spawn = {
let me = mob[mob.length - 1];
me.isBoss = true;
me.inertia = Infinity; //no rotation
me.burstFireFreq = 18 + Math.floor(14 * simulation.CDScale)
me.burstTotalPhases = 3 + Math.floor(2 / simulation.CDScale)
me.burstFireFreq = 22 + Math.floor(15 * simulation.CDScale)
me.burstTotalPhases = 3.5 + Math.floor(1.5 / simulation.CDScale)
me.frictionStatic = 0;
me.friction = 0;
me.frictionAir = 0;
Expand Down Expand Up @@ -3605,8 +3605,8 @@ const spawn = {
if (this.speed < 0.01) {
Matter.Body.setVelocity(this, Vector.mult(Vector.normalise(Vector.sub(player.position, this.position)), 0.1));
} 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.x) < 10) Matter.Body.setVelocity(this, { x: this.velocity.x * 1.07, y: this.velocity.y });
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) < 9) Matter.Body.setVelocity(this, { x: this.velocity.x * 1.07, y: this.velocity.y });
}
}
me.burstFire = function() {
Expand Down Expand Up @@ -3640,8 +3640,8 @@ const spawn = {
if (this.phaseCycle > -1) {
Matter.Body.rotate(this, 0.02)
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);
const velocity = Vector.mult(Vector.normalise(Vector.sub(this.position, this.vertices[i])), -20)
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])), -17)
Matter.Body.setVelocity(mob[mob.length - 1], {
x: velocity.x,
y: velocity.y
Expand Down Expand Up @@ -3929,17 +3929,17 @@ const spawn = {
me.damageReduction = 0.1 / (tech.isScaleMobsWithDuplication ? 1 + tech.duplicationChance() : 1)
me.startingDamageReduction = me.damageReduction
me.isInvulnerable = false
me.frictionAir = 0.01
me.frictionAir = 0.02
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
me.collisionFilter.mask = cat.bullet | cat.player | cat.body | cat.map
me.memory = Infinity;
me.seePlayerFreq = 20
me.lockedOn = null;

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.swordRadius = 0;
me.swordVertex = 1
Expand Down
41 changes: 34 additions & 7 deletions js/tech.js
Original file line number Diff line number Diff line change
Expand Up @@ -602,9 +602,9 @@ const tech = {
frequency: 1,
frequencyDefault: 1,
allowed() {
return !tech.isAmmoFromHealth
return !tech.isAmmoFromHealth && !tech.isEnergyNoAmmo
},
requires: "not catabolism",
requires: "not catabolism, ideal gas law",
effect() {
tech.isEnergyNoAmmo = true;
},
Expand Down Expand Up @@ -913,7 +913,7 @@ const tech = {
{
name: "zoospore vector",
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,
count: 0,
frequency: 1,
Expand All @@ -923,7 +923,7 @@ const tech = {
},
requires: "no other mob death tech",
effect() {
tech.sporesOnDeath += 0.11;
tech.sporesOnDeath += 0.1;
// if (tech.isSporeWorm) {
// for (let i = 0; i < 4; i++) b.worm(m.pos)
// } else {
Expand Down Expand Up @@ -5657,7 +5657,7 @@ const tech = {
},
{
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,
maxCount: 9,
count: 0,
Expand All @@ -5676,7 +5676,7 @@ const tech = {
},
{
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,
maxCount: 1,
count: 0,
Expand All @@ -5693,6 +5693,33 @@ const tech = {
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",
description: "the <strong>foam</strong> gun builds up pressure as you fire<br>that discharges <strong>foam</strong> after firing",
Expand Down Expand Up @@ -10187,5 +10214,5 @@ const tech = {
foamDamage: null,
isClusterExplode: null,
isCircleExplode: null,
isPetalsExplode: null
isPetalsExplode: null,
}
28 changes: 5 additions & 23 deletions todo.txt
Original file line number Diff line number Diff line change
@@ -1,34 +1,16 @@
******************************************************** NEXT PATCH **************************************************

grenade now has 3 fireworks options, you can only have 1 at a time
flame test, fireworks, pyrotechnics
implosion has been removed
controlled explosion 3->4 research
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

base matter wave moves 20% faster
gun science renamed ordnance
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

******************************************************** 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
how to make the description work
change description based on your current field?
Expand Down

0 comments on commit 25037ca

Please sign in to comment.