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:
landgreen
2022-02-05 07:01:03 -08:00
parent 6a2ef59c7b
commit 496cc83878
11 changed files with 175 additions and 123 deletions

View File

@@ -1,7 +1,7 @@
let bullet = [];
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
activeGun: null, //current gun in use by player
inventoryGun: 0,
@@ -371,7 +371,7 @@ const b = {
//player damage
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)
if (m.immuneCycle < m.cycle) m.energy -= DRAIN
if (m.energy < 0) {
@@ -420,7 +420,7 @@ const b = {
dist = Vector.magnitude(sub);
if (dist < radius) {
const harm = radius * (tech.isExplosionHarm ? 0.00055 : 0.00018)
const harm = radius * (tech.isExplosionHarm ? 0.00036 : 0.00018)
if (tech.isImmuneExplosion) {
const mitigate = Math.min(1, Math.max(1 - m.energy * 0.5, 0))
if (simulation.dmgScale) m.damage(mitigate * harm);
@@ -489,7 +489,7 @@ const b = {
if (dist < radius) {
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
mob[i].damage(dmg * damageScale * b.dmgScale);
mob[i].damage(dmg * damageScale * m.dmgScale);
mob[i].locatePlayer();
knock = Vector.mult(Vector.normalise(sub), (-Math.sqrt(dmg * damageScale) * mob[i].mass) * 0.01);
mob[i].force.x += knock.x;
@@ -1089,7 +1089,7 @@ const b = {
//aoe damage to mobs
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) {
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 (mob[i].shield) dmg *= 3 //to make up for the /5 that shields normally take
mob[i].damage(dmg);
@@ -1652,14 +1652,14 @@ const b = {
}
if (Vector.magnitude(Vector.sub(this.position, mob[i].position) < this.explodeRad)) {
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
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.lockedOn.damage(b.dmgScale * 4 * size); //does extra damage to target
this.lockedOn.damage(m.dmgScale * 4 * size); //does extra damage to target
}
},
do() {
@@ -1724,7 +1724,7 @@ const b = {
frictionAir: 0,
isInHole: true, //this keeps the bullet from entering wormholes
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",
isBranch: false,
restitution: 0,
@@ -1863,7 +1863,7 @@ const b = {
y: best.y
};
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.locatePlayer();
@@ -1927,7 +1927,7 @@ const b = {
y: where.y + 3000 * Math.sin(m.angle)
}, dmg = tech.laserDamage, reflections = tech.laserReflections, isThickBeam = false, push = 1) {
const reflectivity = 1 - 1 / (reflections * 1.5)
let damage = b.dmgScale * dmg
let damage = m.dmgScale * dmg
let best = {
x: 1,
y: 1,
@@ -2881,7 +2881,7 @@ const b = {
//aoe damage to mobs
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) {
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 (mob[i].shield) dmg *= 3 // to make up for the /5 that shields normally take
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)
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
Matter.Body.scale(this, SCALE, SCALE);
this.radius *= SCALE;
} 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
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
}
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) {
mobs.statusDoT(who, (tech.isFastRadiation ? 6 : 2) * tech.nailSize, tech.isSlowRadiation ? 360 : (tech.isFastRadiation ? 60 : 180)) // one tick every 30 cycles
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
}
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) {
mobs.statusDoT(who, (tech.isFastRadiation ? 6 : 2) * tech.nailSize, tech.isSlowRadiation ? 360 : (tech.isFastRadiation ? 60 : 180)) // one tick every 30 cycles
dmg *= 0.25
@@ -3622,8 +3622,8 @@ const b = {
if (!q[i].isShielded) {
Matter.Body.setAngularVelocity(this, this.spin)
// mobs.statusStun(q[i], 180)
// const dmg = 0.5 * b.dmgScale * (this.isUpgraded ? 2.5 : 1)
const dmg = 0.5 * b.dmgScale
// const dmg = 0.5 * m.dmgScale * (this.isUpgraded ? 2.5 : 1)
const dmg = 0.5 * m.dmgScale
q[i].damage(dmg);
if (q[i].alive) q[i].foundPlayer();
if (q[i].damageReduction) {
@@ -3914,7 +3914,7 @@ const b = {
//hit target with laser
if (this.lockedOn && this.lockedOn.alive && m.energy > this.drainThreshold) {
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 = {
// x: m.pos.x + 20 * Math.cos(m.angle),
// y: m.pos.y + 20 * Math.sin(m.angle)
@@ -3949,7 +3949,7 @@ const b = {
// if (input.fire && m.energy > this.drain) {
// m.energy -= this.drain
// 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
};
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.locatePlayer();
//push mobs away
@@ -4277,7 +4277,7 @@ const b = {
for (let i = 0; i < q.length; i++) {
if (!q[i].isShielded) {
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);
if (q[i].alive) q[i].foundPlayer();
if (q[i].damageReduction) {
@@ -4958,7 +4958,7 @@ const b = {
ctx.lineWidth = 2 * tech.wavePacketDamage
ctx.beginPath();
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--) {
//draw wave
@@ -5042,7 +5042,7 @@ const b = {
ctx.lineWidth = 2 * tech.wavePacketDamage
ctx.beginPath();
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--) {
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,
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,
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",
collisionFilter: {
category: 0,
@@ -6161,7 +6161,7 @@ const b = {
// mob[i].force.x += mag * this.velocity.x;
// mob[i].force.y += mag * this.velocity.y;
// //damage mob
// const damage = b.dmgScale * 0.002 * dist
// const damage = m.dmgScale * 0.002 * dist
// mob[i].damage(damage);
// mob[i].locatePlayer();
// simulation.drawList.push({ //add dmg to draw queue

View File

@@ -174,7 +174,7 @@ function collisionChecks(event) {
//mob + bullet collisions
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
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
// console.log(dmg)
mob[k].damage(dmg);
@@ -195,7 +195,7 @@ function collisionChecks(event) {
if (obj.classType === "body" && obj.speed > 6) {
const v = Vector.magnitude(Vector.sub(mob[k].velocity, obj.velocity));
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
// console.log(dmg)
mob[k].damage(dmg, true);

View File

@@ -254,7 +254,7 @@ ${botText}
<br>level: ${level.levels[level.onLevel]} (${level.difficultyText()}) &nbsp; ${m.cycle} cycles
<br>${mob.length} mobs, &nbsp; ${body.length} blocks, &nbsp; ${bullet.length} bullets, &nbsp; ${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>heal difficulty scale: ${(simulation.healScale*100).toFixed(1)}%
${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) {
const techCountText = tech.tech[i].count > 1 ? `(${tech.tech[i].count}x)` : "";
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;">
<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>
</span>
&nbsp; &nbsp; &nbsp; &nbsp; ${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) {
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;">
<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>
@@ -289,7 +289,7 @@ ${simulation.isCheating ? "<br><br><em>lore disabled</em>": ""}
} else if (tech.tech[i].isLore) {
text += `<div class="pause-grid-module"><div class="grid-title lore-text"><div class="circle-grid lore"></div> &nbsp; ${tech.tech[i].name} ${techCountText}</div>${tech.tech[i].descriptionFunction ? tech.tech[i].descriptionFunction() :tech.tech[i].description}</div></div>`
} else {
text += `<div class="pause-grid-module"><div class="grid-title"><div class="circle-grid tech"></div> &nbsp; ${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> &nbsp; ${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) {
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>`

View File

@@ -22,7 +22,7 @@ const level = {
// m.setField("standing wave")
// b.giveGuns("laser")
// 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");
// tech.giveTech("tinsellated flagella")
// for (let i = 0; i < 3; i++) tech.giveTech("undefined")
@@ -125,7 +125,7 @@ const level = {
customTopLayer() {},
setDifficulty() {
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.CDScale = 1 //mob CD time decreases each level
simulation.dmgScale = 0.375 * simulation.difficulty //damage done by mobs increases each level
@@ -134,7 +134,7 @@ const level = {
difficultyIncrease(num = 1) {
for (let i = 0; i < num; i++) {
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.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()
for (let i = 0; i < num; i++) {
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.CDScale < 1) simulation.CDScale /= 0.965 //mob CD time decreases each level
}

View File

@@ -157,7 +157,7 @@ const mobs = {
who.status.push({
effect() {
if ((simulation.cycle - this.startCycle) % 30 === 0) {
let dmg = b.dmgScale * this.dmg
let dmg = m.dmgScale * this.dmg
who.damage(dmg);
if (who.damageReduction) {
simulation.drawList.push({ //add dmg to draw queue
@@ -188,7 +188,7 @@ const mobs = {
// who.status.push({
// effect() {
// 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);
// simulation.drawList.push({ //add dmg to draw queue
// x: who.position.x,

View File

@@ -393,6 +393,7 @@ const m = {
m.drop();
if (simulation.paused) build.pauseGrid() //update the build when paused
},
dmgScale: null, //scales all damage, but not raw .dmg //set in levels.setDifficulty
death() {
if (tech.isImmortal) { //if player has the immortality buff, spawn on the same level with randomized damage
//remove immortality tech
@@ -922,7 +923,7 @@ const m = {
if (removed) powerUps.directSpawn(m.pos.x, m.pos.y, "tech");
}
if (m.energy < m.maxEnergy) m.energy = m.maxEnergy;
m.fieldRegen = tech.energyRegen; //0.001
m.fieldRegen = 0.001
m.fieldMeterColor = "#0cf"
m.eyeFillColor = m.fieldMeterColor
m.fieldShieldingScale = 1;
@@ -1321,7 +1322,7 @@ const m = {
}
const unit = Vector.normalise(Vector.sub(player.position, who.position))
if (tech.blockDmg) {
who.damage(tech.blockDmg * b.dmgScale, true)
who.damage(tech.blockDmg * m.dmgScale, true)
//draw electricity
const step = 40
ctx.beginPath();
@@ -1646,7 +1647,7 @@ const m = {
}
}
if (tech.blockDmg) { //electricity
mob[i].damage(tech.blockDmg * b.dmgScale)
mob[i].damage(tech.blockDmg * m.dmgScale)
const step = 40
ctx.beginPath();
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.fill()
// } 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;
// mobs.statusStun(inPlayer[i], 300)
@@ -3656,7 +3657,7 @@ const m = {
//mob + bullet collisions
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
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
mob[k].damage(dmg);
if (mob[k].alive) mob[k].foundPlayer();
@@ -3675,7 +3676,7 @@ const m = {
if (obj.classType === "body" && obj.speed > 6) {
const v = Vector.magnitude(Vector.sub(mob[k].velocity, obj.velocity));
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
mob[k].damage(dmg, true);
if (tech.isBlockPowerUps && !mob[k].alive && mob[k].isDropPowerUp && m.throwCycle > m.cycle) {

View File

@@ -1037,6 +1037,18 @@ const powerUps = {
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() {
// const have = [] //find which tech you have
// for (let i = 0; i < tech.tech.length; i++) {

View File

@@ -231,7 +231,7 @@ const spawn = {
//aoe damage to mobs
// 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) {
// 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 (mob[i].shield) dmg *= 4 //x5 to make up for the /5 that shields normally take
// mob[i].damage(dmg);
@@ -1120,10 +1120,10 @@ const spawn = {
Matter.Body.scale(this, scale, scale);
this.radius *= scale;
this.isInvulnerable = true
if (this.damageReduction) this.startingDamageReduction = this.damageReduction
this.damageReduction = 0
this.invulnerabilityCountDown = simulation.difficulty
// this.isInvulnerable = true
// if (this.damageReduction) this.startingDamageReduction = this.damageReduction
// this.damageReduction = 0
// this.invulnerabilityCountDown = simulation.difficulty
}
me.onDeath = function() {
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"
}
}
me.damageReduction = 0.23 / (tech.isScaleMobsWithDuplication ? 1 + tech.duplicationChance() : 1)
me.damageReduction = 0.2 / (tech.isScaleMobsWithDuplication ? 1 + tech.duplicationChance() : 1)
//required setup for invulnerable
me.isInvulnerable = false
// me.isInvulnerable = false
me.invulnerabilityCountDown = 0
me.do = function() {
if (this.isInvulnerable) {
if (this.invulnerabilityCountDown > 0) {
this.invulnerabilityCountDown--
ctx.beginPath();
let vertices = this.vertices;
ctx.moveTo(vertices[0].x, vertices[0].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.lineWidth = 20;
ctx.strokeStyle = "rgba(255,255,255,0.7)";
ctx.stroke();
} else {
this.isInvulnerable = false
this.damageReduction = this.startingDamageReduction
}
}
// if (this.isInvulnerable) {
// if (this.invulnerabilityCountDown > 0) {
// this.invulnerabilityCountDown--
// ctx.beginPath();
// let vertices = this.vertices;
// ctx.moveTo(vertices[0].x, vertices[0].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.lineWidth = 20;
// ctx.strokeStyle = "rgba(255,255,255,0.7)";
// ctx.stroke();
// } else {
// this.isInvulnerable = false
// this.damageReduction = this.startingDamageReduction
// }
// }
this.alwaysSeePlayer();
this.checkStatus();
this.attraction();
@@ -3583,7 +3583,7 @@ const spawn = {
if (this.mass > 10) Matter.Body.scale(this, 0.99, 0.99);
// 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)
// }
//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
mobs.spawn(x, y, sides, radius, "rgb(255,0,155)");
let me = mob[mob.length - 1];
@@ -3630,7 +3630,7 @@ const spawn = {
me.isMobBullet = true;
me.showHealthBar = false;
me.onHit = function() {
this.explode(this.mass * 20);
this.explode(this.mass * 12);
};
me.do = function() {
this.timeLimit();

View File

@@ -228,7 +228,7 @@ const tech = {
if (tech.isEnergyLoss) dmg *= 1.55;
if (tech.isAcidDmg && m.health > 1) dmg *= 1.35;
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.isRerollDamage) dmg *= 1 + 0.037 * powerUps.research.count
if (tech.isOneGun && b.inventory.length < 2) dmg *= 1.25
@@ -2099,26 +2099,6 @@ const tech = {
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",
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",
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,
count: 0,
frequency: 1,
@@ -2233,19 +2213,26 @@ const tech = {
}
},
{
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>",
name: "ground state",
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,
count: 0,
frequency: 1,
frequencyDefault: 1,
allowed() { return true },
requires: "",
effect() {
tech.isEnergyLoss = true;
allowed() {
return !tech.isTimeCrystals
},
requires: "not time crystals",
effect: () => {
m.fieldRegen = 0.00033
tech.isGroundState = true
m.setMaxEnergy()
},
remove() {
tech.isEnergyLoss = false;
m.fieldRegen = 0.001;
tech.isGroundState = false
m.setMaxEnergy()
}
},
{
@@ -2268,6 +2255,22 @@ const tech = {
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",
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,
frequencyDefault: 1,
allowed() {
return tech.energyRegen !== 0 && !tech.isDamageAfterKillNoRegen
return !tech.isDamageAfterKillNoRegen
},
requires: "not ground state, predator",
requires: "not parasitism",
effect() {
tech.isCrouchRegen = true; //only used to check for requirements
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>",
maxCount: 1,
count: 0,
frequency: 1,
frequencyDefault: 1,
allowed() { return !tech.isCrouchRegen },
allowed() {
return !tech.isCrouchRegen
},
requires: "not inductive coupling",
effect() {
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",
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",
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,
maxCount: 1,
count: 0,
@@ -6688,16 +6711,16 @@ const tech = {
frequency: 2,
frequencyDefault: 2,
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: () => {
tech.energyRegen = 0.004;
m.fieldRegen = tech.energyRegen;
m.fieldRegen = 0.004
tech.isTimeCrystals = true
},
remove() {
tech.energyRegen = 0.001;
m.fieldRegen = tech.energyRegen;
m.fieldRegen = 0.001
tech.isTimeCrystals = false
}
},
{
@@ -9175,6 +9198,7 @@ const tech = {
isNeedles: null,
isExplodeRadio: null,
isPauseSwitchField: null,
isPauseEjectTech: null,
isShieldPierce: null,
isDuplicateBoss: null,
is111Duplicate: null,
@@ -9284,5 +9308,7 @@ const tech = {
isBrainstormActive: null,
brainStormDelay: null,
wormSize: null,
extraSuperBalls: null
extraSuperBalls: null,
isTimeCrystals: null,
isGroundState: null,
}