particle collider
tech: particle collider - in pause menu clicking a tech ejects it (5% chance to lose the power up and convert into energy) (also works on testing without the tech) growBoss no longer goes invulnerable bounceBoss bullets (on reactor map) do 33% less damage move 50% slower, so they don't fill the entire map ground state reworked: reduce passive energy regen by 66%, increase max energy by 200 electronegativity: increase damage by 1% for every 9 -> 8 energy acetone peroxide does 300 -> 200% more self harm from explosions predator renamed parasitism
This commit is contained in:
50
js/bullet.js
50
js/bullet.js
@@ -1,7 +1,7 @@
|
|||||||
let bullet = [];
|
let bullet = [];
|
||||||
|
|
||||||
const b = {
|
const b = {
|
||||||
dmgScale: null, //scales all gun damage from momentum, but not raw .dmg //set in levels.setDifficulty
|
// dmgScale: null, //scales all damage, but not raw .dmg //set in levels.setDifficulty
|
||||||
gravity: 0.0006, //most other bodies have gravity = 0.001
|
gravity: 0.0006, //most other bodies have gravity = 0.001
|
||||||
activeGun: null, //current gun in use by player
|
activeGun: null, //current gun in use by player
|
||||||
inventoryGun: 0,
|
inventoryGun: 0,
|
||||||
@@ -371,7 +371,7 @@ const b = {
|
|||||||
|
|
||||||
//player damage
|
//player damage
|
||||||
if (Vector.magnitude(Vector.sub(where, player.position)) < radius) {
|
if (Vector.magnitude(Vector.sub(where, player.position)) < radius) {
|
||||||
const DRAIN = (tech.isExplosionHarm ? 1.2 : 0.45) * (tech.isRadioactiveResistance ? 0.25 : 1)
|
const DRAIN = (tech.isExplosionHarm ? 0.9 : 0.45) * (tech.isRadioactiveResistance ? 0.25 : 1)
|
||||||
// * (tech.isImmuneExplosion ? Math.min(1, Math.max(1 - m.energy * 0.7, 0)) : 1)
|
// * (tech.isImmuneExplosion ? Math.min(1, Math.max(1 - m.energy * 0.7, 0)) : 1)
|
||||||
if (m.immuneCycle < m.cycle) m.energy -= DRAIN
|
if (m.immuneCycle < m.cycle) m.energy -= DRAIN
|
||||||
if (m.energy < 0) {
|
if (m.energy < 0) {
|
||||||
@@ -420,7 +420,7 @@ const b = {
|
|||||||
dist = Vector.magnitude(sub);
|
dist = Vector.magnitude(sub);
|
||||||
|
|
||||||
if (dist < radius) {
|
if (dist < radius) {
|
||||||
const harm = radius * (tech.isExplosionHarm ? 0.00055 : 0.00018)
|
const harm = radius * (tech.isExplosionHarm ? 0.00036 : 0.00018)
|
||||||
if (tech.isImmuneExplosion) {
|
if (tech.isImmuneExplosion) {
|
||||||
const mitigate = Math.min(1, Math.max(1 - m.energy * 0.5, 0))
|
const mitigate = Math.min(1, Math.max(1 - m.energy * 0.5, 0))
|
||||||
if (simulation.dmgScale) m.damage(mitigate * harm);
|
if (simulation.dmgScale) m.damage(mitigate * harm);
|
||||||
@@ -489,7 +489,7 @@ const b = {
|
|||||||
if (dist < radius) {
|
if (dist < radius) {
|
||||||
if (mob[i].shield) dmg *= 2.5 //balancing explosion dmg to shields
|
if (mob[i].shield) dmg *= 2.5 //balancing explosion dmg to shields
|
||||||
if (Matter.Query.ray(map, mob[i].position, where).length > 0) dmg *= 0.5 //reduce damage if a wall is in the way
|
if (Matter.Query.ray(map, mob[i].position, where).length > 0) dmg *= 0.5 //reduce damage if a wall is in the way
|
||||||
mob[i].damage(dmg * damageScale * b.dmgScale);
|
mob[i].damage(dmg * damageScale * m.dmgScale);
|
||||||
mob[i].locatePlayer();
|
mob[i].locatePlayer();
|
||||||
knock = Vector.mult(Vector.normalise(sub), (-Math.sqrt(dmg * damageScale) * mob[i].mass) * 0.01);
|
knock = Vector.mult(Vector.normalise(sub), (-Math.sqrt(dmg * damageScale) * mob[i].mass) * 0.01);
|
||||||
mob[i].force.x += knock.x;
|
mob[i].force.x += knock.x;
|
||||||
@@ -1089,7 +1089,7 @@ const b = {
|
|||||||
//aoe damage to mobs
|
//aoe damage to mobs
|
||||||
for (let i = 0, len = mob.length; i < len; i++) {
|
for (let i = 0, len = mob.length; i < len; i++) {
|
||||||
if (Vector.magnitude(Vector.sub(mob[i].position, this.position)) < this.damageRadius + mob[i].radius) {
|
if (Vector.magnitude(Vector.sub(mob[i].position, this.position)) < this.damageRadius + mob[i].radius) {
|
||||||
let dmg = b.dmgScale * 0.11
|
let dmg = m.dmgScale * 0.11
|
||||||
if (Matter.Query.ray(map, mob[i].position, this.position).length > 0) dmg *= 0.25 //reduce damage if a wall is in the way
|
if (Matter.Query.ray(map, mob[i].position, this.position).length > 0) dmg *= 0.25 //reduce damage if a wall is in the way
|
||||||
if (mob[i].shield) dmg *= 3 //to make up for the /5 that shields normally take
|
if (mob[i].shield) dmg *= 3 //to make up for the /5 that shields normally take
|
||||||
mob[i].damage(dmg);
|
mob[i].damage(dmg);
|
||||||
@@ -1652,14 +1652,14 @@ const b = {
|
|||||||
}
|
}
|
||||||
if (Vector.magnitude(Vector.sub(this.position, mob[i].position) < this.explodeRad)) {
|
if (Vector.magnitude(Vector.sub(this.position, mob[i].position) < this.explodeRad)) {
|
||||||
this.endCycle = 0; //bullet ends cycle after doing damage //also triggers explosion
|
this.endCycle = 0; //bullet ends cycle after doing damage //also triggers explosion
|
||||||
mob[i].lockedOn.damage(b.dmgScale * 2 * size); //does extra damage to target
|
mob[i].lockedOn.damage(m.dmgScale * 2 * size); //does extra damage to target
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//explode when bullet is close enough to target
|
//explode when bullet is close enough to target
|
||||||
if (this.lockedOn && Vector.magnitude(Vector.sub(this.position, this.lockedOn.position)) < this.explodeRad) {
|
if (this.lockedOn && Vector.magnitude(Vector.sub(this.position, this.lockedOn.position)) < this.explodeRad) {
|
||||||
this.endCycle = 0; //bullet ends cycle after doing damage //also triggers explosion
|
this.endCycle = 0; //bullet ends cycle after doing damage //also triggers explosion
|
||||||
this.lockedOn.damage(b.dmgScale * 4 * size); //does extra damage to target
|
this.lockedOn.damage(m.dmgScale * 4 * size); //does extra damage to target
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
do() {
|
do() {
|
||||||
@@ -1724,7 +1724,7 @@ const b = {
|
|||||||
frictionAir: 0,
|
frictionAir: 0,
|
||||||
isInHole: true, //this keeps the bullet from entering wormholes
|
isInHole: true, //this keeps the bullet from entering wormholes
|
||||||
minDmgSpeed: 0,
|
minDmgSpeed: 0,
|
||||||
dmg: b.dmgScale * 2.5, //damage also changes when you divide by mob.mass on in .do()
|
dmg: m.dmgScale * 2.5, //damage also changes when you divide by mob.mass on in .do()
|
||||||
classType: "bullet",
|
classType: "bullet",
|
||||||
isBranch: false,
|
isBranch: false,
|
||||||
restitution: 0,
|
restitution: 0,
|
||||||
@@ -1863,7 +1863,7 @@ const b = {
|
|||||||
y: best.y
|
y: best.y
|
||||||
};
|
};
|
||||||
if (best.who.alive) {
|
if (best.who.alive) {
|
||||||
const dmg = 0.8 * b.dmgScale; //********** SCALE DAMAGE HERE *********************
|
const dmg = 0.8 * m.dmgScale; //********** SCALE DAMAGE HERE *********************
|
||||||
best.who.damage(dmg);
|
best.who.damage(dmg);
|
||||||
best.who.locatePlayer();
|
best.who.locatePlayer();
|
||||||
|
|
||||||
@@ -1927,7 +1927,7 @@ const b = {
|
|||||||
y: where.y + 3000 * Math.sin(m.angle)
|
y: where.y + 3000 * Math.sin(m.angle)
|
||||||
}, dmg = tech.laserDamage, reflections = tech.laserReflections, isThickBeam = false, push = 1) {
|
}, dmg = tech.laserDamage, reflections = tech.laserReflections, isThickBeam = false, push = 1) {
|
||||||
const reflectivity = 1 - 1 / (reflections * 1.5)
|
const reflectivity = 1 - 1 / (reflections * 1.5)
|
||||||
let damage = b.dmgScale * dmg
|
let damage = m.dmgScale * dmg
|
||||||
let best = {
|
let best = {
|
||||||
x: 1,
|
x: 1,
|
||||||
y: 1,
|
y: 1,
|
||||||
@@ -2881,7 +2881,7 @@ const b = {
|
|||||||
//aoe damage to mobs
|
//aoe damage to mobs
|
||||||
for (let i = 0, len = mob.length; i < len; i++) {
|
for (let i = 0, len = mob.length; i < len; i++) {
|
||||||
if (Vector.magnitude(Vector.sub(mob[i].position, this.position)) < this.radioRadius + mob[i].radius) {
|
if (Vector.magnitude(Vector.sub(mob[i].position, this.position)) < this.radioRadius + mob[i].radius) {
|
||||||
let dmg = (0.12 + 0.04 * tech.isFastDrones) * b.dmgScale * tech.droneRadioDamage //neutron bombs dmg = 0.09
|
let dmg = (0.12 + 0.04 * tech.isFastDrones) * m.dmgScale * tech.droneRadioDamage //neutron bombs dmg = 0.09
|
||||||
if (Matter.Query.ray(map, mob[i].position, this.position).length > 0) dmg *= 0.25 //reduce damage if a wall is in the way
|
if (Matter.Query.ray(map, mob[i].position, this.position).length > 0) dmg *= 0.25 //reduce damage if a wall is in the way
|
||||||
if (mob[i].shield) dmg *= 3 // to make up for the /5 that shields normally take
|
if (mob[i].shield) dmg *= 3 // to make up for the /5 that shields normally take
|
||||||
mob[i].damage(dmg);
|
mob[i].damage(dmg);
|
||||||
@@ -3114,12 +3114,12 @@ const b = {
|
|||||||
Matter.Body.setAngularVelocity(this.target, this.target.angularVelocity * 0.9);
|
Matter.Body.setAngularVelocity(this.target, this.target.angularVelocity * 0.9);
|
||||||
// Matter.Body.setAngularVelocity(this.target, this.target.angularVelocity * 0.9)
|
// Matter.Body.setAngularVelocity(this.target, this.target.angularVelocity * 0.9)
|
||||||
if (this.target.isShielded) {
|
if (this.target.isShielded) {
|
||||||
this.target.damage(b.dmgScale * this.damage, true); //shield damage bypass
|
this.target.damage(m.dmgScale * this.damage, true); //shield damage bypass
|
||||||
const SCALE = 1 - 0.004 / tech.isBulletsLastLonger //shrink if mob is shielded
|
const SCALE = 1 - 0.004 / tech.isBulletsLastLonger //shrink if mob is shielded
|
||||||
Matter.Body.scale(this, SCALE, SCALE);
|
Matter.Body.scale(this, SCALE, SCALE);
|
||||||
this.radius *= SCALE;
|
this.radius *= SCALE;
|
||||||
} else {
|
} else {
|
||||||
this.target.damage(b.dmgScale * this.damage);
|
this.target.damage(m.dmgScale * this.damage);
|
||||||
}
|
}
|
||||||
} else if (this.target !== null) { //look for a new target
|
} else if (this.target !== null) { //look for a new target
|
||||||
this.target = null
|
this.target = null
|
||||||
@@ -3288,7 +3288,7 @@ const b = {
|
|||||||
b.explosion(this.position, 220 * tech.nailSize + 50 * Math.random()); //makes bullet do explosive damage at end
|
b.explosion(this.position, 220 * tech.nailSize + 50 * Math.random()); //makes bullet do explosive damage at end
|
||||||
}
|
}
|
||||||
this.immuneList.push(who.id) //remember that this needle has hit this mob once already
|
this.immuneList.push(who.id) //remember that this needle has hit this mob once already
|
||||||
let dmg = this.dmg * tech.nailSize * b.dmgScale
|
let dmg = this.dmg * tech.nailSize * m.dmgScale
|
||||||
if (tech.isNailRadiation) {
|
if (tech.isNailRadiation) {
|
||||||
mobs.statusDoT(who, (tech.isFastRadiation ? 6 : 2) * tech.nailSize, tech.isSlowRadiation ? 360 : (tech.isFastRadiation ? 60 : 180)) // one tick every 30 cycles
|
mobs.statusDoT(who, (tech.isFastRadiation ? 6 : 2) * tech.nailSize, tech.isSlowRadiation ? 360 : (tech.isFastRadiation ? 60 : 180)) // one tick every 30 cycles
|
||||||
dmg *= 0.25
|
dmg *= 0.25
|
||||||
@@ -3343,7 +3343,7 @@ const b = {
|
|||||||
b.explosion(this.position, 220 * tech.nailSize + 50 * Math.random()); //makes bullet do explosive damage at end
|
b.explosion(this.position, 220 * tech.nailSize + 50 * Math.random()); //makes bullet do explosive damage at end
|
||||||
}
|
}
|
||||||
this.immuneList.push(who.id) //remember that this needle has hit this mob once already
|
this.immuneList.push(who.id) //remember that this needle has hit this mob once already
|
||||||
let dmg = this.dmg * tech.nailSize * b.dmgScale
|
let dmg = this.dmg * tech.nailSize * m.dmgScale
|
||||||
if (tech.isNailRadiation) {
|
if (tech.isNailRadiation) {
|
||||||
mobs.statusDoT(who, (tech.isFastRadiation ? 6 : 2) * tech.nailSize, tech.isSlowRadiation ? 360 : (tech.isFastRadiation ? 60 : 180)) // one tick every 30 cycles
|
mobs.statusDoT(who, (tech.isFastRadiation ? 6 : 2) * tech.nailSize, tech.isSlowRadiation ? 360 : (tech.isFastRadiation ? 60 : 180)) // one tick every 30 cycles
|
||||||
dmg *= 0.25
|
dmg *= 0.25
|
||||||
@@ -3622,8 +3622,8 @@ const b = {
|
|||||||
if (!q[i].isShielded) {
|
if (!q[i].isShielded) {
|
||||||
Matter.Body.setAngularVelocity(this, this.spin)
|
Matter.Body.setAngularVelocity(this, this.spin)
|
||||||
// mobs.statusStun(q[i], 180)
|
// mobs.statusStun(q[i], 180)
|
||||||
// const dmg = 0.5 * b.dmgScale * (this.isUpgraded ? 2.5 : 1)
|
// const dmg = 0.5 * m.dmgScale * (this.isUpgraded ? 2.5 : 1)
|
||||||
const dmg = 0.5 * b.dmgScale
|
const dmg = 0.5 * m.dmgScale
|
||||||
q[i].damage(dmg);
|
q[i].damage(dmg);
|
||||||
if (q[i].alive) q[i].foundPlayer();
|
if (q[i].alive) q[i].foundPlayer();
|
||||||
if (q[i].damageReduction) {
|
if (q[i].damageReduction) {
|
||||||
@@ -3914,7 +3914,7 @@ const b = {
|
|||||||
//hit target with laser
|
//hit target with laser
|
||||||
if (this.lockedOn && this.lockedOn.alive && m.energy > this.drainThreshold) {
|
if (this.lockedOn && this.lockedOn.alive && m.energy > this.drainThreshold) {
|
||||||
m.energy -= this.drain
|
m.energy -= this.drain
|
||||||
b.laser(this.vertices[0], this.lockedOn.position, b.dmgScale * this.laserDamage * tech.laserDamage, tech.laserReflections, false, 0.4) //tech.laserDamage = 0.16
|
b.laser(this.vertices[0], this.lockedOn.position, m.dmgScale * this.laserDamage * tech.laserDamage, tech.laserReflections, false, 0.4) //tech.laserDamage = 0.16
|
||||||
// laser(where = {
|
// laser(where = {
|
||||||
// x: m.pos.x + 20 * Math.cos(m.angle),
|
// x: m.pos.x + 20 * Math.cos(m.angle),
|
||||||
// y: m.pos.y + 20 * Math.sin(m.angle)
|
// y: m.pos.y + 20 * Math.sin(m.angle)
|
||||||
@@ -3949,7 +3949,7 @@ const b = {
|
|||||||
// if (input.fire && m.energy > this.drain) {
|
// if (input.fire && m.energy > this.drain) {
|
||||||
// m.energy -= this.drain
|
// m.energy -= this.drain
|
||||||
// const unit = Vector.sub(simulation.mouseInGame, this.vertices[0])
|
// const unit = Vector.sub(simulation.mouseInGame, this.vertices[0])
|
||||||
// b.laser(this.vertices[0], Vector.mult(unit, 1000), b.dmgScale * this.laserDamage * tech.laserDamage, tech.laserReflections, false, 0.4) //tech.laserDamage = 0.16
|
// b.laser(this.vertices[0], Vector.mult(unit, 1000), m.dmgScale * this.laserDamage * tech.laserDamage, tech.laserReflections, false, 0.4) //tech.laserDamage = 0.16
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
@@ -4170,7 +4170,7 @@ const b = {
|
|||||||
y: best.y
|
y: best.y
|
||||||
};
|
};
|
||||||
if (best.who.alive) {
|
if (best.who.alive) {
|
||||||
const dmg = 0.6 * b.dmgScale; //********** SCALE DAMAGE HERE *********************
|
const dmg = 0.6 * m.dmgScale; //********** SCALE DAMAGE HERE *********************
|
||||||
best.who.damage(dmg);
|
best.who.damage(dmg);
|
||||||
best.who.locatePlayer();
|
best.who.locatePlayer();
|
||||||
//push mobs away
|
//push mobs away
|
||||||
@@ -4277,7 +4277,7 @@ const b = {
|
|||||||
for (let i = 0; i < q.length; i++) {
|
for (let i = 0; i < q.length; i++) {
|
||||||
if (!q[i].isShielded) {
|
if (!q[i].isShielded) {
|
||||||
mobs.statusStun(q[i], 180)
|
mobs.statusStun(q[i], 180)
|
||||||
const dmg = 0.4 * b.dmgScale * (this.isUpgraded ? 4 : 1) * (tech.isCrit ? 4 : 1)
|
const dmg = 0.4 * m.dmgScale * (this.isUpgraded ? 4 : 1) * (tech.isCrit ? 4 : 1)
|
||||||
q[i].damage(dmg);
|
q[i].damage(dmg);
|
||||||
if (q[i].alive) q[i].foundPlayer();
|
if (q[i].alive) q[i].foundPlayer();
|
||||||
if (q[i].damageReduction) {
|
if (q[i].damageReduction) {
|
||||||
@@ -4958,7 +4958,7 @@ const b = {
|
|||||||
ctx.lineWidth = 2 * tech.wavePacketDamage
|
ctx.lineWidth = 2 * tech.wavePacketDamage
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
const end = 700 * Math.sqrt(tech.isBulletsLastLonger) / Math.sqrt(tech.waveReflections * 0.5) //should equal about 1060
|
const end = 700 * Math.sqrt(tech.isBulletsLastLonger) / Math.sqrt(tech.waveReflections * 0.5) //should equal about 1060
|
||||||
const damage = 2 * b.dmgScale * tech.wavePacketDamage * tech.waveBeamDamage * (tech.isBulletTeleport ? 1.43 : 1) //damage is lower for large radius mobs, since they feel the waves longer
|
const damage = 2 * m.dmgScale * tech.wavePacketDamage * tech.waveBeamDamage * (tech.isBulletTeleport ? 1.43 : 1) //damage is lower for large radius mobs, since they feel the waves longer
|
||||||
|
|
||||||
for (let i = this.waves.length - 1; i > -1; i--) {
|
for (let i = this.waves.length - 1; i > -1; i--) {
|
||||||
//draw wave
|
//draw wave
|
||||||
@@ -5042,7 +5042,7 @@ const b = {
|
|||||||
ctx.lineWidth = 2 * tech.wavePacketDamage
|
ctx.lineWidth = 2 * tech.wavePacketDamage
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
const end = 1100 * tech.isBulletsLastLonger / Math.sqrt(tech.waveReflections * 0.5) //should equal about 1767
|
const end = 1100 * tech.isBulletsLastLonger / Math.sqrt(tech.waveReflections * 0.5) //should equal about 1767
|
||||||
const damage = 2 * b.dmgScale * tech.wavePacketDamage * tech.waveBeamDamage * (tech.isBulletTeleport ? 1.43 : 1) //damage is lower for large radius mobs, since they feel the waves longer
|
const damage = 2 * m.dmgScale * tech.wavePacketDamage * tech.waveBeamDamage * (tech.isBulletTeleport ? 1.43 : 1) //damage is lower for large radius mobs, since they feel the waves longer
|
||||||
|
|
||||||
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))
|
||||||
@@ -5155,7 +5155,7 @@ const b = {
|
|||||||
slow: 0,
|
slow: 0,
|
||||||
amplitude: (input.down ? 5 : 10) * ((this.wavePacketCycle % 2) ? -1 : 1) * Math.sin((this.wavePacketCycle + 1) * 0.088), //0.0968 //0.1012 //0.11 //0.088 //shorten wave packet
|
amplitude: (input.down ? 5 : 10) * ((this.wavePacketCycle % 2) ? -1 : 1) * Math.sin((this.wavePacketCycle + 1) * 0.088), //0.0968 //0.1012 //0.11 //0.088 //shorten wave packet
|
||||||
minDmgSpeed: 0,
|
minDmgSpeed: 0,
|
||||||
dmg: b.dmgScale * tech.waveBeamDamage * tech.wavePacketDamage * (tech.isBulletTeleport ? 1.43 : 1), //also control damage when you divide by mob.mass
|
dmg: m.dmgScale * tech.waveBeamDamage * tech.wavePacketDamage * (tech.isBulletTeleport ? 1.43 : 1), //also control damage when you divide by mob.mass
|
||||||
classType: "bullet",
|
classType: "bullet",
|
||||||
collisionFilter: {
|
collisionFilter: {
|
||||||
category: 0,
|
category: 0,
|
||||||
@@ -6161,7 +6161,7 @@ const b = {
|
|||||||
// mob[i].force.x += mag * this.velocity.x;
|
// mob[i].force.x += mag * this.velocity.x;
|
||||||
// mob[i].force.y += mag * this.velocity.y;
|
// mob[i].force.y += mag * this.velocity.y;
|
||||||
// //damage mob
|
// //damage mob
|
||||||
// const damage = b.dmgScale * 0.002 * dist
|
// const damage = m.dmgScale * 0.002 * dist
|
||||||
// mob[i].damage(damage);
|
// mob[i].damage(damage);
|
||||||
// mob[i].locatePlayer();
|
// mob[i].locatePlayer();
|
||||||
// simulation.drawList.push({ //add dmg to draw queue
|
// simulation.drawList.push({ //add dmg to draw queue
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ function collisionChecks(event) {
|
|||||||
//mob + bullet collisions
|
//mob + bullet collisions
|
||||||
if (obj.classType === "bullet" && obj.speed > obj.minDmgSpeed) {
|
if (obj.classType === "bullet" && obj.speed > obj.minDmgSpeed) {
|
||||||
obj.beforeDmg(mob[k]); //some bullets do actions when they hits things, like despawn //forces don't seem to work here
|
obj.beforeDmg(mob[k]); //some bullets do actions when they hits things, like despawn //forces don't seem to work here
|
||||||
let dmg = b.dmgScale * (obj.dmg + 0.15 * obj.mass * Vector.magnitude(Vector.sub(mob[k].velocity, obj.velocity)))
|
let dmg = m.dmgScale * (obj.dmg + 0.15 * obj.mass * Vector.magnitude(Vector.sub(mob[k].velocity, obj.velocity)))
|
||||||
if (tech.isCrit && mob[k].isStunned) dmg *= 4
|
if (tech.isCrit && mob[k].isStunned) dmg *= 4
|
||||||
// console.log(dmg)
|
// console.log(dmg)
|
||||||
mob[k].damage(dmg);
|
mob[k].damage(dmg);
|
||||||
@@ -195,7 +195,7 @@ function collisionChecks(event) {
|
|||||||
if (obj.classType === "body" && obj.speed > 6) {
|
if (obj.classType === "body" && obj.speed > 6) {
|
||||||
const v = Vector.magnitude(Vector.sub(mob[k].velocity, obj.velocity));
|
const v = Vector.magnitude(Vector.sub(mob[k].velocity, obj.velocity));
|
||||||
if (v > 9) {
|
if (v > 9) {
|
||||||
let dmg = tech.blockDamage * b.dmgScale * v * obj.mass * (tech.isMobBlockFling ? 2.5 : 1) * (tech.isBlockRestitution ? 2.5 : 1);
|
let dmg = tech.blockDamage * m.dmgScale * v * obj.mass * (tech.isMobBlockFling ? 2.5 : 1) * (tech.isBlockRestitution ? 2.5 : 1);
|
||||||
if (mob[k].isShielded) dmg *= 0.7
|
if (mob[k].isShielded) dmg *= 0.7
|
||||||
// console.log(dmg)
|
// console.log(dmg)
|
||||||
mob[k].damage(dmg, true);
|
mob[k].damage(dmg, true);
|
||||||
|
|||||||
@@ -254,7 +254,7 @@ ${botText}
|
|||||||
<br>level: ${level.levels[level.onLevel]} (${level.difficultyText()}) ${m.cycle} cycles
|
<br>level: ${level.levels[level.onLevel]} (${level.difficultyText()}) ${m.cycle} cycles
|
||||||
<br>${mob.length} mobs, ${body.length} blocks, ${bullet.length} bullets, ${powerUp.length} power ups
|
<br>${mob.length} mobs, ${body.length} blocks, ${bullet.length} bullets, ${powerUp.length} power ups
|
||||||
|
|
||||||
<br>damage difficulty scale: ${(b.dmgScale*100).toFixed(2) }%
|
<br>damage difficulty scale: ${(m.dmgScale*100).toFixed(2) }%
|
||||||
<br>harm difficulty scale: ${(simulation.dmgScale*100).toFixed(0)}%
|
<br>harm difficulty scale: ${(simulation.dmgScale*100).toFixed(0)}%
|
||||||
<br>heal difficulty scale: ${(simulation.healScale*100).toFixed(1)}%
|
<br>heal difficulty scale: ${(simulation.healScale*100).toFixed(1)}%
|
||||||
${simulation.isCheating ? "<br><br><em>lore disabled</em>": ""}
|
${simulation.isCheating ? "<br><br><em>lore disabled</em>": ""}
|
||||||
@@ -273,14 +273,14 @@ ${simulation.isCheating ? "<br><br><em>lore disabled</em>": ""}
|
|||||||
if (tech.tech[i].count > 0 && !tech.tech[i].isNonRefundable) {
|
if (tech.tech[i].count > 0 && !tech.tech[i].isNonRefundable) {
|
||||||
const techCountText = tech.tech[i].count > 1 ? `(${tech.tech[i].count}x)` : "";
|
const techCountText = tech.tech[i].count > 1 ? `(${tech.tech[i].count}x)` : "";
|
||||||
if (tech.tech[i].isFieldTech) {
|
if (tech.tech[i].isFieldTech) {
|
||||||
text += `<div class="pause-grid-module"><div class="grid-title">
|
text += `<div class="pause-grid-module" id ="${i}-pause-tech" onclick="powerUps.pauseEjectTech(${i})"><div class="grid-title">
|
||||||
<span style="position:relative;">
|
<span style="position:relative;">
|
||||||
<div class="circle-grid tech" style="position:absolute; top:0; left:0;opacity:0.8;"></div>
|
<div class="circle-grid tech" style="position:absolute; top:0; left:0;opacity:0.8;"></div>
|
||||||
<div class="circle-grid field" style="position:absolute; top:0; left:10px;opacity:0.65;"></div>
|
<div class="circle-grid field" style="position:absolute; top:0; left:10px;opacity:0.65;"></div>
|
||||||
</span>
|
</span>
|
||||||
${tech.tech[i].link} ${techCountText}</div>${tech.tech[i].descriptionFunction ? tech.tech[i].descriptionFunction() :tech.tech[i].description}</div></div>`
|
${tech.tech[i].link} ${techCountText}</div>${tech.tech[i].descriptionFunction ? tech.tech[i].descriptionFunction() :tech.tech[i].description}</div></div>`
|
||||||
} else if (tech.tech[i].isGunTech) {
|
} else if (tech.tech[i].isGunTech) {
|
||||||
text += `<div class="pause-grid-module"><div class="grid-title">
|
text += `<div class="pause-grid-module" id ="${i}-pause-tech" onclick="powerUps.pauseEjectTech(${i})"><div class="grid-title">
|
||||||
<span style="position:relative;">
|
<span style="position:relative;">
|
||||||
<div class="circle-grid tech" style="position:absolute; top:0; left:0;opacity:0.8;"></div>
|
<div class="circle-grid tech" style="position:absolute; top:0; left:0;opacity:0.8;"></div>
|
||||||
<div class="circle-grid gun" style="position:absolute; top:0; left:10px; opacity:0.65;"></div>
|
<div class="circle-grid gun" style="position:absolute; top:0; left:10px; opacity:0.65;"></div>
|
||||||
@@ -289,7 +289,7 @@ ${simulation.isCheating ? "<br><br><em>lore disabled</em>": ""}
|
|||||||
} else if (tech.tech[i].isLore) {
|
} else if (tech.tech[i].isLore) {
|
||||||
text += `<div class="pause-grid-module"><div class="grid-title lore-text"><div class="circle-grid lore"></div> ${tech.tech[i].name} ${techCountText}</div>${tech.tech[i].descriptionFunction ? tech.tech[i].descriptionFunction() :tech.tech[i].description}</div></div>`
|
text += `<div class="pause-grid-module"><div class="grid-title lore-text"><div class="circle-grid lore"></div> ${tech.tech[i].name} ${techCountText}</div>${tech.tech[i].descriptionFunction ? tech.tech[i].descriptionFunction() :tech.tech[i].description}</div></div>`
|
||||||
} else {
|
} else {
|
||||||
text += `<div class="pause-grid-module"><div class="grid-title"><div class="circle-grid tech"></div> ${tech.tech[i].link} ${techCountText}</div>${tech.tech[i].descriptionFunction ? tech.tech[i].descriptionFunction() :tech.tech[i].description}</div></div>`
|
text += `<div class="pause-grid-module" id ="${i}-pause-tech" onclick="powerUps.pauseEjectTech(${i})"><div class="grid-title"><div class="circle-grid tech"></div> ${tech.tech[i].link} ${techCountText}</div>${tech.tech[i].descriptionFunction ? tech.tech[i].descriptionFunction() :tech.tech[i].description}</div></div>`
|
||||||
}
|
}
|
||||||
} else if (tech.tech[i].isLost) {
|
} else if (tech.tech[i].isLost) {
|
||||||
text += `<div class="pause-grid-module" style="text-decoration: line-through;"><div class="grid-title">${tech.tech[i].link}</div>${tech.tech[i].descriptionFunction ? tech.tech[i].descriptionFunction() :tech.tech[i].description}</div></div>`
|
text += `<div class="pause-grid-module" style="text-decoration: line-through;"><div class="grid-title">${tech.tech[i].link}</div>${tech.tech[i].descriptionFunction ? tech.tech[i].descriptionFunction() :tech.tech[i].description}</div></div>`
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ const level = {
|
|||||||
// m.setField("standing wave")
|
// m.setField("standing wave")
|
||||||
// b.giveGuns("laser")
|
// b.giveGuns("laser")
|
||||||
// for (let i = 0; i < 100; i++) tech.giveTech("slow light")
|
// for (let i = 0; i < 100; i++) tech.giveTech("slow light")
|
||||||
// tech.giveTech("expansion")
|
// tech.giveTech("eject")
|
||||||
// for (let i = 0; i < 2; i++) powerUps.directSpawn(0, 0, "tech");
|
// for (let i = 0; i < 2; i++) powerUps.directSpawn(0, 0, "tech");
|
||||||
// tech.giveTech("tinsellated flagella")
|
// tech.giveTech("tinsellated flagella")
|
||||||
// for (let i = 0; i < 3; i++) tech.giveTech("undefined")
|
// for (let i = 0; i < 3; i++) tech.giveTech("undefined")
|
||||||
@@ -125,7 +125,7 @@ const level = {
|
|||||||
customTopLayer() {},
|
customTopLayer() {},
|
||||||
setDifficulty() {
|
setDifficulty() {
|
||||||
simulation.difficulty = 0
|
simulation.difficulty = 0
|
||||||
b.dmgScale = 1; //damage done by player decreases each level
|
m.dmgScale = 1; //damage done by player decreases each level
|
||||||
simulation.accelScale = 1 //mob acceleration increases each level
|
simulation.accelScale = 1 //mob acceleration increases each level
|
||||||
simulation.CDScale = 1 //mob CD time decreases each level
|
simulation.CDScale = 1 //mob CD time decreases each level
|
||||||
simulation.dmgScale = 0.375 * simulation.difficulty //damage done by mobs increases each level
|
simulation.dmgScale = 0.375 * simulation.difficulty //damage done by mobs increases each level
|
||||||
@@ -134,7 +134,7 @@ 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
|
m.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.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
|
if (simulation.CDScale > 0.15) simulation.CDScale *= 0.965 //mob CD time decreases each level
|
||||||
}
|
}
|
||||||
@@ -145,7 +145,7 @@ const level = {
|
|||||||
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
|
m.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.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.CDScale < 1) simulation.CDScale /= 0.965 //mob CD time decreases each level
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ const mobs = {
|
|||||||
who.status.push({
|
who.status.push({
|
||||||
effect() {
|
effect() {
|
||||||
if ((simulation.cycle - this.startCycle) % 30 === 0) {
|
if ((simulation.cycle - this.startCycle) % 30 === 0) {
|
||||||
let dmg = b.dmgScale * this.dmg
|
let dmg = m.dmgScale * this.dmg
|
||||||
who.damage(dmg);
|
who.damage(dmg);
|
||||||
if (who.damageReduction) {
|
if (who.damageReduction) {
|
||||||
simulation.drawList.push({ //add dmg to draw queue
|
simulation.drawList.push({ //add dmg to draw queue
|
||||||
@@ -188,7 +188,7 @@ const mobs = {
|
|||||||
// who.status.push({
|
// who.status.push({
|
||||||
// effect() {
|
// effect() {
|
||||||
// if ((simulation.cycle - this.startCycle) % 15 === 0) {
|
// if ((simulation.cycle - this.startCycle) % 15 === 0) {
|
||||||
// let dmg = b.dmgScale * tickDamage * 0.5 * (1 + Math.random())
|
// let dmg = m.dmgScale * tickDamage * 0.5 * (1 + Math.random())
|
||||||
// who.damage(dmg);
|
// who.damage(dmg);
|
||||||
// simulation.drawList.push({ //add dmg to draw queue
|
// simulation.drawList.push({ //add dmg to draw queue
|
||||||
// x: who.position.x,
|
// x: who.position.x,
|
||||||
|
|||||||
13
js/player.js
13
js/player.js
@@ -393,6 +393,7 @@ const m = {
|
|||||||
m.drop();
|
m.drop();
|
||||||
if (simulation.paused) build.pauseGrid() //update the build when paused
|
if (simulation.paused) build.pauseGrid() //update the build when paused
|
||||||
},
|
},
|
||||||
|
dmgScale: null, //scales all damage, but not raw .dmg //set in levels.setDifficulty
|
||||||
death() {
|
death() {
|
||||||
if (tech.isImmortal) { //if player has the immortality buff, spawn on the same level with randomized damage
|
if (tech.isImmortal) { //if player has the immortality buff, spawn on the same level with randomized damage
|
||||||
//remove immortality tech
|
//remove immortality tech
|
||||||
@@ -922,7 +923,7 @@ const m = {
|
|||||||
if (removed) powerUps.directSpawn(m.pos.x, m.pos.y, "tech");
|
if (removed) powerUps.directSpawn(m.pos.x, m.pos.y, "tech");
|
||||||
}
|
}
|
||||||
if (m.energy < m.maxEnergy) m.energy = m.maxEnergy;
|
if (m.energy < m.maxEnergy) m.energy = m.maxEnergy;
|
||||||
m.fieldRegen = tech.energyRegen; //0.001
|
m.fieldRegen = 0.001
|
||||||
m.fieldMeterColor = "#0cf"
|
m.fieldMeterColor = "#0cf"
|
||||||
m.eyeFillColor = m.fieldMeterColor
|
m.eyeFillColor = m.fieldMeterColor
|
||||||
m.fieldShieldingScale = 1;
|
m.fieldShieldingScale = 1;
|
||||||
@@ -1321,7 +1322,7 @@ const m = {
|
|||||||
}
|
}
|
||||||
const unit = Vector.normalise(Vector.sub(player.position, who.position))
|
const unit = Vector.normalise(Vector.sub(player.position, who.position))
|
||||||
if (tech.blockDmg) {
|
if (tech.blockDmg) {
|
||||||
who.damage(tech.blockDmg * b.dmgScale, true)
|
who.damage(tech.blockDmg * m.dmgScale, true)
|
||||||
//draw electricity
|
//draw electricity
|
||||||
const step = 40
|
const step = 40
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
@@ -1646,7 +1647,7 @@ const m = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (tech.blockDmg) { //electricity
|
if (tech.blockDmg) { //electricity
|
||||||
mob[i].damage(tech.blockDmg * b.dmgScale)
|
mob[i].damage(tech.blockDmg * m.dmgScale)
|
||||||
const step = 40
|
const step = 40
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
for (let i = 0, len = 1.5 * tech.blockDmg; i < len; i++) {
|
for (let i = 0, len = 1.5 * tech.blockDmg; i < len; i++) {
|
||||||
@@ -2598,7 +2599,7 @@ const m = {
|
|||||||
// ctx.fillStyle = `rgba(140,217,255,0.5)`
|
// ctx.fillStyle = `rgba(140,217,255,0.5)`
|
||||||
// ctx.fill()
|
// ctx.fill()
|
||||||
// } else if (tech.superposition && inPlayer[i].isDropPowerUp) {
|
// } else if (tech.superposition && inPlayer[i].isDropPowerUp) {
|
||||||
// // inPlayer[i].damage(0.4 * b.dmgScale); //damage mobs inside the player
|
// // inPlayer[i].damage(0.4 * m.dmgScale); //damage mobs inside the player
|
||||||
// // m.energy += 0.005;
|
// // m.energy += 0.005;
|
||||||
|
|
||||||
// mobs.statusStun(inPlayer[i], 300)
|
// mobs.statusStun(inPlayer[i], 300)
|
||||||
@@ -3656,7 +3657,7 @@ const m = {
|
|||||||
//mob + bullet collisions
|
//mob + bullet collisions
|
||||||
if (obj.classType === "bullet" && obj.speed > obj.minDmgSpeed) {
|
if (obj.classType === "bullet" && obj.speed > obj.minDmgSpeed) {
|
||||||
obj.beforeDmg(mob[k]); //some bullets do actions when they hits things, like despawn //forces don't seem to work here
|
obj.beforeDmg(mob[k]); //some bullets do actions when they hits things, like despawn //forces don't seem to work here
|
||||||
let dmg = b.dmgScale * (obj.dmg + 0.15 * obj.mass * Vector.magnitude(Vector.sub(mob[k].velocity, obj.velocity)))
|
let dmg = m.dmgScale * (obj.dmg + 0.15 * obj.mass * Vector.magnitude(Vector.sub(mob[k].velocity, obj.velocity)))
|
||||||
if (tech.isCrit && mob[k].isStunned) dmg *= 4
|
if (tech.isCrit && mob[k].isStunned) dmg *= 4
|
||||||
mob[k].damage(dmg);
|
mob[k].damage(dmg);
|
||||||
if (mob[k].alive) mob[k].foundPlayer();
|
if (mob[k].alive) mob[k].foundPlayer();
|
||||||
@@ -3675,7 +3676,7 @@ const m = {
|
|||||||
if (obj.classType === "body" && obj.speed > 6) {
|
if (obj.classType === "body" && obj.speed > 6) {
|
||||||
const v = Vector.magnitude(Vector.sub(mob[k].velocity, obj.velocity));
|
const v = Vector.magnitude(Vector.sub(mob[k].velocity, obj.velocity));
|
||||||
if (v > 9) {
|
if (v > 9) {
|
||||||
let dmg = tech.blockDamage * b.dmgScale * v * obj.mass * (tech.isMobBlockFling ? 2 : 1);
|
let dmg = tech.blockDamage * m.dmgScale * v * obj.mass * (tech.isMobBlockFling ? 2 : 1);
|
||||||
if (mob[k].isShielded) dmg *= 0.7
|
if (mob[k].isShielded) dmg *= 0.7
|
||||||
mob[k].damage(dmg, true);
|
mob[k].damage(dmg, true);
|
||||||
if (tech.isBlockPowerUps && !mob[k].alive && mob[k].isDropPowerUp && m.throwCycle > m.cycle) {
|
if (tech.isBlockPowerUps && !mob[k].alive && mob[k].isDropPowerUp && m.throwCycle > m.cycle) {
|
||||||
|
|||||||
@@ -1037,6 +1037,18 @@ const powerUps = {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
pauseEjectTech(index) {
|
||||||
|
if (tech.isPauseEjectTech || simulation.testing) {
|
||||||
|
if (Math.random() < 0.03) {
|
||||||
|
tech.removeTech(index)
|
||||||
|
m.energy += 20.48;
|
||||||
|
} else {
|
||||||
|
powerUps.ejectTech(index)
|
||||||
|
}
|
||||||
|
document.getElementById(`${index}-pause-tech`).style.textDecoration = "line-through"
|
||||||
|
document.getElementById(`${index}-pause-tech`).onclick = null
|
||||||
|
}
|
||||||
|
},
|
||||||
// removeRandomTech() {
|
// removeRandomTech() {
|
||||||
// const have = [] //find which tech you have
|
// const have = [] //find which tech you have
|
||||||
// for (let i = 0; i < tech.tech.length; i++) {
|
// for (let i = 0; i < tech.tech.length; i++) {
|
||||||
|
|||||||
52
js/spawn.js
52
js/spawn.js
@@ -231,7 +231,7 @@ const spawn = {
|
|||||||
//aoe damage to mobs
|
//aoe damage to mobs
|
||||||
// for (let i = 0, len = mob.length; i < len; i++) {
|
// for (let i = 0, len = mob.length; i < len; i++) {
|
||||||
// if (!mob[i].isShielded && Vector.magnitude(Vector.sub(mob[i].position, this.position)) < this.radius) {
|
// if (!mob[i].isShielded && Vector.magnitude(Vector.sub(mob[i].position, this.position)) < this.radius) {
|
||||||
// let dmg = b.dmgScale * 0.082
|
// let dmg = m.dmgScale * 0.082
|
||||||
// if (Matter.Query.ray(map, mob[i].position, this.position).length > 0) dmg *= 0.25 //reduce damage if a wall is in the way
|
// if (Matter.Query.ray(map, mob[i].position, this.position).length > 0) dmg *= 0.25 //reduce damage if a wall is in the way
|
||||||
// if (mob[i].shield) dmg *= 4 //x5 to make up for the /5 that shields normally take
|
// if (mob[i].shield) dmg *= 4 //x5 to make up for the /5 that shields normally take
|
||||||
// mob[i].damage(dmg);
|
// mob[i].damage(dmg);
|
||||||
@@ -1120,10 +1120,10 @@ const spawn = {
|
|||||||
Matter.Body.scale(this, scale, scale);
|
Matter.Body.scale(this, scale, scale);
|
||||||
this.radius *= scale;
|
this.radius *= scale;
|
||||||
|
|
||||||
this.isInvulnerable = true
|
// this.isInvulnerable = true
|
||||||
if (this.damageReduction) this.startingDamageReduction = this.damageReduction
|
// if (this.damageReduction) this.startingDamageReduction = this.damageReduction
|
||||||
this.damageReduction = 0
|
// this.damageReduction = 0
|
||||||
this.invulnerabilityCountDown = simulation.difficulty
|
// this.invulnerabilityCountDown = simulation.difficulty
|
||||||
}
|
}
|
||||||
me.onDeath = function() {
|
me.onDeath = function() {
|
||||||
this.isBuffBoss = false;
|
this.isBuffBoss = false;
|
||||||
@@ -1142,27 +1142,27 @@ const spawn = {
|
|||||||
powerUps.spawnRandomPowerUp(this.position.x, this.position.y) // manual power up spawn to avoid spawning too many tech with "symbiosis"
|
powerUps.spawnRandomPowerUp(this.position.x, this.position.y) // manual power up spawn to avoid spawning too many tech with "symbiosis"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
me.damageReduction = 0.23 / (tech.isScaleMobsWithDuplication ? 1 + tech.duplicationChance() : 1)
|
me.damageReduction = 0.2 / (tech.isScaleMobsWithDuplication ? 1 + tech.duplicationChance() : 1)
|
||||||
//required setup for invulnerable
|
//required setup for invulnerable
|
||||||
me.isInvulnerable = false
|
// me.isInvulnerable = false
|
||||||
me.invulnerabilityCountDown = 0
|
me.invulnerabilityCountDown = 0
|
||||||
me.do = function() {
|
me.do = function() {
|
||||||
if (this.isInvulnerable) {
|
// if (this.isInvulnerable) {
|
||||||
if (this.invulnerabilityCountDown > 0) {
|
// if (this.invulnerabilityCountDown > 0) {
|
||||||
this.invulnerabilityCountDown--
|
// this.invulnerabilityCountDown--
|
||||||
ctx.beginPath();
|
// ctx.beginPath();
|
||||||
let vertices = this.vertices;
|
// let vertices = this.vertices;
|
||||||
ctx.moveTo(vertices[0].x, vertices[0].y);
|
// ctx.moveTo(vertices[0].x, vertices[0].y);
|
||||||
for (let j = 1; j < vertices.length; j++) ctx.lineTo(vertices[j].x, vertices[j].y);
|
// for (let j = 1; j < vertices.length; j++) ctx.lineTo(vertices[j].x, vertices[j].y);
|
||||||
ctx.lineTo(vertices[0].x, vertices[0].y);
|
// ctx.lineTo(vertices[0].x, vertices[0].y);
|
||||||
ctx.lineWidth = 20;
|
// ctx.lineWidth = 20;
|
||||||
ctx.strokeStyle = "rgba(255,255,255,0.7)";
|
// ctx.strokeStyle = "rgba(255,255,255,0.7)";
|
||||||
ctx.stroke();
|
// ctx.stroke();
|
||||||
} else {
|
// } else {
|
||||||
this.isInvulnerable = false
|
// this.isInvulnerable = false
|
||||||
this.damageReduction = this.startingDamageReduction
|
// this.damageReduction = this.startingDamageReduction
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
this.alwaysSeePlayer();
|
this.alwaysSeePlayer();
|
||||||
this.checkStatus();
|
this.checkStatus();
|
||||||
this.attraction();
|
this.attraction();
|
||||||
@@ -3583,7 +3583,7 @@ const spawn = {
|
|||||||
if (this.mass > 10) Matter.Body.scale(this, 0.99, 0.99);
|
if (this.mass > 10) Matter.Body.scale(this, 0.99, 0.99);
|
||||||
|
|
||||||
// for (let i = 0; i < 1; i++) {
|
// for (let i = 0; i < 1; i++) {
|
||||||
const velocity = Vector.rotate(Vector.mult(Vector.normalise(this.velocity), -10 - 10 * Math.random()), 1 * (Math.random() - 0.5))
|
const velocity = Vector.rotate(Vector.mult(Vector.normalise(this.velocity), -5 - 10 * Math.random()), 0.5 * (Math.random() - 0.5))
|
||||||
spawn.bounceBullet(this.position.x, this.position.y, velocity)
|
spawn.bounceBullet(this.position.x, this.position.y, velocity)
|
||||||
// }
|
// }
|
||||||
//draw invulnerable
|
//draw invulnerable
|
||||||
@@ -3609,7 +3609,7 @@ const spawn = {
|
|||||||
// }
|
// }
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
bounceBullet(x, y, velocity = { x: 0, y: 0 }, radius = 10, sides = 6) {
|
bounceBullet(x, y, velocity = { x: 0, y: 0 }, radius = 11, sides = 6) {
|
||||||
//bullets
|
//bullets
|
||||||
mobs.spawn(x, y, sides, radius, "rgb(255,0,155)");
|
mobs.spawn(x, y, sides, radius, "rgb(255,0,155)");
|
||||||
let me = mob[mob.length - 1];
|
let me = mob[mob.length - 1];
|
||||||
@@ -3630,7 +3630,7 @@ const spawn = {
|
|||||||
me.isMobBullet = true;
|
me.isMobBullet = true;
|
||||||
me.showHealthBar = false;
|
me.showHealthBar = false;
|
||||||
me.onHit = function() {
|
me.onHit = function() {
|
||||||
this.explode(this.mass * 20);
|
this.explode(this.mass * 12);
|
||||||
};
|
};
|
||||||
me.do = function() {
|
me.do = function() {
|
||||||
this.timeLimit();
|
this.timeLimit();
|
||||||
|
|||||||
108
js/tech.js
108
js/tech.js
@@ -228,7 +228,7 @@ const tech = {
|
|||||||
if (tech.isEnergyLoss) dmg *= 1.55;
|
if (tech.isEnergyLoss) dmg *= 1.55;
|
||||||
if (tech.isAcidDmg && m.health > 1) dmg *= 1.35;
|
if (tech.isAcidDmg && m.health > 1) dmg *= 1.35;
|
||||||
if (tech.restDamage > 1 && player.speed < 1) dmg *= tech.restDamage
|
if (tech.restDamage > 1 && player.speed < 1) dmg *= tech.restDamage
|
||||||
if (tech.isEnergyDamage) dmg *= 1 + m.energy * 0.11;
|
if (tech.isEnergyDamage) dmg *= 1 + m.energy * 0.125;
|
||||||
if (tech.isDamageFromBulletCount) dmg *= 1 + bullet.length * 0.007
|
if (tech.isDamageFromBulletCount) dmg *= 1 + bullet.length * 0.007
|
||||||
if (tech.isRerollDamage) dmg *= 1 + 0.037 * powerUps.research.count
|
if (tech.isRerollDamage) dmg *= 1 + 0.037 * powerUps.research.count
|
||||||
if (tech.isOneGun && b.inventory.length < 2) dmg *= 1.25
|
if (tech.isOneGun && b.inventory.length < 2) dmg *= 1.25
|
||||||
@@ -2099,26 +2099,6 @@ const tech = {
|
|||||||
tech.isPiezo = false;
|
tech.isPiezo = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: "ground state",
|
|
||||||
description: "reduce <strong class='color-harm'>harm</strong> by <strong>66%</strong><br>you <strong>no longer</strong> passively regenerate <strong class='color-f'>energy</strong>",
|
|
||||||
maxCount: 1,
|
|
||||||
count: 0,
|
|
||||||
frequency: 1,
|
|
||||||
frequencyDefault: 1,
|
|
||||||
allowed() {
|
|
||||||
return !tech.isCrouchRegen //(tech.iceEnergy || tech.isWormholeEnergy || tech.isPiezo || tech.isRailEnergyGain || tech.energySiphon || tech.isEnergyRecovery || tech.dynamoBotCount || tech.isFlipFlopEnergy || tech.isTokamak) && tech.energyRegen !== 0.004 && !tech.isEnergyHealth && !tech.isCrouchRegen
|
|
||||||
},
|
|
||||||
requires: "not inductive coupling", //"not time crystals",
|
|
||||||
effect: () => {
|
|
||||||
tech.energyRegen = 0;
|
|
||||||
m.fieldRegen = tech.energyRegen;
|
|
||||||
},
|
|
||||||
remove() {
|
|
||||||
tech.energyRegen = 0.001;
|
|
||||||
m.fieldRegen = tech.energyRegen;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: "mass-energy equivalence",
|
name: "mass-energy equivalence",
|
||||||
description: "<strong class='color-f'>energy</strong> protects you instead of <strong class='color-h'>health</strong><br><strong class='color-harm'>harm</strong> <strong>reduction</strong> effects provide <strong>no</strong> benefit",
|
description: "<strong class='color-f'>energy</strong> protects you instead of <strong class='color-h'>health</strong><br><strong class='color-harm'>harm</strong> <strong>reduction</strong> effects provide <strong>no</strong> benefit",
|
||||||
@@ -2218,7 +2198,7 @@ const tech = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "electronegativity",
|
name: "electronegativity",
|
||||||
description: "increase <strong class='color-d'>damage</strong> by <strong>1%</strong><br>for every <strong>9</strong> stored <strong class='color-f'>energy</strong>",
|
description: "increase <strong class='color-d'>damage</strong> by <strong>1%</strong><br>for every <strong>8</strong> stored <strong class='color-f'>energy</strong>",
|
||||||
maxCount: 1,
|
maxCount: 1,
|
||||||
count: 0,
|
count: 0,
|
||||||
frequency: 1,
|
frequency: 1,
|
||||||
@@ -2233,19 +2213,26 @@ const tech = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "exothermic process",
|
name: "ground state",
|
||||||
description: "increase <strong class='color-d'>damage</strong> by <strong>50%</strong><br>if a mob <strong>dies</strong> drain <strong class='color-f'>energy</strong> by <strong>25%</strong>",
|
description: "increase your <strong>max</strong> <strong class='color-f'>energy</strong> by <strong>200</strong><br>reduce passive <strong class='color-f'>energy</strong> regen by <strong>66%</strong>",
|
||||||
|
// description: "reduce <strong class='color-harm'>harm</strong> by <strong>66%</strong><br>you <strong>no longer</strong> passively regenerate <strong class='color-f'>energy</strong>",
|
||||||
maxCount: 1,
|
maxCount: 1,
|
||||||
count: 0,
|
count: 0,
|
||||||
frequency: 1,
|
frequency: 1,
|
||||||
frequencyDefault: 1,
|
frequencyDefault: 1,
|
||||||
allowed() { return true },
|
allowed() {
|
||||||
requires: "",
|
return !tech.isTimeCrystals
|
||||||
effect() {
|
},
|
||||||
tech.isEnergyLoss = true;
|
requires: "not time crystals",
|
||||||
|
effect: () => {
|
||||||
|
m.fieldRegen = 0.00033
|
||||||
|
tech.isGroundState = true
|
||||||
|
m.setMaxEnergy()
|
||||||
},
|
},
|
||||||
remove() {
|
remove() {
|
||||||
tech.isEnergyLoss = false;
|
m.fieldRegen = 0.001;
|
||||||
|
tech.isGroundState = false
|
||||||
|
m.setMaxEnergy()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -2268,6 +2255,22 @@ const tech = {
|
|||||||
m.setMaxEnergy()
|
m.setMaxEnergy()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "exothermic process",
|
||||||
|
description: "increase <strong class='color-d'>damage</strong> by <strong>50%</strong><br>if a mob <strong>dies</strong> drain <strong class='color-f'>energy</strong> by <strong>25%</strong>",
|
||||||
|
maxCount: 1,
|
||||||
|
count: 0,
|
||||||
|
frequency: 1,
|
||||||
|
frequencyDefault: 1,
|
||||||
|
allowed() { return true },
|
||||||
|
requires: "",
|
||||||
|
effect() {
|
||||||
|
tech.isEnergyLoss = true;
|
||||||
|
},
|
||||||
|
remove() {
|
||||||
|
tech.isEnergyLoss = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "Gibbs free energy",
|
name: "Gibbs free energy",
|
||||||
description: `increase <strong class='color-d'>damage</strong> by <strong>0.7%</strong><br>for each <strong class='color-f'>energy</strong> below <strong>100</strong>`,
|
description: `increase <strong class='color-d'>damage</strong> by <strong>0.7%</strong><br>for each <strong class='color-f'>energy</strong> below <strong>100</strong>`,
|
||||||
@@ -2342,9 +2345,9 @@ const tech = {
|
|||||||
frequency: 1,
|
frequency: 1,
|
||||||
frequencyDefault: 1,
|
frequencyDefault: 1,
|
||||||
allowed() {
|
allowed() {
|
||||||
return tech.energyRegen !== 0 && !tech.isDamageAfterKillNoRegen
|
return !tech.isDamageAfterKillNoRegen
|
||||||
},
|
},
|
||||||
requires: "not ground state, predator",
|
requires: "not parasitism",
|
||||||
effect() {
|
effect() {
|
||||||
tech.isCrouchRegen = true; //only used to check for requirements
|
tech.isCrouchRegen = true; //only used to check for requirements
|
||||||
m.regenEnergy = function() {
|
m.regenEnergy = function() {
|
||||||
@@ -2409,13 +2412,15 @@ const tech = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "predator",
|
name: "parasitism",
|
||||||
description: "<span style = 'font-size:91%;'>if a mob has <strong>died</strong> in the last <strong>5 seconds</strong> inhibit<br>passive <strong class='color-f'>energy</strong> regen and increase <strong class='color-d'>damage</strong> <strong>50%</strong>",
|
description: "<span style = 'font-size:91%;'>if a mob has <strong>died</strong> in the last <strong>5 seconds</strong> inhibit<br>passive <strong class='color-f'>energy</strong> regen and increase <strong class='color-d'>damage</strong> <strong>50%</strong>",
|
||||||
maxCount: 1,
|
maxCount: 1,
|
||||||
count: 0,
|
count: 0,
|
||||||
frequency: 1,
|
frequency: 1,
|
||||||
frequencyDefault: 1,
|
frequencyDefault: 1,
|
||||||
allowed() { return !tech.isCrouchRegen },
|
allowed() {
|
||||||
|
return !tech.isCrouchRegen
|
||||||
|
},
|
||||||
requires: "not inductive coupling",
|
requires: "not inductive coupling",
|
||||||
effect() {
|
effect() {
|
||||||
tech.isDamageAfterKillNoRegen = true;
|
tech.isDamageAfterKillNoRegen = true;
|
||||||
@@ -3060,6 +3065,24 @@ const tech = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "particle collider",
|
||||||
|
description: `<strong>clicking</strong> <strong class='color-m'>tech</strong> while <strong>paused</strong> <strong>ejects</strong> them<br><em><strong>3%</strong> chance to convert your tech into <strong class='color-f'>energy</strong></em>`,
|
||||||
|
maxCount: 1,
|
||||||
|
count: 0,
|
||||||
|
frequency: 1,
|
||||||
|
frequencyDefault: 1,
|
||||||
|
allowed() {
|
||||||
|
return tech.isPauseSwitchField
|
||||||
|
},
|
||||||
|
requires: "unified field theory",
|
||||||
|
effect() {
|
||||||
|
tech.isPauseEjectTech = true;
|
||||||
|
},
|
||||||
|
remove() {
|
||||||
|
tech.isPauseEjectTech = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "abiogenesis",
|
name: "abiogenesis",
|
||||||
description: `at the start of a level spawn a 2nd <strong>boss</strong><br>use ${powerUps.orb.research(4)}or add <strong>49%</strong> <strong class='color-j'>JUNK</strong> to the <strong class='color-m'>tech</strong> pool`,
|
description: `at the start of a level spawn a 2nd <strong>boss</strong><br>use ${powerUps.orb.research(4)}or add <strong>49%</strong> <strong class='color-j'>JUNK</strong> to the <strong class='color-m'>tech</strong> pool`,
|
||||||
@@ -4709,7 +4732,7 @@ const tech = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "acetone peroxide",
|
name: "acetone peroxide",
|
||||||
description: "increase <strong class='color-e'>explosive</strong> <strong>radius</strong> by <strong>80%</strong>, but<br>you take <strong>300%</strong> more <strong class='color-harm'>harm</strong> from <strong class='color-e'>explosions</strong>",
|
description: "increase <strong class='color-e'>explosive</strong> <strong>radius</strong> by <strong>80%</strong>, but<br>you take <strong>200%</strong> more <strong class='color-harm'>harm</strong> from <strong class='color-e'>explosions</strong>",
|
||||||
isGunTech: true,
|
isGunTech: true,
|
||||||
maxCount: 1,
|
maxCount: 1,
|
||||||
count: 0,
|
count: 0,
|
||||||
@@ -6688,16 +6711,16 @@ const tech = {
|
|||||||
frequency: 2,
|
frequency: 2,
|
||||||
frequencyDefault: 2,
|
frequencyDefault: 2,
|
||||||
allowed() {
|
allowed() {
|
||||||
return (m.fieldUpgrades[m.fieldMode].name === "time dilation" || m.fieldUpgrades[m.fieldMode].name === "pilot wave")
|
return !tech.isGroundState && (m.fieldUpgrades[m.fieldMode].name === "time dilation" || m.fieldUpgrades[m.fieldMode].name === "pilot wave")
|
||||||
},
|
},
|
||||||
requires: "time dilation or pilot wave",
|
requires: "time dilation or pilot wave, not ground state",
|
||||||
effect: () => {
|
effect: () => {
|
||||||
tech.energyRegen = 0.004;
|
m.fieldRegen = 0.004
|
||||||
m.fieldRegen = tech.energyRegen;
|
tech.isTimeCrystals = true
|
||||||
},
|
},
|
||||||
remove() {
|
remove() {
|
||||||
tech.energyRegen = 0.001;
|
m.fieldRegen = 0.001
|
||||||
m.fieldRegen = tech.energyRegen;
|
tech.isTimeCrystals = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -9175,6 +9198,7 @@ const tech = {
|
|||||||
isNeedles: null,
|
isNeedles: null,
|
||||||
isExplodeRadio: null,
|
isExplodeRadio: null,
|
||||||
isPauseSwitchField: null,
|
isPauseSwitchField: null,
|
||||||
|
isPauseEjectTech: null,
|
||||||
isShieldPierce: null,
|
isShieldPierce: null,
|
||||||
isDuplicateBoss: null,
|
isDuplicateBoss: null,
|
||||||
is111Duplicate: null,
|
is111Duplicate: null,
|
||||||
@@ -9284,5 +9308,7 @@ const tech = {
|
|||||||
isBrainstormActive: null,
|
isBrainstormActive: null,
|
||||||
brainStormDelay: null,
|
brainStormDelay: null,
|
||||||
wormSize: null,
|
wormSize: null,
|
||||||
extraSuperBalls: null
|
extraSuperBalls: null,
|
||||||
|
isTimeCrystals: null,
|
||||||
|
isGroundState: null,
|
||||||
}
|
}
|
||||||
39
todo.txt
39
todo.txt
@@ -1,27 +1,40 @@
|
|||||||
******************************************************** NEXT PATCH **************************************************
|
******************************************************** NEXT PATCH **************************************************
|
||||||
|
|
||||||
difficulty balance per level
|
tech: particle collider - in pause menu clicking a tech ejects it (5% chance to lose the power up and convert into energy)
|
||||||
mob harm done is reduced about 2%
|
(also works on testing without the tech)
|
||||||
player damage is increased about 2%
|
|
||||||
|
|
||||||
slasher mobs do 20% less damage
|
growBoss no longer goes invulnerable
|
||||||
this is because they killed me on my last run and I'm bitter
|
bounceBoss bullets (on reactor map)
|
||||||
mantisBoss is invincible for a less time
|
do 33% less damage
|
||||||
Zeno's paradox removes 1/10 -> 1/12 health every 5 seconds
|
move 50% slower, so they don't fill the entire map
|
||||||
|
|
||||||
slow, stun, plasma, foam, neutron bomb effects now only slow mobs down to a minimum speed of about 2-4
|
ground state reworked: reduce passive energy regen by 66%, increase max energy by 200
|
||||||
|
electronegativity: increase damage by 1% for every 9 -> 8 energy
|
||||||
bug fixes
|
acetone peroxide does 300 -> 200% more self harm from explosions
|
||||||
bounceBoss deals with slow effects in a less buggy way
|
predator renamed parasitism
|
||||||
final boss didn't kill invincible mobs when it dies
|
|
||||||
|
|
||||||
******************************************************** TODO ********************************************************
|
******************************************************** TODO ********************************************************
|
||||||
|
|
||||||
tech - field power ups now give 3 field tech instead of 3 field?
|
JUNK tech: https://bindingofisaacrebirth.fandom.com/wiki/Damocles
|
||||||
|
|
||||||
|
cloaking field doesn't show energy over max
|
||||||
|
|
||||||
|
junk tech or regular tech with this named
|
||||||
|
wiki: List of common misconceptions
|
||||||
|
|
||||||
run more profiles of n-gon to fix performance issues
|
run more profiles of n-gon to fix performance issues
|
||||||
|
|
||||||
reactor
|
reactor
|
||||||
|
hopBoss
|
||||||
|
swoopBoss: hides in top center
|
||||||
|
take a lap around the map that you have to dodge
|
||||||
|
spawn mobs
|
||||||
|
fire sniper bullets?
|
||||||
|
remove center map element?
|
||||||
|
add some blocks to the reactor level
|
||||||
|
add ammo?
|
||||||
|
boss speeds up as time goes on?
|
||||||
|
slow bullet speed?
|
||||||
foam hits all the bullets and makes this fight easy
|
foam hits all the bullets and makes this fight easy
|
||||||
give map some background graphics
|
give map some background graphics
|
||||||
it's a little short
|
it's a little short
|
||||||
|
|||||||
Reference in New Issue
Block a user