diff --git a/.DS_Store b/.DS_Store
index 8bcfebd..c1b9aab 100644
Binary files a/.DS_Store and b/.DS_Store differ
diff --git a/js/bullet.js b/js/bullet.js
index f9e4253..1d9fd80 100644
--- a/js/bullet.js
+++ b/js/bullet.js
@@ -1094,7 +1094,7 @@ const b = {
if (mob[i].shield) dmg *= 3 //to make up for the /5 that shields normally take
mob[i].damage(dmg);
mob[i].locatePlayer();
- if (tech.isNeutronSlow) {
+ if (tech.isNeutronSlow && mob[i].speed > 4) {
Matter.Body.setVelocity(mob[i], {
x: mob[i].velocity.x * 0.97,
y: mob[i].velocity.y * 0.97
@@ -1746,8 +1746,14 @@ const b = {
const dist = Vector.magnitudeSquared(Vector.sub(this.position, mob[i].position))
const radius = mob[i].radius + tech.extruderRange / 2
if (dist < radius * radius) {
- Matter.Body.setVelocity(mob[i], { x: mob[i].velocity.x * 0.25, y: mob[i].velocity.y * 0.25 });
- Matter.Body.setPosition(this, Vector.add(this.position, mob[i].velocity)) //move with the medium
+ if (mob[i].speed > 2) {
+ if (mob[i].isBoss || mob[i].isShielded) {
+ Matter.Body.setVelocity(mob[i], { x: mob[i].velocity.x * 0.95, y: mob[i].velocity.y * 0.95 });
+ } else {
+ Matter.Body.setVelocity(mob[i], { x: mob[i].velocity.x * 0.25, y: mob[i].velocity.y * 0.25 });
+ }
+ }
+ // Matter.Body.setPosition(this, Vector.add(this.position, mob[i].velocity)) //move with the medium
let dmg = this.dmg / Math.min(10, mob[i].mass)
mob[i].damage(dmg);
if (mob[i].alive) mob[i].foundPlayer();
@@ -1864,10 +1870,12 @@ const b = {
//push mobs away
const force = Vector.mult(Vector.normalise(Vector.sub(m.pos, path[1])), -0.01 * Math.min(5, best.who.mass))
Matter.Body.applyForce(best.who, path[1], force)
- Matter.Body.setVelocity(best.who, { //friction
- x: best.who.velocity.x * 0.7,
- y: best.who.velocity.y * 0.7
- });
+ if (best.who.speed > 4) {
+ Matter.Body.setVelocity(best.who, { //friction
+ x: best.who.velocity.x * 0.9,
+ y: best.who.velocity.y * 0.9
+ });
+ }
//draw mob damage circle
simulation.drawList.push({
x: path[1].x,
@@ -3097,7 +3105,12 @@ const b = {
} else {
Matter.Body.setPosition(this, Vector.add(Vector.add(rotate, this.target.velocity), this.target.position))
}
- Matter.Body.setVelocity(this.target, Vector.mult(this.target.velocity, 0.9))
+ if (this.target.isBoss) {
+ if (this.target.speed > 8) Matter.Body.setVelocity(this.target, Vector.mult(this.target.velocity, 0.98))
+ } else {
+ if (this.target.speed > 4) Matter.Body.setVelocity(this.target, Vector.mult(this.target.velocity, 0.95))
+ }
+
Matter.Body.setAngularVelocity(this.target, this.target.angularVelocity * 0.9);
// Matter.Body.setAngularVelocity(this.target, this.target.angularVelocity * 0.9)
if (this.target.isShielded) {
@@ -4163,10 +4176,12 @@ const b = {
//push mobs away
const force = Vector.mult(Vector.normalise(Vector.sub(m.pos, path[1])), -0.01 * Math.min(5, best.who.mass))
Matter.Body.applyForce(best.who, path[1], force)
- Matter.Body.setVelocity(best.who, { //friction
- x: best.who.velocity.x * 0.7,
- y: best.who.velocity.y * 0.7
- });
+ if (best.who.speed > 3) {
+ Matter.Body.setVelocity(best.who, { //friction
+ x: best.who.velocity.x * 0.7,
+ y: best.who.velocity.y * 0.7
+ });
+ }
//draw mob damage circle
if (best.who.damageReduction) {
simulation.drawList.push({
diff --git a/js/level.js b/js/level.js
index e39f970..8de80bf 100644
--- a/js/level.js
+++ b/js/level.js
@@ -128,29 +128,29 @@ const level = {
b.dmgScale = 1; //damage done by player decreases each level
simulation.accelScale = 1 //mob acceleration increases each level
simulation.CDScale = 1 //mob CD time decreases each level
- simulation.dmgScale = 0.38 * simulation.difficulty //damage done by mobs increases each level
+ simulation.dmgScale = 0.375 * simulation.difficulty //damage done by mobs increases each level
simulation.healScale = 1 / (1 + simulation.difficulty * 0.055) //a higher denominator makes for lower heals // m.health += heal * simulation.healScale;
},
difficultyIncrease(num = 1) {
for (let i = 0; i < num; i++) {
simulation.difficulty++
- b.dmgScale *= 0.917; //damage done by player decreases each level
+ b.dmgScale *= 0.92; //damage done by player decreases each level
if (simulation.accelScale < 6) simulation.accelScale *= 1.025 //mob acceleration increases each level
if (simulation.CDScale > 0.15) simulation.CDScale *= 0.965 //mob CD time decreases each level
}
- simulation.dmgScale = 0.38 * simulation.difficulty //damage done by mobs scales with total levels
+ simulation.dmgScale = 0.375 * simulation.difficulty //damage done by mobs scales with total levels
simulation.healScale = 1 / (1 + simulation.difficulty * 0.055) //a higher denominator makes for lower heals // m.health += heal * simulation.healScale;
// console.log(`CD = ${simulation.CDScale}`)
},
difficultyDecrease(num = 1) { //used in easy mode for simulation.reset()
for (let i = 0; i < num; i++) {
simulation.difficulty--
- b.dmgScale /= 0.917; //damage done by player decreases each level
+ b.dmgScale /= 0.92; //damage done by player decreases each level
if (simulation.accelScale > 1) simulation.accelScale /= 1.025 //mob acceleration increases each level
if (simulation.CDScale < 1) simulation.CDScale /= 0.965 //mob CD time decreases each level
}
if (simulation.difficulty < 1) simulation.difficulty = 0;
- simulation.dmgScale = 0.38 * simulation.difficulty //damage done by mobs scales with total levels
+ simulation.dmgScale = 0.375 * simulation.difficulty //damage done by mobs scales with total levels
if (simulation.dmgScale < 0.1) simulation.dmgScale = 0.1;
simulation.healScale = 1 / (1 + simulation.difficulty * 0.055)
},
@@ -320,8 +320,8 @@ const level = {
player.position.x > level.exit.x &&
player.position.x < level.exit.x + 100 &&
player.position.y > level.exit.y - 150 &&
- player.position.y < level.exit.y - 40 &&
- player.velocity.y < 0.1
+ player.position.y < level.exit.y - 0 &&
+ player.velocity.y < 0.15
) {
level.exitCount += input.down ? 8 : 2
} else if (level.exitCount > 0) {
diff --git a/js/mob.js b/js/mob.js
index 8f0eb74..4da23d4 100644
--- a/js/mob.js
+++ b/js/mob.js
@@ -68,12 +68,13 @@ const mobs = {
whom.isSlowed = true;
whom.status.push({
effect() {
- const speedCap = 2
- const drag = 0.95
- Matter.Body.setVelocity(whom, {
- x: Math.min(speedCap, whom.velocity.x) * drag,
- y: Math.min(speedCap, whom.velocity.y) * drag
- });
+ if (whom.speed > 2) {
+ const drag = 0.95
+ Matter.Body.setVelocity(whom, {
+ x: whom.velocity.x * drag,
+ y: whom.velocity.y * drag
+ });
+ }
Matter.Body.setAngularVelocity(whom, 0);
ctx.beginPath();
ctx.moveTo(whom.vertices[0].x, whom.vertices[0].y);
@@ -99,10 +100,12 @@ const mobs = {
},
statusStun(who, cycles = 180) {
if (!who.shield && !who.isShielded) {
- Matter.Body.setVelocity(who, {
- x: who.velocity.x * 0.8,
- y: who.velocity.y * 0.8
- });
+ if (who.speed > 3) {
+ Matter.Body.setVelocity(who, {
+ x: who.velocity.x * 0.8,
+ y: who.velocity.y * 0.8
+ });
+ }
Matter.Body.setAngularVelocity(who, who.angularVelocity * 0.8);
//remove other "stun" effects on this mob
let i = who.status.length
diff --git a/js/player.js b/js/player.js
index ea0e21b..b88e192 100644
--- a/js/player.js
+++ b/js/player.js
@@ -1316,7 +1316,7 @@ const m = {
m.energy -= fieldBlockCost
if (m.energy < 0) m.energy = 0;
m.fieldCDcycle = m.cycle + m.fieldBlockCD;
- if (tech.blockingIce) {
+ if (tech.blockingIce && !who.isInvulnerable) {
for (let i = 0; i < fieldBlockCost * 60 * tech.blockingIce; i++) b.iceIX(3, 2 * Math.PI * Math.random(), m.pos)
}
const unit = Vector.normalise(Vector.sub(player.position, who.position))
@@ -3476,16 +3476,20 @@ const m = {
m.angle = player.angle
}
- level.playerExitCheck = () => {
- if (
- player.position.x > level.exit.x &&
- player.position.x < level.exit.x + 100 &&
- player.position.y > level.exit.y - 150 &&
- player.position.y < level.exit.y + 40
- ) {
- level.nextLevel()
- }
- }
+
+
+
+
+ // level.exit.drawAndCheck = () => { //fix this
+ // if (
+ // player.position.x > level.exit.x &&
+ // player.position.x < level.exit.x + 100 &&
+ // player.position.y > level.exit.y - 150 &&
+ // player.position.y < level.exit.y + 40
+ // ) {
+ // level.nextLevel()
+ // }
+ // }
m.move = () => {
m.pos.x = player.position.x;
m.pos.y = player.position.y;
diff --git a/js/simulation.js b/js/simulation.js
index 1b0989b..01b517f 100644
--- a/js/simulation.js
+++ b/js/simulation.js
@@ -938,7 +938,7 @@ const simulation = {
if (!(simulation.cycle % 420)) { //once every 7 seconds
if (tech.isZeno) {
- m.health *= 0.9
+ m.health *= 0.9167 //remove 1/12
m.displayHealth();
}
if (tech.cyclicImmunity && m.immuneCycle < m.cycle + tech.cyclicImmunity) m.immuneCycle = m.cycle + tech.cyclicImmunity; //player is immune to damage for 60 cycles
diff --git a/js/spawn.js b/js/spawn.js
index e17927c..908e322 100644
--- a/js/spawn.js
+++ b/js/spawn.js
@@ -397,7 +397,13 @@ const spawn = {
//damage all mobs
for (let j = 0; j < 8; j++) { //in case some mobs leave things after they die
for (let i = 0, len = mob.length; i < len; ++i) {
- if (mob[i] !== this) mob[i].damage(Infinity, true);
+ if (mob[i] !== this) {
+ if (mob[i].isInvulnerable) { //disable invulnerability
+ mob[i].isInvulnerable = false
+ mob[i].damageReduction = 1
+ }
+ mob[i].damage(Infinity, true);
+ }
}
}
@@ -2030,7 +2036,7 @@ const spawn = {
this.cons2.length = 100 + 1.5 * this.radius;
this.isInvulnerable = false
- this.invulnerabilityCountDown = 70 + Math.max(0, 70 - simulation.difficulty * 0.5)
+ this.invulnerabilityCountDown = 80 + Math.max(0, 70 - simulation.difficulty * 0.5)
this.damageReduction = this.startingDamageReduction
for (let i = 0; i < this.babyList.length; i++) {
if (this.babyList[i].alive) this.babyList[i].damageReduction = this.startingDamageReduction
@@ -2044,7 +2050,7 @@ const spawn = {
this.cons2.length = -200;
this.isInvulnerable = false
- this.invulnerabilityCountDown = 70 + Math.max(0, 70 - simulation.difficulty)
+ this.invulnerabilityCountDown = 80 + Math.max(0, 70 - simulation.difficulty)
this.damageReduction = this.startingDamageReduction
for (let i = 0; i < this.babyList.length; i++) {
if (this.babyList[i].alive) this.babyList[i].damageReduction = this.startingDamageReduction
@@ -3550,6 +3556,23 @@ const spawn = {
me.fireCount = 0
// console.log(me.mass) //100
me.do = function() {
+ me.seePlayer.recall = 1
+ //maintain speed //faster in the vertical to help avoid repeating patterns
+ if (this.speed < 0.01) {
+ const unit = Vector.sub(player.position, this.position)
+ Matter.Body.setVelocity(this, Vector.mult(Vector.normalise(unit), 0.1));
+ // this.fireCount = 10 + simulation.difficulty * 0.5
+ // this.isInvulnerable = true
+ // this.damageReduction = 0
+ } else {
+ if (Math.abs(this.velocity.y) < 15) {
+ Matter.Body.setVelocity(this, { x: this.velocity.x, y: this.velocity.y * 1.07 });
+ }
+ if (Math.abs(this.velocity.x) < 11) {
+ Matter.Body.setVelocity(this, { x: this.velocity.x * 1.07, y: this.velocity.y });
+ }
+ }
+
if (this.isInvulnerable) {
this.fireCount--
if (this.fireCount < 0) {
@@ -3584,14 +3607,6 @@ const spawn = {
// } else if (player.position.x < this.position.x - 200) {
// this.force.x -= xMag * this.mass;
// }
-
- //maintain speed //faster in the vertical to help avoid repeating patterns
- if (Math.abs(this.velocity.y) < 15) {
- Matter.Body.setVelocity(this, { x: this.velocity.x, y: this.velocity.y * 1.05 });
- }
- if (Math.abs(this.velocity.x) < 11) {
- Matter.Body.setVelocity(this, { x: this.velocity.x * 1.05, y: this.velocity.y });
- }
};
},
bounceBullet(x, y, velocity = { x: 0, y: 0 }, radius = 10, sides = 6) {
@@ -3802,7 +3817,7 @@ const spawn = {
me.swordRadiusMax = 350 + 5 * simulation.difficulty;
me.swordRadiusGrowRate = me.swordRadiusMax * (0.018 + 0.0006 * simulation.difficulty)
me.isSlashing = false;
- me.swordDamage = 0.05 * simulation.dmgScale
+ me.swordDamage = 0.04 * simulation.dmgScale
me.laserAngle = 3 * Math.PI / 5
const seeDistance2 = 200000
spawn.shield(me, x, y);
diff --git a/js/tech.js b/js/tech.js
index c96875b..825e393 100644
--- a/js/tech.js
+++ b/js/tech.js
@@ -2449,7 +2449,7 @@ const tech = {
},
{
name: "Zeno's paradox",
- description: "reduce harm by 85%, but every 5 seconds
remove 1/10 of your current health",
+ description: "reduce harm by 85%, but every 5 seconds
remove 1/12 of your current health",
// description: "every 5 seconds remove 1/10 of your health
reduce harm by 90%",
maxCount: 1,
count: 0,
diff --git a/todo.txt b/todo.txt
index 07f946e..38a3d39 100644
--- a/todo.txt
+++ b/todo.txt
@@ -1,23 +1,28 @@
******************************************************** NEXT PATCH **************************************************
-new level: reactor - midBoss fight
- it's not well balanced yet
- Let me know if there are any impossible gun combinations
+difficulty balance per level
+ mob harm done is reduced about 2%
+ player damage is increased about 2%
-for new players the training button at the start screen now cycles colors
- effect shows if you haven't cleared the first training level, and you haven't done at least a few normal runs
+slasher mobs do 20% less damage
+ this is because they killed me on my last run and I'm bitter
+mantisBoss is invincible for a less time
+Zeno's paradox removes 1/10 -> 1/12 health every 5 seconds
-standing wave expansion tech is 40% larger and gives 25% deflecting efficiency
-ammonium nitrate gives 30 -> 27% damage and range
-heuristics gives 30 -> 33% fire rate
-wormhole invariant tech drains energy much slower while time is paused
+slow, stun, plasma, foam, neutron bomb effects now only slow mobs down to a minimum speed of about 2-4
bug fixes
- null level now longer progresses level.onLevel
+ bounceBoss deals with slow effects in a less buggy way
+ final boss didn't kill invincible mobs when it dies
******************************************************** TODO ********************************************************
+tech - field power ups now give 3 field tech instead of 3 field?
+
+run more profiles of n-gon to fix performance issues
+
reactor
+ foam hits all the bullets and makes this fight easy
give map some background graphics
it's a little short
add alternate boss