diff --git a/.DS_Store b/.DS_Store
index 2c514fd..2eb844f 100644
Binary files a/.DS_Store and b/.DS_Store differ
diff --git a/js/bullet.js b/js/bullet.js
index de92e42..3bde08b 100644
--- a/js/bullet.js
+++ b/js/bullet.js
@@ -3608,33 +3608,33 @@ const b = {
name: "wave beam",
description: "emit a sine wave of oscillating particles
propagates through walls",
ammo: 0,
- ammoPack: 70,
+ ammoPack: 65,
have: false,
- do() {},
- fire() {
- m.fireCDcycle = m.cycle + Math.floor(3 * b.fireCD); // cool down
- const dir = m.angle
- const SPEED = 10
- let wiggleMag
- if (tech.waveHelix === 2) {
- wiggleMag = (m.crouch ? 6 : 12) * (1 + Math.sin(m.cycle * 0.1))
- } else {
- wiggleMag = m.crouch ? 6 : 12
+ packetCounter: 0,
+ delay: 72,
+ do() {
+ if (this.packetCounter && !input.fire) {
+ this.packetCounter++;
+ if (this.packetCounter > 36) { // 36 is one wave packet
+ m.fireCDcycle = m.cycle + Math.floor(this.delay * b.fireCD); // cool down
+ this.packetCounter = 0;
+ }
}
- // const wiggleMag = tech.waveHelix ? (m.crouch ? 6 + 6 * Math.sin(m.cycle * 0.1) : 13 + 13 * Math.sin(m.cycle * 0.1)) : (m.crouch ? 6 : 12)
- const size = 5 * (tech.waveHelix === 1 ? 1 : 0.7)
- for (let i = 0; i < tech.waveHelix; i++) {
+ },
+ fire() {
+ const SPEED = 10
+ for (let i = 0; i < 2; i++) {
const me = bullet.length;
- bullet[me] = Bodies.polygon(m.pos.x + 25 * Math.cos(dir), m.pos.y + 25 * Math.sin(dir), 7, size, {
- angle: dir,
+ bullet[me] = Bodies.polygon(m.pos.x + 25 * Math.cos(m.angle), m.pos.y + 25 * Math.sin(m.angle), 7, 3.5, {
+ angle: m.angle,
cycle: -0.5,
- endCycle: simulation.cycle + Math.floor((tech.isWaveReflect ? 600 : 120) * tech.isBulletsLastLonger),
+ endCycle: simulation.cycle + Math.floor((tech.waveReflections ? Infinity : 150) * tech.isBulletsLastLonger), // - this.packetCounter + tech.wavePacketLength, //- this.packetCounter + this.packetLength makes the entire packet go away at the same time
inertia: Infinity,
frictionAir: 0,
slow: 0,
+ amplitude: (m.crouch ? 10 : 20) * Math.sin(this.packetCounter * 0.088) * ((i % 2) ? (tech.isImaginaryWave ? 1 : -1) : 1),
minDmgSpeed: 0,
- dmg: b.dmgScale * (tech.waveHelix === 1 ? 0.6 : 0.75), //control damage also when you divide by mob.mass
- isJustReflected: false,
+ dmg: b.dmgScale * 0.5 * (tech.isImaginaryWave ? 3 : 1) * (0.75 + 0.25 * tech.wavePacketLength / 36), //control damage also when you divide by mob.mass
classType: "bullet",
collisionFilter: {
category: 0,
@@ -3642,77 +3642,103 @@ const b = {
},
beforeDmg() {},
onEnd() {},
- do() {
- if (!m.isBodiesAsleep) {
- if (tech.isWaveReflect) {
- // check if inside a mob
- q = Matter.Query.point(mob, this.position)
- for (let i = 0; i < q.length; i++) {
- let dmg = this.dmg / Math.min(10, q[i].mass)
- q[i].damage(dmg);
- q[i].foundPlayer();
- simulation.drawList.push({ //add dmg to draw queue
- x: this.position.x,
- y: this.position.y,
- radius: Math.log(2 * dmg + 1.1) * 40,
- color: 'rgba(0,0,0,0.4)',
- time: simulation.drawTime
- });
- }
- Matter.Body.setPosition(this, Vector.add(this.position, player.velocity)) //bullets move with player
- const sub = Vector.sub(this.position, m.pos)
- const range = 558 //93 * x
- if (Vector.magnitude(sub) > range) {
- // Matter.Body.setPosition(this, Vector.sub(this.position, Vector.mult(Vector.normalise(sub), 2 * range))) //teleport to opposite side
- Matter.Body.setVelocity(this, Vector.mult(this.velocity, -1));
- Matter.Body.setPosition(this, Vector.add(m.pos, Vector.mult(Vector.normalise(sub), range))) //reflect
- }
- } else {
- let slowCheck = 1
- if (Matter.Query.point(map, this.position).length) { //check if inside map
- slowCheck = tech.waveSpeedMap
- } else { //check if inside a body
- let q = Matter.Query.point(body, this.position)
- if (q.length) {
- slowCheck = tech.waveSpeedBody
- Matter.Body.setPosition(this, Vector.add(this.position, q[0].velocity)) //move with the medium
- } else { // check if inside a mob
- q = Matter.Query.point(mob, this.position)
- for (let i = 0; i < q.length; i++) {
- slowCheck = 0.3;
- Matter.Body.setPosition(this, Vector.add(this.position, q[i].velocity)) //move with the medium
- let dmg = this.dmg / Math.min(10, q[i].mass)
- q[i].damage(dmg);
- q[i].foundPlayer();
- simulation.drawList.push({ //add dmg to draw queue
- x: this.position.x,
- y: this.position.y,
- radius: Math.log(2 * dmg + 1.1) * 40,
- color: 'rgba(0,0,0,0.4)',
- time: simulation.drawTime
- });
- }
- }
- }
- if (slowCheck !== this.slow) { //toggle velocity based on inside and outside status change
- this.slow = slowCheck
- Matter.Body.setVelocity(this, Vector.mult(Vector.normalise(this.velocity), SPEED * slowCheck));
- }
+ do() {},
+ query() {
+ let slowCheck = 1
+ if (Matter.Query.point(map, this.position).length) { //check if inside map
+ slowCheck = waveSpeedMap
+ } else { //check if inside a body
+ let q = Matter.Query.point(body, this.position)
+ if (q.length) {
+ slowCheck = waveSpeedBody
+ Matter.Body.setPosition(this, Vector.add(this.position, q[0].velocity)) //move with the medium
}
- this.cycle++
- //6 * Math.cos(this.cycle * 0.1) +
- // Math.cos(simulation.cycle * 0.09) *
- const wiggle = Vector.mult(transverse, wiggleMag * Math.cos(this.cycle * 0.35) * ((i % 2) ? -1 : 1))
- Matter.Body.setPosition(this, Vector.add(this.position, wiggle))
+ // else { // check if inside a mob
+ // q = Matter.Query.point(mob, this.position)
+ // for (let i = 0; i < q.length; i++) {
+ // slowCheck = 0.3;
+ // Matter.Body.setPosition(this, Vector.add(this.position, q[i].velocity)) //move with the medium
+ // let dmg = this.dmg / Math.min(10, q[i].mass)
+ // q[i].damage(dmg);
+ // q[i].foundPlayer();
+ // simulation.drawList.push({ //add dmg to draw queue
+ // x: this.position.x,
+ // y: this.position.y,
+ // radius: Math.log(2 * dmg + 1.1) * 40,
+ // color: 'rgba(0,0,0,0.4)',
+ // time: simulation.drawTime
+ // });
+ // }
+ // }
}
+ if (slowCheck !== this.slow) { //toggle velocity based on inside and outside status change
+ this.slow = slowCheck
+ Matter.Body.setVelocity(this, Vector.mult(Vector.normalise(this.velocity), SPEED * slowCheck));
+ }
+ q = Matter.Query.point(mob, this.position) // check if inside a mob
+ for (let i = 0; i < q.length; i++) {
+ let dmg = this.dmg / Math.min(10, q[i].mass)
+ q[i].damage(dmg);
+ q[i].foundPlayer();
+
+ //this draw circle had to be remove to reduce lag
+ // simulation.drawList.push({ //add dmg to draw queue
+ // x: this.position.x,
+ // y: this.position.y,
+ // radius: Math.log(2 * dmg + 1.1) * 40,
+ // color: 'rgba(0,0,0,0.4)',
+ // time: simulation.drawTime
+ // });
+ }
+ },
+ wiggle() {
+ this.cycle++
+ const where = Vector.mult(transverse, this.amplitude * Math.cos(this.cycle * 0.35))
+ Matter.Body.setPosition(this, Vector.add(this.position, where))
}
});
+
+ let waveSpeedMap = 0.1
+ let waveSpeedBody = 0.25
+ if (tech.isPhaseVelocity) {
+ waveSpeedMap = 3
+ waveSpeedBody = 1.9
+ }
+ if (tech.waveReflections) {
+ const range = 120
+ bullet[me].reflectCycle = range
+ bullet[me].do = function() {
+ if (!m.isBodiesAsleep) {
+ this.query()
+ if (this.cycle > this.reflectCycle) {
+ this.reflectCycle += range
+ Matter.Body.setVelocity(this, Vector.mult(this.velocity, -1));
+ if (this.reflectCycle > range * (1 + tech.waveReflections)) this.endCycle = 0;
+ }
+ this.wiggle()
+ }
+ }
+ } else {
+ bullet[me].do = function() {
+ if (!m.isBodiesAsleep) {
+ this.query()
+ this.wiggle();
+ }
+ }
+ }
World.add(engine.world, bullet[me]); //add bullet to world
Matter.Body.setVelocity(bullet[me], {
- x: SPEED * Math.cos(dir),
- y: SPEED * Math.sin(dir)
+ x: SPEED * Math.cos(m.angle),
+ y: SPEED * Math.sin(m.angle)
});
const transverse = Vector.normalise(Vector.perp(bullet[me].velocity))
+ // const transverse = Vector.normalise(player.velocity)
+ }
+ //fire some of bullets then delay for a while
+ this.packetCounter++
+ if (this.packetCounter > tech.wavePacketLength) {
+ m.fireCDcycle = m.cycle + Math.floor(this.delay * b.fireCD); // cool down
+ this.packetCounter = 0;
}
}
}, {
diff --git a/js/level.js b/js/level.js
index 08b6bec..572b86d 100644
--- a/js/level.js
+++ b/js/level.js
@@ -20,10 +20,10 @@ const level = {
// b.giveGuns("laser")
// tech.isExplodeRadio = true
// for (let i = 0; i < 9; i++) tech.giveTech("auto-loading heuristics")
- // tech.giveTech("pulse")
- // tech.giveTech("ice crystal nucleation")
- // tech.giveTech("needle gun")
- // tech.giveTech("cardinality")
+ // for (let i = 0; i < 2; i++) tech.giveTech("bound state")
+ // for (let i = 0; i < 9; i++) tech.giveTech("jabbering")
+ // tech.giveTech("phase velocity")
+ // tech.giveTech("imaginary number")
// tech.giveTech("Bayesian statistics")
// tech.isExplodeRadio = true;
@@ -1116,10 +1116,10 @@ const level = {
// spawn.shooterBoss(1900, -500)
// spawn.launcherBoss(1200, -500)
// spawn.laserTargetingBoss(1600, -400)
- // spawn.striker(1600, -500)
+ spawn.striker(1600, -500)
// spawn.laserTargetingBoss(1700, -120)
// spawn.bomberBoss(1400, -500)
- spawn.ghoster(1800, -120)
+ // spawn.ghoster(1800, -120)
// spawn.streamBoss(1600, -500)
// spawn.orbitalBoss(1600, -500)
// spawn.cellBossCulture(1600, -500)
@@ -4619,9 +4619,9 @@ const level = {
crossfire() {
//*1.5
//Level Setup
- const slimePitOne = level.hazard(0, 850, 3800, 120, 25);
- const slimePitTwo = level.hazard(4600, 430, 2000, 120, 35);
- const slimePitThree = level.hazard(6500, 200, 1000, 170, 50);
+ const slimePitOne = level.hazard(0, 850, 3800, 120);
+ const slimePitTwo = level.hazard(4600, 430, 2000, 120);
+ const slimePitThree = level.hazard(6500, 200, 1000, 170);
level.custom = () => {
slimePitOne.query();
@@ -4701,27 +4701,27 @@ const level = {
//Mob Spawning
spawn.randomMob(200, 400, 0.7);
- spawn.randomMob(1200, 400, 0.7);
+ // spawn.randomMob(1200, 400, 0.7);
spawn.randomMob(2000, 400, 0.7);
- spawn.randomMob(3000, 400, 0.7);
+ // spawn.randomMob(3000, 400, 0.7);
spawn.randomMob(5000, 0, 0.7);
spawn.randomMob(5600, 0, 0.7);
spawn.randomMob(6200, -200, 0.7);
- spawn.randomMob(6600, -200, 0.7);
+ // spawn.randomMob(6600, -200, 0.7);
spawn.randomMob(7200, -800, 0.7);
spawn.randomSmallMob(800, 400, 0.9);
spawn.randomSmallMob(1800, 400, 0.9);
- spawn.randomSmallMob(2600, 400, 0.9);
+ // spawn.randomSmallMob(2600, 400, 0.9);
spawn.randomSmallMob(5200, 0, 0.9);
- spawn.randomSmallMob(5400, 0, 0.9);
+ // spawn.randomSmallMob(5400, 0, 0.9);
spawn.randomSmallMob(6400, -200, 0.9);
spawn.randomGroup(3800, 400, 0.5);
spawn.randomGroup(4200, 400, 0.5);
- spawn.randomGroup(4400, 200, 0.5);
+ // spawn.randomGroup(4400, 200, 0.5);
spawn.randomGroup(7000, -800, 0.5);
- spawn.randomGroup(7700, 300, 0.5);
+ // spawn.randomGroup(7700, 300, 0.5);
spawn.randomGroup(9800, 300, 0.5);
- spawn.randomGroup(7700, -1100, 0.5);
+ // spawn.randomGroup(7700, -1100, 0.5);
spawn.randomGroup(9800, -1100, 0.5);
if (simulation.difficulty > 10) {
@@ -4732,21 +4732,19 @@ const level = {
}
//Boss Spawning
- spawn.pulsarBoss(-400, -200);
- if (simulation.difficulty > 25) {
- spawn.pulsarBoss(3600, -400);
+ if (simulation.difficulty > 20) {
+ spawn.pulsarBoss(-400, -200);
if (simulation.difficulty > 40) {
- spawn.pulsarBoss(4200, 1000);
- if (simulation.difficulty > 65) {
- spawn.pulsarBoss(5800, -1200);
- spawn.pulsarBoss(-400, -200);
- if (simulation.difficulty > 85) {
- spawn.pulsarBoss(3600, -400);
- spawn.pulsarBoss(4200, 1000);
- if (simulation.difficulty > 115) {
- spawn.pulsarBoss(5800, -1200);
+ spawn.pulsarBoss(3600, -400);
+ if (simulation.difficulty > 60) {
+ spawn.pulsarBoss(4200, 1000);
+ if (simulation.difficulty > 80) {
+ spawn.pulsarBoss(5800, -1200);
+ if (simulation.difficulty > 100) {
spawn.pulsarBoss(-400, -200);
- spawn.pulsarBoss(3600, -400);
+ if (simulation.difficulty > 120) {
+ spawn.pulsarBoss(3600, -400);
+ }
}
}
}
@@ -4756,10 +4754,11 @@ const level = {
//Powerup Spawning
powerUps.spawnStartingPowerUps(4000, 400);
powerUps.spawnStartingPowerUps(4400, 400);
- powerUps.chooseRandomPowerUp(4000, 400);
- powerUps.chooseRandomPowerUp(4000, 400);
- powerUps.chooseRandomPowerUp(4400, 400);
- powerUps.chooseRandomPowerUp(4400, 400);
+ powerUps.chooseRandomPowerUp(4002, 400);
+ powerUps.chooseRandomPowerUp(4004, 400);
+ powerUps.chooseRandomPowerUp(4006, 400);
+ powerUps.chooseRandomPowerUp(4407, 400);
+ powerUps.chooseRandomPowerUp(4409, 400);
powerUps.addRerollToLevel(); //needs to run after mobs are spawned
//Block Spawning
diff --git a/js/simulation.js b/js/simulation.js
index 5a1fd84..52e8dbd 100644
--- a/js/simulation.js
+++ b/js/simulation.js
@@ -1010,7 +1010,7 @@ const simulation = {
ctx.beginPath();
for (let i = 0, len = cons.length; i < len; ++i) {
ctx.moveTo(cons[i].pointA.x, cons[i].pointA.y);
- ctx.lineTo(cons[i].bodyB.position.x, cons[i].bodyB.position.y);
+ // ctx.lineTo(cons[i].bodyB.position.x, cons[i].bodyB.position.y);
ctx.lineTo(cons[i].bodyB.position.x + cons[i].pointB.x, cons[i].bodyB.position.y + cons[i].pointB.y);
}
for (let i = 0, len = consBB.length; i < len; ++i) {
diff --git a/js/tech.js b/js/tech.js
index 9866c0d..97d7940 100644
--- a/js/tech.js
+++ b/js/tech.js
@@ -3613,10 +3613,10 @@
}
},
{
- name: "wave packet",
- description: "wave beam emits two oscillating particles
decrease wave damage by 20%",
+ name: "jabbering",
+ description: "wave beam generates another packet
wave damage is increased by 25%",
isGunTech: true,
- maxCount: 1,
+ maxCount: 9,
count: 0,
frequency: 2,
allowed() {
@@ -3624,10 +3624,10 @@
},
requires: "wave beam",
effect() {
- tech.waveHelix = 2
+ tech.wavePacketLength += 36 //if you change this to not be 36 update /36 in wave .dmg
},
remove() {
- tech.waveHelix = 1
+ tech.wavePacketLength = 36
}
},
{
@@ -3638,39 +3638,56 @@
count: 0,
frequency: 2,
allowed() {
- return tech.haveGunCheck("wave beam") && !tech.isWaveReflect
+ return tech.haveGunCheck("wave beam")
},
requires: "wave beam",
effect() {
- tech.waveSpeedMap = 3 //needs to be 3 to stop bound state require check
- tech.waveSpeedBody = 1.9
+ tech.isPhaseVelocity = true;
},
remove() {
- tech.waveSpeedMap = 0.08
- tech.waveSpeedBody = 0.25
+ tech.isPhaseVelocity = false;
+
}
},
{
name: "bound state",
- description: "wave beam bullets last 5x longer
bullets are bound to a region around player",
+ description: "instead of dissipating normally
wave beam bullets reflect backwards 2 times",
isGunTech: true,
- maxCount: 1,
+ maxCount: 9,
count: 0,
frequency: 2,
allowed() {
- return tech.haveGunCheck("wave beam") && tech.waveSpeedMap !== 3
+ return tech.haveGunCheck("wave beam")
},
requires: "wave beam",
effect() {
- tech.isWaveReflect = true
+ tech.waveReflections += 2
},
remove() {
- tech.isWaveReflect = false
+ tech.waveReflections = 0
+ }
+ },
+ {
+ name: "imaginary number",
+ description: "the wave beam is limited to a single strand
damage is increased by 300%",
+ isGunTech: true,
+ maxCount: 9,
+ count: 0,
+ frequency: 2,
+ allowed() {
+ return tech.haveGunCheck("wave beam")
+ },
+ requires: "wave beam",
+ effect() {
+ tech.isImaginaryWave = true
+ },
+ remove() {
+ tech.isImaginaryWave = false
}
},
{
name: "cruise missile",
- description: "missiles travel 50% slower,
but have a 50% larger explosive payload",
+ description: "missiles travel 63% slower,
but have a 50% larger explosive payload",
isGunTech: true,
maxCount: 1,
count: 0,
@@ -6330,8 +6347,6 @@
isEnergyLoss: null,
isDeathAvoid: null,
isDeathAvoidedThisLevel: null,
- waveSpeedMap: null,
- waveSpeedBody: null,
isSporeField: null,
isMissileField: null,
isIceField: null,
@@ -6350,7 +6365,6 @@
isEnergyDamage: null,
botSpawner: null,
isBotSpawnerReset: null,
- waveHelix: null,
isSporeFollow: null,
isNailRadiation: null,
isEnergyHealth: null,
@@ -6506,5 +6520,8 @@
isDroneRespawn: null,
deathSpawns: null,
isMobBlockFling: null,
- blockingIce: null
+ blockingIce: null,
+ isPhaseVelocity: null,
+ wavePacketLength: null,
+ isImaginaryWave: null
}
\ No newline at end of file
diff --git a/todo.txt b/todo.txt
index 5752c55..8c959db 100644
--- a/todo.txt
+++ b/todo.txt
@@ -1,10 +1,23 @@
******************************************************** NEXT PATCH ********************************************************
-some bot related tech is no longer nonRefundable
-nonRefundable tech is now hidden in experiment mode
+community level crossfire has been nerfed a bit
+
+**wave beam rework**
+
+removed tech: wave packet (this is now the default mode of wave beam)
+tech: imaginary number - 50% more damage, but the wave is a single strand
+
+tech: bound state - wave bullets reflect backwards 2 times
+ now stacks 9 times and works with phase velocity
+
+tech: jabbering - wave beam fires another packet if you hold fire
+ also increases wave damage by 25%
+
******************************************************** BUGS ********************************************************
+wave beam shouldn't hit level.boost
+
increase the width on the grid by a few pixels so that very small screens or people with odd fonts don't goto a new line
you have to press z once to get copy to work for simulation.enableConstructMode() sometimes
@@ -35,9 +48,28 @@ is there a way to check if the player is stuck inside the map or block
******************************************************** TODO ********************************************************
-avoid taking collision damage by teleporting to a random power up
- removes the power up
- what if you get stuck?
+tech: picking up heal power ups when at full health does harm equal to the heal values
+ benefit on pick up:
+ get ammo
+ get 1% duplication
+ get 1% damage permanent
+
+nail-gun, or ....
+ 1s after being fired your bullets turn:
+ towards the nearest mob
+ in your mouse direction
+ back towards the player
+ current location or location when fired?
+ explode when turning back
+
+Tech: "Quantum Tunneling" Foam travels through blocks and walls 50% faster.
+
+wave beam needs another tech
+ bullets slowly get bigger?
+ also increase collision detection range
+ reduce ammo, increase damage
+ longitudinal vibration, increase damage
+
make a tech that improves all charge guns
for: pulse, foam, rail gun
@@ -51,6 +83,7 @@ apply the new gun.do functions to other guns
rail gun
crouching missile?
works similar to foam
+ performance issues?
tech plasma field - plasma field becomes an aoe damage field with the same radius
@@ -334,6 +367,7 @@ possible names for tech
Gödel's incompleteness
dynamical systems
quantum zeno effect (perturbation of a system prevents some systems from evolving because it scrambles coherence) (apply to lasers, fields)
+ counterfactual - something false
plot script: