gamma ray rename free-electron laser

"gamma-ray laser" renamed "free-electron laser" to make more scientific sense
  since gamma rays would go right through walls
laser diode now makes lasers blue
free-electron laser can no longer work with laser diode

pressure wave has a bit more damage
  crouch mode works different (much higher fire rate, low arc)

integrated armament gives 35% dmg (was 22%)
  but I fixed a bug where it gave an extra 33% ammo

mine gun gets 25% less ammo
all mines do 30% more damage

trying to make shotgun better at close range and worse at distance
  shotgun slug is much slower, but does 60% more damage
  nail shot has a 20% wider spread, and is 20% slower, but does 20% more damage

finalBoss has 15% less health

to balance all the buffs
  ammo power ups give 15% less ammo
  damage done by mobs now scales up a bit faster each level
  damage done by you now scales down a bit faster each level
This commit is contained in:
landgreen
2021-07-09 19:09:17 -07:00
parent cc813bc479
commit 1668972156
10 changed files with 158 additions and 115 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@@ -713,7 +713,7 @@ const b = {
bullet[me].explodeRad = 275; bullet[me].explodeRad = 275;
bullet[me].onEnd = function() { bullet[me].onEnd = function() {
b.explosion(this.position, this.explodeRad); //makes bullet do explosive damage at end b.explosion(this.position, this.explodeRad); //makes bullet do explosive damage at end
if (tech.fragments) b.targetedNail(this.position, tech.fragments * 5) if (tech.fragments) b.targetedNail(this.position, tech.fragments * 4)
} }
bullet[me].minDmgSpeed = 1; bullet[me].minDmgSpeed = 1;
bullet[me].beforeDmg = function() { bullet[me].beforeDmg = function() {
@@ -738,7 +738,7 @@ const b = {
bullet[me].explodeRad = 300; bullet[me].explodeRad = 300;
bullet[me].onEnd = function() { bullet[me].onEnd = function() {
b.explosion(this.position, this.explodeRad); //makes bullet do explosive damage at end b.explosion(this.position, this.explodeRad); //makes bullet do explosive damage at end
if (tech.fragments) b.targetedNail(this.position, tech.fragments * 5) if (tech.fragments) b.targetedNail(this.position, tech.fragments * 4)
} }
bullet[me].minDmgSpeed = 1; bullet[me].minDmgSpeed = 1;
bullet[me].beforeDmg = function() { bullet[me].beforeDmg = function() {
@@ -773,7 +773,7 @@ const b = {
bullet[me].explodeRad = 350 + Math.floor(Math.random() * 50);; bullet[me].explodeRad = 350 + Math.floor(Math.random() * 50);;
bullet[me].onEnd = function() { bullet[me].onEnd = function() {
b.explosion(this.position, this.explodeRad); //makes bullet do explosive damage at end b.explosion(this.position, this.explodeRad); //makes bullet do explosive damage at end
if (tech.fragments) b.targetedNail(this.position, tech.fragments * 5) if (tech.fragments) b.targetedNail(this.position, tech.fragments * 4)
} }
bullet[me].minDmgSpeed = 1; bullet[me].minDmgSpeed = 1;
bullet[me].beforeDmg = function() { bullet[me].beforeDmg = function() {
@@ -849,7 +849,7 @@ const b = {
bullet[me].explodeRad = 325 + Math.floor(Math.random() * 50);; bullet[me].explodeRad = 325 + Math.floor(Math.random() * 50);;
bullet[me].onEnd = function() { bullet[me].onEnd = function() {
b.explosion(this.position, this.explodeRad); //makes bullet do explosive damage at end b.explosion(this.position, this.explodeRad); //makes bullet do explosive damage at end
if (tech.fragments) b.targetedNail(this.position, tech.fragments * 7) if (tech.fragments) b.targetedNail(this.position, tech.fragments * 6)
} }
bullet[me].beforeDmg = function() {}; bullet[me].beforeDmg = function() {};
bullet[me].restitution = 0.4; bullet[me].restitution = 0.4;
@@ -1124,7 +1124,7 @@ const b = {
}, },
onEnd() { onEnd() {
b.explosion(this.position, this.explodeRad * size); //makes bullet do explosive damage at end b.explosion(this.position, this.explodeRad * size); //makes bullet do explosive damage at end
if (tech.fragments) b.targetedNail(this.position, tech.fragments * 5) if (tech.fragments) b.targetedNail(this.position, tech.fragments * 4)
}, },
lockedOn: null, lockedOn: null,
tryToLockOn() { tryToLockOn() {
@@ -1572,7 +1572,7 @@ const b = {
} else { } else {
ctx.strokeStyle = tech.laserColor; ctx.strokeStyle = tech.laserColor;
ctx.lineWidth = 2 ctx.lineWidth = 2
ctx.lineDashOffset = 300 * Math.random() ctx.lineDashOffset = 900 * Math.random()
ctx.setLineDash([50 + 120 * Math.random(), 50 * Math.random()]); ctx.setLineDash([50 + 120 * Math.random(), 50 * Math.random()]);
for (let i = 1, len = path.length; i < len; ++i) { for (let i = 1, len = path.length; i < len; ++i) {
ctx.beginPath(); ctx.beginPath();
@@ -1650,7 +1650,7 @@ const b = {
for (let i = 0; i < 3; i++) { for (let i = 0; i < 3; i++) {
const where = this.vertices[i] const where = this.vertices[i]
const endPoint = Vector.add(where, Vector.mult(Vector.normalise(Vector.sub(where, this.position)), 2500)) const endPoint = Vector.add(where, Vector.mult(Vector.normalise(Vector.sub(where, this.position)), 2500))
b.laser(where, endPoint, tech.laserDamage * 10, this.reflections, true) b.laser(where, endPoint, tech.laserDamage * 12, this.reflections, true)
} }
ctx.stroke(); ctx.stroke();
// ctx.globalAlpha = 1; // ctx.globalAlpha = 1;
@@ -1959,7 +1959,7 @@ const b = {
friction: 0, friction: 0,
frictionAir: 0.10, frictionAir: 0.10,
restitution: 0.3, restitution: 0.3,
dmg: 0.38, //damage done in addition to the damage from momentum dmg: 0.42, //damage done in addition to the damage from momentum
lookFrequency: 14 + Math.floor(8 * Math.random()), lookFrequency: 14 + Math.floor(8 * Math.random()),
endCycle: simulation.cycle + 140 * tech.isBulletsLastLonger, endCycle: simulation.cycle + 140 * tech.isBulletsLastLonger,
classType: "bullet", classType: "bullet",
@@ -2633,13 +2633,13 @@ const b = {
x: targets[index].x + SPREAD * (Math.random() - 0.5), x: targets[index].x + SPREAD * (Math.random() - 0.5),
y: targets[index].y + SPREAD * (Math.random() - 0.5) y: targets[index].y + SPREAD * (Math.random() - 0.5)
} }
b.nail(position, Vector.mult(Vector.normalise(Vector.sub(WHERE, position)), speed)) b.nail(position, Vector.mult(Vector.normalise(Vector.sub(WHERE, position)), speed), 1.4)
} else if (isRandomAim) { // aim in random direction } else if (isRandomAim) { // aim in random direction
const ANGLE = 2 * Math.PI * Math.random() const ANGLE = 2 * Math.PI * Math.random()
b.nail(position, { b.nail(position, {
x: speed * Math.cos(ANGLE), x: speed * Math.cos(ANGLE),
y: speed * Math.sin(ANGLE) y: speed * Math.sin(ANGLE)
}) }, 1.4)
} }
} }
}, },
@@ -3727,9 +3727,9 @@ const b = {
const dir = m.angle + 0.02 * (Math.random() - 0.5) const dir = m.angle + 0.02 * (Math.random() - 0.5)
bullet[me] = Bodies.rectangle(m.pos.x + 35 * Math.cos(m.angle), m.pos.y + 35 * Math.sin(m.angle), 60, 27, b.fireAttributes(dir)); bullet[me] = Bodies.rectangle(m.pos.x + 35 * Math.cos(m.angle), m.pos.y + 35 * Math.sin(m.angle), 60, 27, b.fireAttributes(dir));
Matter.Body.setDensity(bullet[me], 0.004); Matter.Body.setDensity(bullet[me], 0.007);
World.add(engine.world, bullet[me]); //add bullet to world World.add(engine.world, bullet[me]); //add bullet to world
const SPEED = (m.crouch ? 52 : 43) + Math.random() * 7 const SPEED = (m.crouch ? 45 : 35) + Math.random() * 6
Matter.Body.setVelocity(bullet[me], { Matter.Body.setVelocity(bullet[me], {
x: SPEED * Math.cos(dir), x: SPEED * Math.cos(dir),
y: SPEED * Math.sin(dir) y: SPEED * Math.sin(dir)
@@ -3737,7 +3737,7 @@ const b = {
if (tech.isIncendiary) { if (tech.isIncendiary) {
bullet[me].endCycle = simulation.cycle + 60 bullet[me].endCycle = simulation.cycle + 60
bullet[me].onEnd = function() { bullet[me].onEnd = function() {
b.explosion(this.position, 250 + (Math.random() - 0.5) * 60); //makes bullet do explosive damage at end b.explosion(this.position, 300 + (Math.random() - 0.5) * 60); //makes bullet do explosive damage at end
} }
bullet[me].beforeDmg = function() { bullet[me].beforeDmg = function() {
this.endCycle = 0; //bullet ends cycle after hitting a mob and triggers explosion this.endCycle = 0; //bullet ends cycle after hitting a mob and triggers explosion
@@ -3749,7 +3749,7 @@ const b = {
// bullet[me].restitution = 0.4 // bullet[me].restitution = 0.4
bullet[me].frictionAir = 0.006; bullet[me].frictionAir = 0.006;
bullet[me].do = function() { bullet[me].do = function() {
this.force.y += this.mass * 0.002 this.force.y += this.mass * 0.0022
//rotates bullet to face current velocity? //rotates bullet to face current velocity?
if (this.speed > 6) { if (this.speed > 6) {
@@ -3757,7 +3757,7 @@ const b = {
x: Math.cos(this.angle), x: Math.cos(this.angle),
y: Math.sin(this.angle) y: Math.sin(this.angle)
} }
const mag = 0.017 const mag = 0.04
if (Vector.cross(Vector.normalise(this.velocity), facing) < 0) { if (Vector.cross(Vector.normalise(this.velocity), facing) < 0) {
this.torque += mag this.torque += mag
} else { } else {
@@ -3801,32 +3801,32 @@ const b = {
World.add(engine.world, bullet[me]); //add bullet to world World.add(engine.world, bullet[me]); //add bullet to world
} }
} else if (tech.isNailShot) { } else if (tech.isNailShot) {
spread *= 0.4 spread *= 0.65
if (m.crouch) { if (m.crouch) {
for (let i = 0; i < 17; i++) { for (let i = 0; i < 17; i++) {
speed = 38 + 15 * Math.random()
const dir = m.angle + (Math.random() - 0.5) * spread const dir = m.angle + (Math.random() - 0.5) * spread
const pos = { const pos = {
x: m.pos.x + 35 * Math.cos(m.angle) + 15 * (Math.random() - 0.5), x: m.pos.x + 35 * Math.cos(m.angle) + 15 * (Math.random() - 0.5),
y: m.pos.y + 35 * Math.sin(m.angle) + 15 * (Math.random() - 0.5) y: m.pos.y + 35 * Math.sin(m.angle) + 15 * (Math.random() - 0.5)
} }
speed = 48 + 8 * Math.random()
b.nail(pos, { b.nail(pos, {
x: speed * Math.cos(dir), x: speed * Math.cos(dir),
y: speed * Math.sin(dir) y: speed * Math.sin(dir)
}) }, 1.4)
} }
} else { } else {
for (let i = 0; i < 17; i++) { for (let i = 0; i < 17; i++) {
speed = 38 + 15 * Math.random()
const dir = m.angle + (Math.random() - 0.5) * spread const dir = m.angle + (Math.random() - 0.5) * spread
const pos = { const pos = {
x: m.pos.x + 35 * Math.cos(m.angle) + 15 * (Math.random() - 0.5), x: m.pos.x + 35 * Math.cos(m.angle) + 15 * (Math.random() - 0.5),
y: m.pos.y + 35 * Math.sin(m.angle) + 15 * (Math.random() - 0.5) y: m.pos.y + 35 * Math.sin(m.angle) + 15 * (Math.random() - 0.5)
} }
speed = 48 + 8 * Math.random()
b.nail(pos, { b.nail(pos, {
x: speed * Math.cos(dir), x: speed * Math.cos(dir),
y: speed * Math.sin(dir) y: speed * Math.sin(dir)
}) }, 1.4)
} }
} }
} else { } else {
@@ -3991,62 +3991,65 @@ const b = {
ctx.strokeStyle = "rgba(0,0,0,0.2)" //"000"; ctx.strokeStyle = "rgba(0,0,0,0.2)" //"000";
ctx.lineWidth = 2 ctx.lineWidth = 2
ctx.beginPath(); ctx.beginPath();
for (let i = this.waves.length - 1; i > -1; i--) { for (let i = this.waves.length - 1; i > -1; i--) {
const v1 = Vector.add(this.waves[i].position, Vector.mult(this.waves[i].unit1, this.waves[i].radius)) const v1 = Vector.add(this.waves[i].position, Vector.mult(this.waves[i].unit1, this.waves[i].radius))
const v2 = Vector.add(this.waves[i].position, Vector.mult(this.waves[i].unit2, this.waves[i].radius)) const v2 = Vector.add(this.waves[i].position, Vector.mult(this.waves[i].unit2, this.waves[i].radius))
// collisions //draw wave
//using small angle linear approximation of circle arc, this will not work if the arc gets large // https://stackoverflow.com/questions/13652518/efficiently-find-points-inside-a-circle-sector
let hits = Matter.Query.ray(mob, v1, v2, 50) //Matter.Query.ray(bodies, startPoint, endPoint, [rayWidth])
for (let j = 0; j < hits.length; j++) {
const who = hits[j].body
//make them shake around
who.force.x += 0.01 * (Math.random() - 0.5) * who.mass
who.force.y += 0.01 * (Math.random() - 0.5) * who.mass
Matter.Body.setVelocity(who, { //friction
x: who.velocity.x * 0.95,
y: who.velocity.y * 0.95
});
let vertices = who.vertices;
const vibe = 50 + who.radius * 0.15
ctx.moveTo(vertices[0].x + vibe * (Math.random() - 0.5), vertices[0].y + vibe * (Math.random() - 0.5));
for (let j = 1; j < vertices.length; j++) {
ctx.lineTo(vertices[j].x + vibe * (Math.random() - 0.5), vertices[j].y + vibe * (Math.random() - 0.5));
}
ctx.lineTo(vertices[0].x + vibe * (Math.random() - 0.5), vertices[0].y + vibe * (Math.random() - 0.5));
const damage = 1.65 * b.dmgScale * tech.waveBeamDamage * tech.wavePacketDamage / Math.sqrt(who.radius) //damage is lower for large radius mobs, since they feel the waves longer
who.locatePlayer();
who.damage(damage);
}
hits = Matter.Query.ray(body, v1, v2, 50) //Matter.Query.ray(bodies, startPoint, endPoint, [rayWidth])
for (let j = 0; j < hits.length; j++) {
const who = hits[j].body
//make them shake around
who.force.x += 0.01 * (Math.random() - 0.5) * who.mass
who.force.y += (0.01 * (Math.random() - 0.5) - simulation.g * 0.25) * who.mass //remove force of gravity
let vertices = who.vertices;
const vibe = 25
ctx.moveTo(vertices[0].x + vibe * (Math.random() - 0.5), vertices[0].y + vibe * (Math.random() - 0.5));
for (let j = 1; j < vertices.length; j++) {
ctx.lineTo(vertices[j].x + vibe * (Math.random() - 0.5), vertices[j].y + vibe * (Math.random() - 0.5));
}
ctx.lineTo(vertices[0].x + vibe * (Math.random() - 0.5), vertices[0].y + vibe * (Math.random() - 0.5));
}
ctx.stroke(); //draw vibes
// ctx.beginPath(); //draw wave
ctx.moveTo(v1.x, v1.y) ctx.moveTo(v1.x, v1.y)
ctx.arc(this.waves[i].position.x, this.waves[i].position.y, this.waves[i].radius, this.waves[i].angle, this.waves[i].angle + this.waves[i].arc); ctx.arc(this.waves[i].position.x, this.waves[i].position.y, this.waves[i].radius, this.waves[i].angle, this.waves[i].angle + this.waves[i].arc);
if (!m.isBodiesAsleep) this.waves[i].radius += tech.waveBeamSpeed * 2 //expand / move // collisions
//using small angle linear approximation of circle arc, this will not work if the arc gets large // https://stackoverflow.com/questions/13652518/efficiently-find-points-inside-a-circle-sector
if (!m.isBodiesAsleep) {
let hits = Matter.Query.ray(mob, v1, v2, 50) //Matter.Query.ray(bodies, startPoint, endPoint, [rayWidth])
for (let j = 0; j < hits.length; j++) {
const who = hits[j].body
//make them shake around
who.force.x += 0.01 * (Math.random() - 0.5) * who.mass
who.force.y += 0.01 * (Math.random() - 0.5) * who.mass
Matter.Body.setVelocity(who, { //friction
x: who.velocity.x * 0.95,
y: who.velocity.y * 0.95
});
let vertices = who.vertices;
const vibe = 50 + who.radius * 0.15
ctx.moveTo(vertices[0].x + vibe * (Math.random() - 0.5), vertices[0].y + vibe * (Math.random() - 0.5));
for (let j = 1; j < vertices.length; j++) {
ctx.lineTo(vertices[j].x + vibe * (Math.random() - 0.5), vertices[j].y + vibe * (Math.random() - 0.5));
}
ctx.lineTo(vertices[0].x + vibe * (Math.random() - 0.5), vertices[0].y + vibe * (Math.random() - 0.5));
const damage = 1.75 * b.dmgScale * tech.waveBeamDamage * tech.wavePacketDamage / Math.sqrt(who.radius) //damage is lower for large radius mobs, since they feel the waves longer
who.locatePlayer();
who.damage(damage);
}
hits = Matter.Query.ray(body, v1, v2, 50) //Matter.Query.ray(bodies, startPoint, endPoint, [rayWidth])
for (let j = 0; j < hits.length; j++) {
const who = hits[j].body
//make them shake around
who.force.x += 0.01 * (Math.random() - 0.5) * who.mass
who.force.y += (0.01 * (Math.random() - 0.5) - simulation.g * 0.25) * who.mass //remove force of gravity
let vertices = who.vertices;
const vibe = 25
ctx.moveTo(vertices[0].x + vibe * (Math.random() - 0.5), vertices[0].y + vibe * (Math.random() - 0.5));
for (let j = 1; j < vertices.length; j++) {
ctx.lineTo(vertices[j].x + vibe * (Math.random() - 0.5), vertices[j].y + vibe * (Math.random() - 0.5));
}
ctx.lineTo(vertices[0].x + vibe * (Math.random() - 0.5), vertices[0].y + vibe * (Math.random() - 0.5));
}
ctx.stroke(); //draw vibes
this.waves[i].radius += tech.waveBeamSpeed * 2 //expand / move
}
if (this.waves[i].radius > 1800 * tech.isBulletsLastLonger) this.waves.splice(i, 1) //end if (this.waves[i].radius > 1800 * tech.isBulletsLastLonger) this.waves.splice(i, 1) //end
} }
ctx.stroke(); ctx.stroke();
}, },
fireLongitudinal() { fireLongitudinal() {
m.fireCDcycle = m.cycle + Math.floor(8 * b.fireCDscale); // cool down m.fireCDcycle = m.cycle + Math.floor((m.crouch ? 3 : 8) * b.fireCDscale); // cool down
const halfArc = Math.PI / 8 * (m.crouch ? 0.7 : 0.5) const halfArc = m.crouch ? 0.0785 : 0.275 //6.28 is a full circle, but these arcs needs to stay small because we are using small angle linear approximation, for collisions
this.waves.push({ this.waves.push({
position: { position: {
x: m.pos.x + 25 * Math.cos(m.angle), x: m.pos.x + 25 * Math.cos(m.angle),
@@ -4299,7 +4302,7 @@ const b = {
name: "mine", name: "mine",
description: "toss a <strong>proximity</strong> mine that <strong>sticks</strong> to walls<br>fires <strong>nails</strong> at mobs within range", description: "toss a <strong>proximity</strong> mine that <strong>sticks</strong> to walls<br>fires <strong>nails</strong> at mobs within range",
ammo: 0, ammo: 0,
ammoPack: 2.7, ammoPack: 2,
have: false, have: false,
do() {}, do() {},
fire() { fire() {

View File

@@ -15,8 +15,9 @@ const level = {
// level.difficultyIncrease(30) // level.difficultyIncrease(30)
// simulation.isHorizontalFlipped = true // simulation.isHorizontalFlipped = true
// m.setField("wormhole") // m.setField("wormhole")
// b.giveGuns("wave beam") // b.giveGuns("laser")
// tech.giveTech("pressure wave") // tech.giveTech("laser diode")
// tech.giveTech("free-electron laser")
// for (let i = 0; i < 9; i++) tech.giveTech("spherical harmonics") // for (let i = 0; i < 9; i++) tech.giveTech("spherical harmonics")
// tech.giveTech("decoherence") // tech.giveTech("decoherence")
// for (let i = 0; i < 3; i++) tech.giveTech("packet length") // for (let i = 0; i < 3; i++) tech.giveTech("packet length")
@@ -53,7 +54,7 @@ const level = {
// lore.techCount = 6 // lore.techCount = 6
// simulation.isCheating = false //true; // simulation.isCheating = false //true;
// localSettings.loreCount = 2; //this sets what conversation is heard // localSettings.loreCount = 0; //this sets what conversation is heard
// localStorage.setItem("localSettings", JSON.stringify(localSettings)); //update local storage // localStorage.setItem("localSettings", JSON.stringify(localSettings)); //update local storage
// level.onLevel = -1 //this sets level.levels[level.onLevel] = undefined which is required to run the conversation // level.onLevel = -1 //this sets level.levels[level.onLevel] = undefined which is required to run the conversation
// level.null() // level.null()
@@ -90,7 +91,7 @@ const level = {
powerUps.spawn(player.position.x + Math.random() * 50, player.position.y - Math.random() * 50, "tech", false); powerUps.spawn(player.position.x + Math.random() * 50, player.position.y - Math.random() * 50, "tech", false);
} }
if (tech.isHealLowHealth) { if (tech.isHealLowHealth) {
const len = Math.ceil((m.maxHealth - m.health) / 0.22) const len = Math.ceil((m.maxHealth - m.health) / 0.26)
for (let i = 0; i < len; i++) powerUps.spawn(player.position.x + 90 * (Math.random() - 0.5), player.position.y + 90 * (Math.random() - 0.5), "heal", false); for (let i = 0; i < len; i++) powerUps.spawn(player.position.x + 90 * (Math.random() - 0.5), player.position.y + 90 * (Math.random() - 0.5), "heal", false);
} }
if (tech.isMACHO) spawn.MACHO() if (tech.isMACHO) spawn.MACHO()
@@ -110,24 +111,24 @@ const level = {
difficultyIncrease(num = 1) { difficultyIncrease(num = 1) {
for (let i = 0; i < num; i++) { for (let i = 0; i < num; i++) {
simulation.difficulty++ simulation.difficulty++
b.dmgScale *= 0.92; //damage done by player decreases each level b.dmgScale *= 0.91; //damage done by player decreases each level
if (simulation.accelScale < 5) simulation.accelScale *= 1.02 //mob acceleration increases each level if (simulation.accelScale < 5) simulation.accelScale *= 1.02 //mob acceleration increases each level
if (simulation.lookFreqScale > 0.2) simulation.lookFreqScale *= 0.98 //mob cycles between looks decreases each level if (simulation.lookFreqScale > 0.2) simulation.lookFreqScale *= 0.98 //mob cycles between looks decreases each level
if (simulation.CDScale > 0.2) simulation.CDScale *= 0.97 //mob CD time decreases each level if (simulation.CDScale > 0.2) simulation.CDScale *= 0.97 //mob CD time decreases each level
} }
simulation.dmgScale = 0.385 * simulation.difficulty //damage done by mobs increases each level simulation.dmgScale = 0.4 * 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; simulation.healScale = 1 / (1 + simulation.difficulty * 0.055) //a higher denominator makes for lower heals // m.health += heal * simulation.healScale;
}, },
difficultyDecrease(num = 1) { //used in easy mode for simulation.reset() difficultyDecrease(num = 1) { //used in easy mode for simulation.reset()
for (let i = 0; i < num; i++) { for (let i = 0; i < num; i++) {
simulation.difficulty-- simulation.difficulty--
b.dmgScale /= 0.92; //damage done by player decreases each level b.dmgScale /= 0.91; //damage done by player decreases each level
if (simulation.accelScale > 0.2) simulation.accelScale /= 1.02 //mob acceleration increases each level if (simulation.accelScale > 0.2) simulation.accelScale /= 1.02 //mob acceleration increases each level
if (simulation.lookFreqScale < 5) simulation.lookFreqScale /= 0.98 //mob cycles between looks decreases each level if (simulation.lookFreqScale < 5) simulation.lookFreqScale /= 0.98 //mob cycles between looks decreases each level
if (simulation.CDScale < 5) simulation.CDScale /= 0.97 //mob CD time decreases each level if (simulation.CDScale < 5) simulation.CDScale /= 0.97 //mob CD time decreases each level
} }
if (simulation.difficulty < 1) simulation.difficulty = 0; if (simulation.difficulty < 1) simulation.difficulty = 0;
simulation.dmgScale = 0.385 * simulation.difficulty //damage done by mobs increases each level simulation.dmgScale = 0.4 * simulation.difficulty //damage done by mobs increases each level
if (simulation.dmgScale < 0.1) simulation.dmgScale = 0.1; if (simulation.dmgScale < 0.1) simulation.dmgScale = 0.1;
simulation.healScale = 1 / (1 + simulation.difficulty * 0.055) simulation.healScale = 1 / (1 + simulation.difficulty * 0.055)
}, },
@@ -2821,9 +2822,9 @@ const level = {
powerUps.spawnBossPowerUp(-125, -1760); powerUps.spawnBossPowerUp(-125, -1760);
} else { } else {
if (Math.random() < 0.5) { if (Math.random() < 0.5) {
spawn.randomLevelBoss(700, -1550, ["shooterBoss", "launcherBoss", "laserTargetingBoss", "streamBoss", "shieldingBoss", "pulsarBoss"]); spawn.randomLevelBoss(700, -1550, ["shooterBoss", "launcherBoss", "laserTargetingBoss", "streamBoss", "shieldingBoss", "pulsarBoss", "grenadierBoss"]);
} else { } else {
spawn.randomLevelBoss(675, -2775, ["shooterBoss", "launcherBoss", "laserTargetingBoss", "streamBoss", "shieldingBoss", "pulsarBoss"]); spawn.randomLevelBoss(675, -2775, ["shooterBoss", "launcherBoss", "laserTargetingBoss", "streamBoss", "shieldingBoss", "pulsarBoss", "grenadierBoss"]);
} }
} }
powerUps.addResearchToLevel() //needs to run after mobs are spawned powerUps.addResearchToLevel() //needs to run after mobs are spawned
@@ -3032,7 +3033,7 @@ const level = {
spawn.randomMob(3600, 1725, 0.9); spawn.randomMob(3600, 1725, 0.9);
spawn.randomMob(4100, 1225, 0.9); spawn.randomMob(4100, 1225, 0.9);
spawn.randomMob(2825, 400, 0.9); spawn.randomMob(2825, 400, 0.9);
if (simulation.difficulty > 3) spawn.randomLevelBoss(6000, 2300, ["spiderBoss", "launcherBoss", "laserTargetingBoss", "streamBoss", "historyBoss", "orbitalBoss", "shieldingBoss"]); if (simulation.difficulty > 3) spawn.randomLevelBoss(6000, 2300, ["spiderBoss", "launcherBoss", "laserTargetingBoss", "streamBoss", "historyBoss", "orbitalBoss", "grenadierBoss"]);
powerUps.addResearchToLevel() //needs to run after mobs are spawned powerUps.addResearchToLevel() //needs to run after mobs are spawned
spawn.secondaryBossChance(7725, 2275) spawn.secondaryBossChance(7725, 2275)
@@ -6362,6 +6363,7 @@ const level = {
level.exit.x = 3900; level.exit.x = 3900;
level.exit.y = 1060; level.exit.y = 1060;
spawn.mapRect(level.exit.x, level.exit.y + 30, 100, 20) spawn.mapRect(level.exit.x, level.exit.y + 30, 100, 20)
document.body.style.backgroundColor = "#dcdcde";
var nextBlockSpawn = simulation.cycle + Math.floor(Math.random() * 60 + 30) var nextBlockSpawn = simulation.cycle + Math.floor(Math.random() * 60 + 30)
const door = level.door(475, 900, 50, 200, 201) const door = level.door(475, 900, 50, 200, 201)

View File

@@ -139,17 +139,17 @@ const lore = {
sentence: 0, //what part of the conversation is playing sentence: 0, //what part of the conversation is playing
conversation: [ conversation: [
[ //first time they meet, and testing gets unlocked [ //first time they meet, and testing gets unlocked
() => { setTimeout(() => { lore.miriam.text("I've never seen it generate this level before.") }, 5000); }, () => {
lore.unlockTesting();
setTimeout(() => { lore.miriam.text("I've never seen it generate this level before.") }, 5000);
},
() => { lore.anand.text("Wow. Just a platform.") }, () => { lore.anand.text("Wow. Just a platform.") },
() => { lore.miriam.text("And that thing...") }, () => { lore.miriam.text("And that thing...") },
() => { lore.anand.text("Weird") }, () => { lore.anand.text("Weird") },
() => { lore.anand.text("Maybe it's trapped.") }, () => { lore.anand.text("Maybe it's trapped.") },
() => { lore.miriam.text("Looks like testing mode is locked.") }, () => { lore.miriam.text("Looks like testing mode is locked.") },
() => { lore.miriam.text("I'll unlock it with the console command.") }, () => { lore.miriam.text("I'll unlock it with the console command.") },
() => { () => { setTimeout(() => { lore.miriam.text("Hey little bot! Just press 'T' to enter testing mode and 'U' to go to the next level.") }, 1000); },
lore.unlockTesting();
setTimeout(() => { lore.miriam.text("Hey little bot! Just press 'T' to enter testing mode and 'U' to go to the next level.") }, 1000);
},
() => { lore.anand.text("It can't process what you're saying.") }, () => { lore.anand.text("It can't process what you're saying.") },
() => { lore.miriam.text("ha hahahaha. I know, but it does seem to be getting smarter.") }, () => { lore.miriam.text("ha hahahaha. I know, but it does seem to be getting smarter.") },
() => { () => {

View File

@@ -371,7 +371,10 @@ const powerUps = {
if (tech.isAmmoForGun && b.inventory.length > 0 && b.activeGun) { if (tech.isAmmoForGun && b.inventory.length > 0 && b.activeGun) {
const target = b.guns[b.activeGun] const target = b.guns[b.activeGun]
if (target.ammo !== Infinity) { if (target.ammo !== Infinity) {
const ammoAdded = Math.ceil(Math.random() * target.ammoPack) + Math.ceil(0.7 * Math.random() * target.ammoPack)
// const ammoAdded = Math.ceil(Math.random() * target.ammoPack) + Math.ceil(0.7 * Math.random() * target.ammoPack)
// const ammoAdded = Math.ceil((Math.random() + 0.5 * Math.random()) * target.ammoPack)
const ammoAdded = Math.ceil((0.5 * Math.random() + 0.4 * Math.random()) * target.ammoPack)
target.ammo += ammoAdded target.ammo += ammoAdded
simulation.makeTextLog(`${target.name}.<span class='color-gun'>ammo</span> <span class='color-symbol'>+=</span> ${ammoAdded}`) simulation.makeTextLog(`${target.name}.<span class='color-gun'>ammo</span> <span class='color-symbol'>+=</span> ${ammoAdded}`)
} }
@@ -379,7 +382,7 @@ const powerUps = {
for (let i = 0, len = b.inventory.length; i < len; i++) { for (let i = 0, len = b.inventory.length; i < len; i++) {
const target = b.guns[b.inventory[i]] const target = b.guns[b.inventory[i]]
if (target.ammo !== Infinity) { if (target.ammo !== Infinity) {
const ammoAdded = Math.ceil(Math.random() * target.ammoPack) const ammoAdded = Math.ceil((0.5 * Math.random() + 0.4 * Math.random()) * target.ammoPack) //Math.ceil(Math.random() * target.ammoPack)
target.ammo += ammoAdded target.ammo += ammoAdded
simulation.makeTextLog(`${target.name}.<span class='color-gun'>ammo</span> <span class='color-symbol'>+=</span> ${ammoAdded}`) simulation.makeTextLog(`${target.name}.<span class='color-gun'>ammo</span> <span class='color-symbol'>+=</span> ${ammoAdded}`)
} }

View File

@@ -345,6 +345,14 @@ const simulation = {
} }
}, },
switchGun() { switchGun() {
if (tech.isLongitudinal && b.guns[b.activeGun].name === "wave beam") {
for (i = 0, len = b.guns.length; i < len; i++) { //find which gun
if (b.guns[i].name === "wave beam") {
b.guns[i].waves = []; //empty array of wave bullets
break;
}
}
}
if (tech.isCrouchAmmo) tech.isCrouchAmmo = 1 //this prevents hacking the tech by switching guns if (tech.isCrouchAmmo) tech.isCrouchAmmo = 1 //this prevents hacking the tech by switching guns
b.activeGun = b.inventory[b.inventoryGun]; b.activeGun = b.inventory[b.inventoryGun];
if (b.guns[b.activeGun].charge) b.guns[b.activeGun].charge = 0; //if switching into foam set charge to 0 if (b.guns[b.activeGun].charge) b.guns[b.activeGun].charge = 0; //if switching into foam set charge to 0
@@ -662,6 +670,14 @@ const simulation = {
}, },
clearNow: false, clearNow: false,
clearMap() { clearMap() {
if (tech.isLongitudinal) {
for (i = 0, len = b.guns.length; i < len; i++) { //find which gun
if (b.guns[i].name === "wave beam") {
b.guns[i].waves = []; //empty array of wave bullets
break;
}
}
}
if (tech.isMineAmmoBack) { if (tech.isMineAmmoBack) {
let count = 0; let count = 0;
for (i = 0, len = bullet.length; i < len; i++) { //count mines left on map for (i = 0, len = bullet.length; i < len; i++) { //count mines left on map
@@ -676,7 +692,6 @@ const simulation = {
} }
} }
} }
if (tech.isMutualism && !tech.isEnergyHealth) { if (tech.isMutualism && !tech.isEnergyHealth) {
for (let i = 0; i < bullet.length; i++) { for (let i = 0; i < bullet.length; i++) {
if (bullet[i].isMutualismActive) { if (bullet[i].isMutualismActive) {
@@ -686,7 +701,6 @@ const simulation = {
} }
} }
} }
if (tech.isEndLevelPowerUp) { if (tech.isEndLevelPowerUp) {
for (let i = 0; i < powerUp.length; i++) { for (let i = 0; i < powerUp.length; i++) {
if (powerUp[i].name === "tech") { if (powerUp[i].name === "tech") {
@@ -701,10 +715,7 @@ const simulation = {
} }
} }
powerUps.totalPowerUps = powerUp.length powerUps.totalPowerUps = powerUp.length
let holdTarget = (m.holdingTarget) ? m.holdingTarget : undefined //if player is holding something this remembers it before it gets deleted
let holdTarget; //if player is holding something this remembers it before it gets deleted
if (m.holdingTarget) holdTarget = m.holdingTarget;
tech.deathSpawnsFromBoss = 0; tech.deathSpawnsFromBoss = 0;
simulation.fallHeight = 3000; simulation.fallHeight = 3000;
m.fireCDcycle = 0 m.fireCDcycle = 0

View File

@@ -258,7 +258,7 @@ const spawn = {
me.memory = Infinity; me.memory = Infinity;
me.hasRunDeathScript = false me.hasRunDeathScript = false
me.locatePlayer(); me.locatePlayer();
const density = 0.23 const density = 0.2
Matter.Body.setDensity(me, density); //extra dense //normal is 0.001 //makes effective life much larger Matter.Body.setDensity(me, density); //extra dense //normal is 0.001 //makes effective life much larger
// spawn.shield(me, x, y, 1); // spawn.shield(me, x, y, 1);
me.onDeath = function() { me.onDeath = function() {

View File

@@ -169,7 +169,7 @@
if (tech.isEnergyDamage) dmg *= 1 + m.energy / 9; if (tech.isEnergyDamage) dmg *= 1 + m.energy / 9;
if (tech.isDamageFromBulletCount) dmg *= 1 + bullet.length * 0.0038 if (tech.isDamageFromBulletCount) dmg *= 1 + bullet.length * 0.0038
if (tech.isRerollDamage) dmg *= 1 + 0.042 * powerUps.research.count if (tech.isRerollDamage) dmg *= 1 + 0.042 * powerUps.research.count
if (tech.isOneGun && b.inventory.length < 2) dmg *= 1.22 if (tech.isOneGun && b.inventory.length < 2) dmg *= 1.35
if (tech.isNoFireDamage && m.cycle > m.fireCDcycle + 120) dmg *= 1.9 if (tech.isNoFireDamage && m.cycle > m.fireCDcycle + 120) dmg *= 1.9
if (tech.isSpeedDamage) dmg *= 1 + Math.min(0.43, player.speed * 0.015) if (tech.isSpeedDamage) dmg *= 1 + Math.min(0.43, player.speed * 0.015)
if (tech.isBotDamage) dmg *= 1 + 0.06 * b.totalBots() if (tech.isBotDamage) dmg *= 1 + 0.06 * b.totalBots()
@@ -195,7 +195,7 @@
}, },
tech: [{ tech: [{
name: "integrated armament", name: "integrated armament",
description: `increase <strong class='color-d'>damage</strong> by <strong>22%</strong><br>your inventory can only hold 1 <strong class='color-g'>gun</strong>`, description: `increase <strong class='color-d'>damage</strong> by <strong>35%</strong><br>your inventory can only hold 1 <strong class='color-g'>gun</strong>`,
maxCount: 1, maxCount: 1,
count: 0, count: 0,
frequency: 2, frequency: 2,
@@ -2522,7 +2522,7 @@
}, },
{ {
name: "negative entropy", name: "negative entropy",
description: `at the start of each <strong>level</strong><br>spawn a <strong class='color-h'>heal</strong> for every <strong>22</strong> missing health`, description: `at the start of each <strong>level</strong><br>spawn a <strong class='color-h'>heal</strong> for every <strong>26</strong> missing health`,
maxCount: 1, maxCount: 1,
count: 0, count: 0,
frequency: 1, frequency: 1,
@@ -3984,8 +3984,8 @@
for (i = 0, len = b.guns.length; i < len; i++) { //find which gun for (i = 0, len = b.guns.length; i < len; i++) { //find which gun
if (b.guns[i].name === "wave beam") { if (b.guns[i].name === "wave beam") {
b.guns[i].chooseFireMethod() b.guns[i].chooseFireMethod()
b.guns[i].ammoPack = b.guns[i].defaultAmmoPack * 0.125 b.guns[i].ammoPack = b.guns[i].defaultAmmoPack / 8
b.guns[i].ammo = Math.ceil(b.guns[i].ammo * 0.125); b.guns[i].ammo = Math.ceil(b.guns[i].ammo / 8);
simulation.updateGunHUD(); simulation.updateGunHUD();
break break
} }
@@ -4638,7 +4638,7 @@
} }
}, },
{ {
name: "laser diodes", name: "laser diode",
description: "all <strong class='color-laser'>lasers</strong> drain <strong>30%</strong> less <strong class='color-f'>energy</strong><br><em>affects laser-gun, laser-bot, and laser-mines</em>", description: "all <strong class='color-laser'>lasers</strong> drain <strong>30%</strong> less <strong class='color-f'>energy</strong><br><em>affects laser-gun, laser-bot, and laser-mines</em>",
isGunTech: true, isGunTech: true,
maxCount: 1, maxCount: 1,
@@ -4646,18 +4646,22 @@
frequency: 2, frequency: 2,
frequencyDefault: 2, frequencyDefault: 2,
allowed() { allowed() {
return tech.haveGunCheck("laser") || tech.laserBotCount > 1 || tech.isLaserMine return (tech.haveGunCheck("laser") || tech.laserBotCount > 1 || tech.isLaserMine) && tech.laserDamage === 0.15
}, },
requires: "laser", requires: "laser, not free-electron",
effect() { effect() {
tech.isLaserDiode = 0.70; //100%-37% tech.isLaserDiode = 0.70; //100%-37%
tech.laserColor = "rgb(0, 11, 255)"
tech.laserColorAlpha = "rgba(0, 11, 255,0.5)"
}, },
remove() { remove() {
tech.isLaserDiode = 1; tech.isLaserDiode = 1;
tech.laserColor = "#f02"
tech.laserColorAlpha = "rgba(255, 0, 0, 0.5)"
} }
}, },
{ {
name: "gamma-ray laser", name: "free-electron laser",
description: "increase all <strong class='color-laser'>laser</strong> <strong class='color-d'>damage</strong> by <strong>200%</strong><br>increase all <strong class='color-laser'>laser</strong> <strong class='color-f'>energy</strong> drain by <strong>250%</strong>", description: "increase all <strong class='color-laser'>laser</strong> <strong class='color-d'>damage</strong> by <strong>200%</strong><br>increase all <strong class='color-laser'>laser</strong> <strong class='color-f'>energy</strong> drain by <strong>250%</strong>",
isGunTech: true, isGunTech: true,
maxCount: 1, maxCount: 1,
@@ -4665,9 +4669,9 @@
frequency: 2, frequency: 2,
frequencyDefault: 2, frequencyDefault: 2,
allowed() { allowed() {
return (tech.haveGunCheck("laser") || tech.isLaserMine || tech.laserBotCount > 1) && !tech.isPulseLaser return (tech.haveGunCheck("laser") || tech.isLaserMine || tech.laserBotCount > 1) && !tech.isPulseLaser && tech.isLaserDiode === 1
}, },
requires: "laser, not pulse", requires: "laser, not pulse, diodes",
effect() { effect() {
tech.laserFieldDrain = 0.007 //base is 0.002 tech.laserFieldDrain = 0.007 //base is 0.002
tech.laserDamage = 0.45; //base is 0.15 tech.laserDamage = 0.45; //base is 0.15

View File

@@ -610,6 +610,8 @@ summary {
.color-laser { .color-laser {
color: #f02; color: #f02;
/* color: #000bff; */
/* color: #83f; */
/* text-shadow: 0px 0px 2px rgba(255, 0, 119, 0.3); */ /* text-shadow: 0px 0px 2px rgba(255, 0, 119, 0.3); */
/* text-shadow: 0px 0px 1.5px rgba(0, 0, 0, 1), 0px 0px 5px rgba(255, 0, 0, 1); */ /* text-shadow: 0px 0px 1.5px rgba(0, 0, 0, 1), 0px 0px 5px rgba(255, 0, 0, 1); */
font-weight: 100; font-weight: 100;

View File

@@ -1,21 +1,36 @@
******************************************************** NEXT PATCH ******************************************************** ******************************************************** NEXT PATCH ********************************************************
pressure wave balance - slightly more ammo "gamma-ray laser" renamed "free-electron laser" to make more scientific sense
gamma-ray laser does 200% damage and 250% more drain (was 150% damage, 200% drain) since gamma rays would go right through walls
gamma ray now doesn't lock out other laser tech laser diode now makes lasers blue
hidden variable now gives 15, not 30 heals free-electron laser can no longer work with laser diode
pressure wave has a bit more damage
crouch mode works different (much higher fire rate, low arc)
integrated armament gives 35% dmg (was 22%)
but I fixed a bug where it gave an extra 33% ammo
mine gun gets 25% less ammo
all mines do 30% more damage
trying to make shotgun better at close range and worse at distance
shotgun slug is much slower, but does 60% more damage
nail shot has a 20% wider spread, and is 20% slower, but does 20% more damage
finalBoss has 15% less health
to balance all the buffs
ammo power ups give 15% less ammo
damage done by mobs now scales up a bit faster each level
damage done by you now scales down a bit faster each level
******************************************************** TODO ******************************************************** ******************************************************** TODO ********************************************************
wave arcs make the player get a buff after using wormhole
do something similar to laser while energy lasts: drain energy and give damage buff
find intersection of the small angle approximation of the arc and all mobs
tech: this.arc: Math.PI/8 // increase or decrease arc
wipe arcs on next level
try crosshair invert colors tech pressure wave - reduce range, but make bullets circles, not arcs
tech wave gun - no bullets just draw circle arcs that do damage to mobs near the circle arc
tech: quantized shields - harmonic standing wave field can only lose 33 energy per hit tech: quantized shields - harmonic standing wave field can only lose 33 energy per hit
draw 1,2,3 levels of the field based on energy? draw 1,2,3 levels of the field based on energy?
@@ -183,6 +198,9 @@ n-gon outreach ideas
******************************************************** BUGS ******************************************************** ******************************************************** BUGS ********************************************************
door to exit in vats does nothing
did I do that?
death while in power up selection menu doesn't reset properly death while in power up selection menu doesn't reset properly
of course it's not possible to die in this menu unless you use testing and shift+X of course it's not possible to die in this menu unless you use testing and shift+X