diff --git a/.DS_Store b/.DS_Store
index 32b9bd6..30e8239 100644
Binary files a/.DS_Store and b/.DS_Store differ
diff --git a/js/bullet.js b/js/bullet.js
index ae94732..1ad5f6e 100644
--- a/js/bullet.js
+++ b/js/bullet.js
@@ -1964,7 +1964,6 @@ const b = {
mob[i].alive && !mob[i].isBadTarget &&
Matter.Query.ray(map, this.position, mob[i].position).length === 0 &&
!mob[i].isInvulnerable
- // && Matter.Query.ray(body, this.position, mob[i].position).length === 0
) {
const futureDist = Vector.magnitude(Vector.sub(futurePos, mob[i].position));
if (futureDist < closeDist) {
@@ -2327,7 +2326,7 @@ const b = {
if (best.who.damageReduction) {
if ( //iridescence
tech.laserCrit && !best.who.shield &&
- Vector.dot(Vector.normalise(Vector.sub(best.who.position, path[path.length - 1])), Vector.normalise(Vector.sub(path[path.length - 1], path[path.length - 2]))) > 0.995 - 0.6 / best.who.radius
+ Vector.dot(Vector.normalise(Vector.sub(best.who.position, path[path.length - 1])), Vector.normalise(Vector.sub(path[path.length - 1], path[path.length - 2]))) > 0.997 - 0.6 / best.who.radius
) {
damage *= 1 + tech.laserCrit
simulation.drawList.push({ //add dmg to draw queue
@@ -2449,7 +2448,7 @@ const b = {
dmg: 0, // 0.14 //damage done in addition to the damage from momentum
minDmgSpeed: 2,
lookFrequency: 67 + Math.floor(7 * Math.random()),
- drain: 0.7 * tech.isLaserDiode * tech.laserFieldDrain,
+ drain: 0.7 * tech.laserDrain,
isDetonated: false,
torqueMagnitude: 0.000003 * (Math.round(Math.random()) ? 1 : -1),
range: 1500,
@@ -3958,7 +3957,33 @@ const b = {
b.explosion(this.position, 150 + 30 * Math.random()); //makes bullet do explosive damage at end
}
}
+ this.ricochet(who)
};
+ bullet[me].ricochet = function(who) { //use for normal nails, and ice crystal nails
+ if (tech.isRicochet) {
+ const targets = [] //target nearby mobs
+ for (let i = 0, len = mob.length; i < len; i++) {
+ const dist = Vector.magnitude(Vector.sub(this.position, mob[i].position));
+ if (
+ mob[i] !== who &&
+ dist < 2500 + mob[i].radius &&
+ !mob[i].isBadTarget && //|| mob[i].isMobBullet
+ !mob[i].isInvulnerable &&
+ Matter.Query.ray(body, this.position, mob[i].position).length === 0 &&
+ Matter.Query.ray(map, this.position, mob[i].position).length === 0
+ ) {
+ targets.push(Vector.add(mob[i].position, Vector.mult(mob[i].velocity, dist / 60))) //predict where the mob will be in a few cycles
+ }
+ }
+ if (targets.length > 0) { // aim near a random target in array
+ const index = Math.floor(Math.random() * targets.length)
+ Matter.Body.setVelocity(this, Vector.mult(Vector.normalise(Vector.sub(targets[index], this.position)), 45));
+ Matter.Body.setAngle(this, Math.atan2(this.velocity.y, this.velocity.x))
+ Matter.Body.setAngularVelocity(this, 0);
+ }
+ this.dmg += 2
+ }
+ }
bullet[me].do = function() {};
},
needle(angle = m.angle) {
@@ -4590,10 +4615,10 @@ const b = {
offPlayer: { x: 0, y: 0, },
dmg: 0, //damage done in addition to the damage from momentum
minDmgSpeed: 2,
- lookFrequency: 40 + Math.floor(7 * Math.random()) - 13 * tech.isLaserBotUpgrade,
+ lookFrequency: 20 + Math.floor(7 * Math.random()) - 13 * tech.isLaserBotUpgrade,
range: (700 + 500 * tech.isLaserBotUpgrade) * (1 + 0.1 * Math.random()),
drainThreshold: tech.isEnergyHealth ? 0.6 : 0.4,
- drain: (0.5 - 0.44 * tech.isLaserBotUpgrade) * tech.laserFieldDrain * tech.isLaserDiode,
+ drain: (0.5 - 0.44 * tech.isLaserBotUpgrade) * tech.laserDrain,
laserDamage: 0.85 + 0.8 * tech.isLaserBotUpgrade,
endCycle: Infinity,
classType: "bullet",
@@ -5375,6 +5400,7 @@ const b = {
b.explosion(this.position, 150 + 30 * Math.random()); //makes bullet do explosive damage at end
}
}
+ this.ricochet(who)
};
if (m.energy < 0.01) {
m.fireCDcycle = m.cycle + 60; // cool down
@@ -6950,7 +6976,7 @@ const b = {
}
ctx.beginPath();
ctx.arc(m.pos.x, m.pos.y, 60, this.angle - this.arcRange, this.angle + this.arcRange);
- ctx.strokeStyle = '#fff' //'rgba(255,255,255,0.9)' //'hsl(189, 100%, 95%)' //tech.laserColor
+ ctx.strokeStyle = '#fff' //'rgba(255,255,255,0.9)' //'hsl(189, 100%, 95%)'
ctx.stroke();
// const a = { x: radius * Math.cos(this.angle + this.arcRange), y: radius * Math.sin(this.angle + this.arcRange) }
// const b = Vector.add(m.pos, a)
@@ -6962,7 +6988,7 @@ const b = {
if (tech.isStuckOn) {
if (this.isStuckOn) {
if (!input.fire) this.fire();
- if (m.energy < tech.laserFieldDrain * tech.isLaserDiode) this.isStuckOn = false
+ if (m.energy < tech.laserDrain) this.isStuckOn = false
} else if (input.fire) {
this.isStuckOn = true
}
@@ -6979,7 +7005,7 @@ const b = {
}
if (tech.isPulseLaser) {
this.fire = () => {
- const drain = 0.01 * tech.isLaserDiode * (tech.isCapacitor ? 10 : 1)
+ const drain = 0.01 * (tech.isCapacitor ? 10 : 1) / b.fireCDscale
if (m.energy > drain) {
// m.energy -= m.fieldRegen
if (this.charge < 50 * m.maxEnergy) {
@@ -7003,7 +7029,7 @@ const b = {
ctx.moveTo(history.position.x, history.position.y - off);
ctx.ellipse(history.position.x, history.position.y - off, mag, mag * 0.65, history.angle, 0, 2 * Math.PI)
}
- ctx.fillStyle = tech.isLaserDiode === 1 ? `rgba(255,0,0,${0.09 * Math.sqrt(this.charge)})` : `rgba(0,0,255,${0.09 * Math.sqrt(this.charge)})`;
+ ctx.fillStyle = `rgba(255,0,0,${0.09 * Math.sqrt(this.charge)})`;
ctx.fill();
//fire
if (!input.fire) {
@@ -7027,7 +7053,7 @@ const b = {
ctx.beginPath();
ctx.arc(m.pos.x, m.pos.y, 4.2 * Math.sqrt(this.charge), 0, 2 * Math.PI);
// ctx.fillStyle = `rgba(255,0,0,${0.09 * Math.sqrt(this.charge)})`;
- ctx.fillStyle = tech.isLaserDiode === 1 ? `rgba(255,0,0,${0.09 * Math.sqrt(this.charge)})` : `rgba(0,0,255,${0.09 * Math.sqrt(this.charge)})`;
+ ctx.fillStyle = `rgba(255,0,0,${0.09 * Math.sqrt(this.charge)})`;
ctx.fill();
//fire
if (!input.fire) {
@@ -7063,11 +7089,12 @@ const b = {
// b.photon({ x: m.pos.x + 23 * Math.cos(m.angle), y: m.pos.y + 23 * Math.sin(m.angle) }, m.angle)
// },
fireLaser() {
- if (m.energy < tech.laserFieldDrain) {
+ const drain = m.fieldRegen + tech.laserDrain / b.fireCDscale
+ if (m.energy < drain) {
m.fireCDcycle = m.cycle + 100; // cool down if out of energy
} else {
m.fireCDcycle = m.cycle
- m.energy -= m.fieldRegen + tech.laserFieldDrain * tech.isLaserDiode / b.fireCDscale
+ m.energy -= drain
const where = {
x: m.pos.x + 20 * Math.cos(m.angle),
y: m.pos.y + 20 * Math.sin(m.angle)
@@ -7080,11 +7107,12 @@ const b = {
},
firePulse() {},
fireSplit() {
- if (m.energy < tech.laserFieldDrain) {
+ const drain = m.fieldRegen + tech.laserDrain / b.fireCDscale
+ if (m.energy < drain) {
m.fireCDcycle = m.cycle + 100; // cool down if out of energy
} else {
m.fireCDcycle = m.cycle
- m.energy -= m.fieldRegen + tech.laserFieldDrain * tech.isLaserDiode / b.fireCDscale
+ m.energy -= drain
// const divergence = input.down ? 0.15 : 0.2
// const scale = Math.pow(0.9, tech.beamSplitter)
// const pushScale = scale * scale
@@ -7104,11 +7132,12 @@ const b = {
}
},
fireWideBeam() {
- if (m.energy < tech.laserFieldDrain) {
+ const drain = m.fieldRegen + tech.laserDrain / b.fireCDscale
+ if (m.energy < drain) {
m.fireCDcycle = m.cycle + 100; // cool down if out of energy
} else {
m.fireCDcycle = m.cycle
- m.energy -= m.fieldRegen + tech.laserFieldDrain * tech.isLaserDiode / b.fireCDscale
+ m.energy -= drain
const range = {
x: 5000 * Math.cos(m.angle),
y: 5000 * Math.sin(m.angle)
@@ -7132,9 +7161,6 @@ const b = {
ctx.globalAlpha = 0.5;
ctx.beginPath();
if (Matter.Query.ray(map, eye, where).length === 0 && Matter.Query.ray(body, eye, where).length === 0) {
- // this.isInsideArc(m.angle) ? 8 : 3
-
- //where = {x: m.pos.x + 20 * Math.cos(m.angle),y: m.pos.y + 20 * Math.sin(m.angle)}, whereEnd = {x: where.x + 3000 * Math.cos(m.angle),y: where.y + 3000 * Math.sin(m.angle)}, dmg = tech.laserDamage, reflections = tech.laserReflections, isThickBeam = false, push = 1) {
b.laser(eye, {
x: eye.x + range.x,
y: eye.y + range.y
@@ -7171,13 +7197,14 @@ const b = {
}
},
fireHistory() {
- if (m.energy < tech.laserFieldDrain) {
+ drain = m.fieldRegen + tech.laserDrain / b.fireCDscale
+ if (m.energy < drain) {
m.fireCDcycle = m.cycle + 100; // cool down if out of energy
} else {
m.fireCDcycle = m.cycle
- m.energy -= m.fieldRegen + tech.laserFieldDrain * tech.isLaserDiode / b.fireCDscale
+ m.energy -= drain
const dmg = 0.4 * tech.laserDamage / b.fireCDscale * this.lensDamage // 3.5 * 0.55 = 200% more damage
- const spacing = Math.ceil(4 - 0.3 * tech.historyLaser)
+ const spacing = Math.ceil(5 - 0.4 * tech.historyLaser)
ctx.beginPath();
b.laser({
x: m.pos.x + 20 * Math.cos(m.angle),
diff --git a/js/level.js b/js/level.js
index 24611e4..868f44e 100644
--- a/js/level.js
+++ b/js/level.js
@@ -16,7 +16,7 @@ const level = {
start() {
if (level.levelsCleared === 0) { //this code only runs on the first level
// simulation.enableConstructMode() //used to build maps in testing mode
- // level.difficultyIncrease(4 * 4) //30 is near max on hard //60 is near max on why
+ // level.difficultyIncrease(6 * 4) //30 is near max on hard //60 is near max on why
// simulation.isHorizontalFlipped = true
// m.maxHealth = m.health = 100
// powerUps.research.changeRerolls(100000)
@@ -24,20 +24,21 @@ const level = {
// powerUps.research.changeRerolls(100)
// tech.tech[297].frequency = 100
// b.guns[0].ammo = 10000
- // m.setField("negative mass") //molecular assembler time dilation perfect diamagnetism metamaterial cloaking wormhole negative mass
- // b.giveGuns("nail gun") //0 nail gun 1 shotgun 2 super balls 3 matter wave 4 missiles 5 grenades 6 spores 7 drones 8 foam 9 harpoon 10 mine 11 laser
- // tech.giveTech("dynamic equilibrium")
- // tech.giveTech("quantum eraser");
- // tech.giveTech("patch");
- // tech.giveTech("polyurethane foam")
- // for (let i = 0; i < 100; ++i) tech.giveTech("nail-bot")
- // for (let i = 0; i < 1; ++i) tech.giveTech("electric generator")
- // for (let i = 0; i < 9; i++) tech.giveTech("compound lens")
+ // m.setField("molecular assembler") //molecular assembler time dilation perfect diamagnetism metamaterial cloaking wormhole negative mass
+ // b.giveGuns("laser") //0 nail gun 1 shotgun 2 super balls 3 matter wave 4 missiles 5 grenades 6 spores 7 drones 8 foam 9 harpoon 10 mine 11 laser
+ // tech.giveTech("infrared diode");
+ // tech.giveTech("active cooling");
+ // tech.giveTech("pulse")
+ // for (let i = 0; i < 1; ++i) tech.giveTech("slow light")
+ // for (let i = 0; i < 1; ++i) tech.giveTech("free-electron laser")
+ // m.damage(0.1);
+ // for (let i = 0; i < 1; i++) tech.giveTech("dynamic equilibrium")
// for (let i = 0; i < 10; i++) powerUps.directSpawn(450, -50, "tech");
// for (let i = 0; i < 10; i++) powerUps.directSpawn(450, -50, "research");
- // spawn.starter(1900, -500, 100)
- // spawn.snakeBoss(1900, -500)
- // for (let i = 0; i < 10; ++i) spawn.grower(1900, -500)
+ // spawn.starter(1900, -500, 200)
+ // spawn.starter(1900, -500, 50)
+ // spawn.revolutionBoss(1900, -500)
+ // for (let i = 0; i < 10; ++i) spawn.starter(1900 + 300 * Math.random(), -500 + 300 * Math.random())
// level.testing(); //not in rotation, used for testing
// for (let i = 0; i < 7; ++i) powerUps.directSpawn(m.pos.x + 50 * Math.random(), m.pos.y + 50 * Math.random(), "research");
// for (let i = 0; i < 4; ++i) powerUps.directSpawn(m.pos.x + 50 * Math.random(), m.pos.y + 50 * Math.random(), "tech");
diff --git a/js/powerup.js b/js/powerup.js
index 9ed1b0f..8bf17d4 100644
--- a/js/powerup.js
+++ b/js/powerup.js
@@ -284,7 +284,7 @@ const powerUps = {
// }
// requestAnimationFrame(cycle);
- document.getElementById("choose-grid").style.opacity = "0.8"
+ document.getElementById("choose-grid").style.opacity = "0.9"
} else {
simulation.paused = true;
document.getElementById("choose-grid").style.opacity = "1"
diff --git a/js/spawn.js b/js/spawn.js
index 6c63036..10420fb 100644
--- a/js/spawn.js
+++ b/js/spawn.js
@@ -3621,11 +3621,11 @@ const spawn = {
mobs.spawn(x, y, sides, radius, "rgb(201,202,225)");
let me = mob[mob.length - 1];
Matter.Body.rotate(me, 2 * Math.PI * Math.random());
- me.accelMag = 0.00038 * Math.sqrt(simulation.accelScale);
+ me.accelMag = 0.00018 + 0.00018 * Math.sqrt(simulation.accelScale);
me.frictionAir = 0.01;
- me.swordRadiusMax = 550 + 10 * simulation.difficulty;
+ me.swordRadiusMax = 400 + 10 * simulation.difficulty;
me.laserAngle = 0;
- me.swordDamage = 0.0025 * simulation.dmgScale
+ me.swordDamage = 0.025 * simulation.dmgScale //0.033 * simulation.dmgScale; previous //0.14 * simulation.dmgScale;laserBoss
// spawn.shield(me, x, y, 1);
Matter.Body.setDensity(me, 0.005); //extra dense //normal is 0.001 //makes effective life much larger
@@ -3652,7 +3652,7 @@ const spawn = {
if (this.isInvulnerable) {
if (this.invulnerabilityCountDown > 0) {
this.invulnerabilityCountDown--
- //graphics //draw a super shield?
+ //draw invulnerability
ctx.beginPath();
let vertices = this.vertices;
ctx.moveTo(vertices[0].x, vertices[0].y);
@@ -3673,7 +3673,7 @@ const spawn = {
this.seePlayerByHistory(60);
this.attraction();
//traveling laser
- this.laserAngle += this.isInvulnerable ? 0.06 : 0.015
+ this.laserAngle += this.isInvulnerable ? 0.025 : 0.006
for (let i = 0, len = this.vertices.length; i < len; i++) {
// this.laserSword(this.vertices[1], this.angle + laserAngle);
const bend = bendFactor * Math.cos(this.laserAngle + 2 * Math.PI * i / len)
@@ -3710,15 +3710,15 @@ const spawn = {
vertexCollision(where, look, map);
if (!m.isCloak) vertexCollision(where, look, [playerBody, playerHead]);
if (best.who && (best.who === playerBody || best.who === playerHead) && m.immuneCycle < m.cycle) {
- // m.immuneCycle = m.cycle + tech.collisionImmuneCycles + 60; //player is immune to damage for an extra second
+ m.immuneCycle = m.cycle + tech.collisionImmuneCycles; //player is immune to damage for an extra second
m.damage(this.swordDamage);
- // simulation.drawList.push({ //add dmg to draw queue
- // x: best.x,
- // y: best.y,
- // radius: this.swordDamage * 1500,
- // color: "rgba(80,0,255,0.5)",
- // time: 20
- // });
+ simulation.drawList.push({ //add dmg to draw queue
+ x: best.x,
+ y: best.y,
+ radius: this.swordDamage * 1500,
+ color: "rgba(80,0,255,0.5)",
+ time: 20
+ });
}
if (best.dist2 === Infinity) best = look;
ctx.beginPath(); //draw beam
diff --git a/js/tech.js b/js/tech.js
index 81a0312..f84c784 100644
--- a/js/tech.js
+++ b/js/tech.js
@@ -253,7 +253,7 @@ const tech = {
if (m.isSneakAttack && m.sneakAttackCycle + Math.min(120, 0.5 * (m.cycle - m.enterCloakCycle)) > m.cycle) dmg *= tech.sneakAttackDmg
if (tech.isAxion && tech.isHarmMACHO) dmg *= 2 - m.harmReduction()
if (tech.isHarmDamage && m.lastHarmCycle + 600 > m.cycle) dmg *= 3;
- if (tech.isLastHitDamage && m.lastHit) dmg *= 1 + 10 * m.lastHit // if (!simulation.paused) m.lastHit = 0
+ if (tech.lastHitDamage && m.lastHit) dmg *= 1 + tech.lastHitDamage * m.lastHit * (2 - m.harmReduction()) // if (!simulation.paused) m.lastHit = 0
return dmg * tech.slowFire * tech.aimDamage
},
duplicationChance() {
@@ -397,9 +397,6 @@ const tech = {
},
{
name: "arsenal",
- // descriptionFunction() {
- // return `increase damage by ${14 * b.inventory.length}%
14% for each gun in your inventory`
- // },
description: "for each gun in your inventory
+13% damage",
maxCount: 1,
count: 0,
@@ -439,7 +436,7 @@ const tech = {
{
name: "integrated armament",
link: `integrated armament`,
- description: `increase damage by 25%, but new guns
replace your current gun and convert guntech`,
+ description: `+25% damage, but new guns
replace your current gun and convert guntech`,
maxCount: 1,
count: 0,
frequency: 1,
@@ -780,7 +777,6 @@ const tech = {
{
name: "kinetic bombardment",
description: "damage is proportional to mob distance
up to +33% damage at 3000 displacement",
- // description: "increase damage by up to 33% at a distance
of up to 50 player widths from the target",
maxCount: 1,
count: 0,
frequency: 1,
@@ -1022,7 +1018,7 @@ const tech = {
},
{
name: "anticorrelation",
- description: "increase damage by 100%
after not using your gun or field for 2 seconds",
+ description: "+100% damage
after not using your gun or field for 2 seconds",
maxCount: 1,
count: 0,
frequency: 1,
@@ -1161,7 +1157,7 @@ const tech = {
{
name: "foam-bot upgrade",
link: `foam-bot upgrade`,
- description: "convert your bots to foam-bots
300% increased foam size and fire rate",
+ description: "convert your bots to foam-bots
+300% foam size and fire rate",
maxCount: 1,
count: 0,
frequency: 3,
@@ -1217,7 +1213,7 @@ const tech = {
{
name: "boom-bot upgrade",
link: `boom-bot upgrade`,
- description: "convert your bots to boom-bots
300% increased explosion damage and size",
+ description: "convert your bots to boom-bots
+300% explosion damage and size",
maxCount: 1,
count: 0,
frequency: 3,
@@ -1275,7 +1271,7 @@ const tech = {
{
name: "laser-bot upgrade",
link: `laser-bot upgrade`,
- description: "convert your bots to laser-bots
100% improved damage, efficiency, and range", // 400% increased laser-bot laser damage",
+ description: "convert your bots to laser-bots
+100% damage, efficiency, and range",
maxCount: 1,
count: 0,
frequency: 3,
@@ -1331,7 +1327,7 @@ const tech = {
{
name: "orbital-bot upgrade",
link: `orbital-bot upgrade`,
- description: "convert your bots to orbital-bots
increase damage by 300% and radius by 50%",
+ description: "convert your bots to orbital-bots
+300% orbital damage and +50% radius",
maxCount: 1,
count: 0,
frequency: 3,
@@ -2229,6 +2225,7 @@ const tech = {
name: "1st ionization energy",
link: `1st ionization energy`,
description: `after you collect ${powerUps.orb.heal()}
+10 maximum energy`,
+ description: `convert ${powerUps.orb.heal()} into