underpass

new community map!! underpass by Richard0820

duplicated power ups aren't circles
metastability makes power ups triangles instead of circles
  3->4 seconds of half life before exploding
  only metastability duplicated power ups have the lighting graphic

mob's that fall off the map now die instead of just being removed
  so they can still spawn power ups
you can pick up power ups from slightly farther away (450)
  but less far away when not facing the power up (100)
  accretion has less lag at high amounts of heal power ups following you
several other bug fixes
This commit is contained in:
landgreen
2023-04-30 09:31:13 -07:00
parent 0b728fb02c
commit e6e505809d
10 changed files with 2771 additions and 191 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 76 KiB

View File

@@ -112,6 +112,7 @@
<option value="downpour"> <option value="downpour">
<option value="buttonbutton"> <option value="buttonbutton">
<option value="vats"> <option value="vats">
<option value="underpass">
<option value="yingYang"> <option value="yingYang">
<option value="basement"> <option value="basement">
<option value="stronghold"> <option value="stronghold">

View File

@@ -1750,11 +1750,11 @@ const b = {
//need to scale the friction differently based on distance? //need to scale the friction differently based on distance?
if (dist > 500) { // if (dist > 500) {
const pull = Vector.mult(Vector.normalise(sub), 0.0008 * Math.min(Math.max(15, dist), 200)) const pull = Vector.mult(Vector.normalise(sub), 0.0008 * Math.min(Math.max(15, dist), 200))
player.force.x += pull.x player.force.x += pull.x
player.force.y += pull.y player.force.y += pull.y
} // }
if (dist > 500) { if (dist > 500) {
m.energy -= this.drain m.energy -= this.drain

File diff suppressed because it is too large Load Diff

View File

@@ -549,7 +549,7 @@ const m = {
if (tech.isSlowFPS) dmg *= 0.8 if (tech.isSlowFPS) dmg *= 0.8
if (tech.energyRegen === 0) dmg *= 0.34 if (tech.energyRegen === 0) dmg *= 0.34
// if (tech.healthDrain) dmg *= 1 + 3.33 * tech.healthDrain //tech.healthDrain = 0.03 at one stack //cause more damage // if (tech.healthDrain) dmg *= 1 + 3.33 * tech.healthDrain //tech.healthDrain = 0.03 at one stack //cause more damage
if (m.fieldMode === 0 || m.fieldMode === 3) dmg *= 0.73 ** (0.1 * m.coupling) if (m.fieldMode === 0 || m.fieldMode === 3) dmg *= 0.973 ** m.coupling
if (tech.isLowHealthDefense) dmg *= 1 - Math.max(0, 1 - m.health) * 0.8 if (tech.isLowHealthDefense) dmg *= 1 - Math.max(0, 1 - m.health) * 0.8
if (tech.isHarmReduceNoKill && m.lastKillCycle + 300 < m.cycle) dmg *= 0.33 if (tech.isHarmReduceNoKill && m.lastKillCycle + 300 < m.cycle) dmg *= 0.33
if (tech.squirrelFx !== 1) dmg *= Math.pow(0.7, (tech.squirrelFx - 1) / 0.4) //cause more damage if (tech.squirrelFx !== 1) dmg *= Math.pow(0.7, (tech.squirrelFx - 1) / 0.4) //cause more damage
@@ -1858,7 +1858,7 @@ const m = {
m.lastHit = 0 m.lastHit = 0
m.isSneakAttack = false m.isSneakAttack = false
m.duplicateChance = 0 m.duplicateChance = 0
m.grabPowerUpRange2 = 156000; m.grabPowerUpRange2 = 200000;
m.blockingRecoil = 4; m.blockingRecoil = 4;
m.fieldRange = 155; m.fieldRange = 155;
m.fieldFire = false; m.fieldFire = false;
@@ -2235,11 +2235,11 @@ const m = {
// float towards player if looking at and in range or if very close to player // float towards player if looking at and in range or if very close to player
if ( if (
dist2 < m.grabPowerUpRange2 && dist2 < m.grabPowerUpRange2 &&
(m.lookingAt(powerUp[i]) || dist2 < 16000) && (m.lookingAt(powerUp[i]) || dist2 < 1000) &&
Matter.Query.ray(map, powerUp[i].position, m.pos).length === 0 Matter.Query.ray(map, powerUp[i].position, m.pos).length === 0
) { ) {
powerUp[i].force.x += 0.05 * (dxP / Math.sqrt(dist2)) * powerUp[i].mass; powerUp[i].force.x += 0.04 * (dxP / Math.sqrt(dist2)) * powerUp[i].mass;
powerUp[i].force.y += 0.05 * (dyP / Math.sqrt(dist2)) * powerUp[i].mass - powerUp[i].mass * simulation.g; //negate gravity powerUp[i].force.y += 0.04 * (dyP / Math.sqrt(dist2)) * powerUp[i].mass - powerUp[i].mass * simulation.g; //negate gravity
//extra friction //extra friction
Matter.Body.setVelocity(powerUp[i], { Matter.Body.setVelocity(powerUp[i], {
x: powerUp[i].velocity.x * 0.11, x: powerUp[i].velocity.x * 0.11,
@@ -2465,7 +2465,7 @@ const m = {
return `<span style = 'font-size:95%;'><strong>deflecting</strong> condenses ${0.1 * couple.toFixed(2)} <strong class='color-s'>ice IX</strong></span>` return `<span style = 'font-size:95%;'><strong>deflecting</strong> condenses ${0.1 * couple.toFixed(2)} <strong class='color-s'>ice IX</strong></span>`
// return `<span style = 'font-size:89%;'><strong>invulnerable</strong> <strong>+${2*couple}</strong> seconds post collision</span>` // return `<span style = 'font-size:89%;'><strong>invulnerable</strong> <strong>+${2*couple}</strong> seconds post collision</span>`
case 3: //negative mass case 3: //negative mass
return `<strong>+${((1 - 0.73 ** couple) * 10).toFixed(1)}%</strong> <strong class='color-defense'>defense</strong>` return `<strong>+${(100 * (1 - 0.973 ** couple)).toFixed(1)}%</strong> <strong class='color-defense'>defense</strong>`
case 4: //assembler case 4: //assembler
return `generate <strong>${(0.8 * couple).toFixed(1)}</strong> <strong class='color-f'>energy</strong> per second` return `generate <strong>${(0.8 * couple).toFixed(1)}</strong> <strong class='color-f'>energy</strong> per second`
case 5: //plasma case 5: //plasma
@@ -3797,6 +3797,7 @@ const m = {
m.enterCloakCycle = 0; m.enterCloakCycle = 0;
m.drawCloakedM = function () { m.drawCloakedM = function () {
m.walk_cycle -= m.flipLegs * m.Vx; m.walk_cycle -= m.flipLegs * m.Vx;
m.pos.x += 4
m.draw(); m.draw();
// let history = m.history[(m.cycle - 1) % 600] // let history = m.history[(m.cycle - 1) % 600]
@@ -4155,13 +4156,13 @@ const m = {
{ {
name: "wormhole", name: "wormhole",
//<strong class='color-worm'>wormholes</strong> attract <strong class='color-block'>blocks</strong> and power ups<br> //<strong class='color-worm'>wormholes</strong> attract <strong class='color-block'>blocks</strong> and power ups<br>
description: "use <strong class='color-f'>energy</strong> to <strong>tunnel</strong> through a <strong class='color-worm'>wormhole</strong><br><strong>+3%</strong> chance to <strong class='color-dup'>duplicate</strong> spawned <strong>power ups</strong><br>generate <strong>6</strong> <strong class='color-f'>energy</strong> per second", //<br>bullets may also traverse <strong class='color-worm'>wormholes</strong> description: "use <strong class='color-f'>energy</strong> to <strong>tunnel</strong> through a <strong class='color-worm'>wormhole</strong><br><strong>+4%</strong> chance to <strong class='color-dup'>duplicate</strong> spawned <strong>power ups</strong><br>generate <strong>6</strong> <strong class='color-f'>energy</strong> per second", //<br>bullets may also traverse <strong class='color-worm'>wormholes</strong>
drain: 0, drain: 0,
effect: function () { effect: function () {
m.fieldMeterColor = "#bbf" //"#0c5" m.fieldMeterColor = "#bbf" //"#0c5"
m.eyeFillColor = m.fieldMeterColor m.eyeFillColor = m.fieldMeterColor
m.duplicateChance = 0.03 m.duplicateChance = 0.04
m.fieldRange = 0 m.fieldRange = 0
powerUps.setPowerUpMode(); //needed after adjusting duplication chance powerUps.setPowerUpMode(); //needed after adjusting duplication chance

View File

@@ -167,26 +167,43 @@ const powerUps = {
do() { }, do() { },
setPowerUpMode() { setPowerUpMode() {
if (tech.duplicationChance() > 0 || tech.isAnthropicTech) { if (tech.duplicationChance() > 0 || tech.isAnthropicTech) {
powerUps.draw = powerUps.drawDup
if (tech.isPowerUpsVanish) { if (tech.isPowerUpsVanish) {
if (this.tech.isHealAttract) { if (tech.isHealAttract) {
powerUps.do = powerUps.doAttractDuplicatesVanish powerUps.do = () => {
powerUps.dupExplode();
powerUps.draw();
powerUps.attractHeal();
}
} else { } else {
powerUps.do = powerUps.doDuplicatesVanish powerUps.do = () => {
powerUps.dupExplode();
powerUps.draw();
}
} }
} else if (tech.isHealAttract) { } else if (tech.isHealAttract) {
powerUps.do = powerUps.doAttractDuplicates powerUps.do = () => {
powerUps.draw();
powerUps.attractHeal();
}
} else { } else {
powerUps.do = powerUps.doDuplicates powerUps.do = () => powerUps.draw();
} }
tech.maxDuplicationEvent() //check to see if hitting 100% duplication tech.maxDuplicationEvent() //check to see if hitting 100% duplication
} else if (tech.isHealAttract) {
powerUps.do = powerUps.doAttract
} else { } else {
powerUps.do = powerUps.doDefault powerUps.draw = powerUps.drawCircle
if (tech.isHealAttract) {
powerUps.do = () => {
powerUps.draw();
powerUps.attractHeal();
}
} else {
powerUps.do = powerUps.draw
}
} }
}, },
doDefault() { draw() { },
//draw power ups drawCircle() {
ctx.globalAlpha = 0.4 * Math.sin(simulation.cycle * 0.15) + 0.6; ctx.globalAlpha = 0.4 * Math.sin(simulation.cycle * 0.15) + 0.6;
for (let i = 0, len = powerUp.length; i < len; ++i) { for (let i = 0, len = powerUp.length; i < len; ++i) {
ctx.beginPath(); ctx.beginPath();
@@ -196,121 +213,59 @@ const powerUps = {
} }
ctx.globalAlpha = 1; ctx.globalAlpha = 1;
}, },
doAttract() { drawDup() {
powerUps.doDefault(); ctx.globalAlpha = 0.4 * Math.sin(simulation.cycle * 0.15) + 0.6;
for (let i = 0; i < powerUp.length; i++) { //attract heal power ups to player
if (powerUp[i].name === "heal") {
//&& Vector.magnitudeSquared(Vector.sub(powerUp[i].position, m.pos)) < 500000
let attract = Vector.mult(Vector.normalise(Vector.sub(m.pos, powerUp[i].position)), 0.015 * powerUp[i].mass)
powerUp[i].force.x += attract.x;
powerUp[i].force.y += attract.y - powerUp[i].mass * simulation.g; //negate gravity
Matter.Body.setVelocity(powerUp[i], Vector.mult(powerUp[i].velocity, 0.7));
}
}
// for (let i = 0, len = powerUp.length; i < len; ++i) {
// const force = Vector.mult(Vector.normalise(Vector.sub(m.pos, powerUp[i].position)), 0.0015 * powerUp[i].mass)
// powerUp[i].force.x += force.x
// powerUp[i].force.y = force.y - simulation.g
// }
},
doAttractDuplicates() {
powerUps.doDuplicates();
for (let i = 0; i < powerUp.length; i++) { //attract heal power ups to player
if (powerUp[i].name === "heal") {
//&& Vector.magnitudeSquared(Vector.sub(powerUp[i].position, m.pos)) < 500000
let attract = Vector.mult(Vector.normalise(Vector.sub(m.pos, powerUp[i].position)), 0.015 * powerUp[i].mass)
powerUp[i].force.x += attract.x;
powerUp[i].force.y += attract.y - powerUp[i].mass * simulation.g; //negate gravity
Matter.Body.setVelocity(powerUp[i], Vector.mult(powerUp[i].velocity, 0.7));
}
}
},
doAttractDuplicatesVanish() {
powerUps.doDuplicatesVanish();
for (let i = 0; i < powerUp.length; i++) { //attract heal power ups to player
if (powerUp[i].name === "heal") {
//&& Vector.magnitudeSquared(Vector.sub(powerUp[i].position, m.pos)) < 500000
let attract = Vector.mult(Vector.normalise(Vector.sub(m.pos, powerUp[i].position)), 0.015 * powerUp[i].mass)
powerUp[i].force.x += attract.x;
powerUp[i].force.y += attract.y - powerUp[i].mass * simulation.g; //negate gravity
Matter.Body.setVelocity(powerUp[i], Vector.mult(powerUp[i].velocity, 0.7));
}
}
},
doDuplicates() { //draw power ups but give duplicates some electricity
ctx.globalAlpha = 0.4 * Math.sin(m.cycle * 0.15) + 0.6;
for (let i = 0, len = powerUp.length; i < len; ++i) { for (let i = 0, len = powerUp.length; i < len; ++i) {
ctx.beginPath(); ctx.beginPath();
ctx.arc(powerUp[i].position.x, powerUp[i].position.y, powerUp[i].size, 0, 2 * Math.PI); if (powerUp[i].isDuplicated) {
let vertices = powerUp[i].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);
} else {
ctx.arc(powerUp[i].position.x, powerUp[i].position.y, powerUp[i].size, 0, 2 * Math.PI);
}
ctx.fillStyle = powerUp[i].color; ctx.fillStyle = powerUp[i].color;
ctx.fill(); ctx.fill();
} }
ctx.globalAlpha = 1; ctx.globalAlpha = 1;
for (let i = 0, len = powerUp.length; i < len; ++i) { },
if (powerUp[i].isDuplicated && Math.random() < 0.1) { attractHeal() {
//draw electricity for (let i = 0; i < powerUp.length; i++) { //attract heal power ups to player
const mag = 5 + powerUp[i].size / 5 if (powerUp[i].name === "heal") {
let unit = Vector.rotate({ let attract = Vector.mult(Vector.normalise(Vector.sub(m.pos, powerUp[i].position)), 0.015 * powerUp[i].mass)
x: mag, powerUp[i].force.x += attract.x;
y: mag powerUp[i].force.y += attract.y - powerUp[i].mass * simulation.g; //negate gravity
}, 2 * Math.PI * Math.random()) Matter.Body.setVelocity(powerUp[i], Vector.mult(powerUp[i].velocity, 0.7));
let path = {
x: powerUp[i].position.x + unit.x,
y: powerUp[i].position.y + unit.y
}
ctx.beginPath();
ctx.moveTo(path.x, path.y);
for (let i = 0; i < 6; i++) {
unit = Vector.rotate(unit, 3 * (Math.random() - 0.5))
path = Vector.add(path, unit)
ctx.lineTo(path.x, path.y);
}
ctx.lineWidth = 0.5 + 2 * Math.random();
ctx.strokeStyle = "#000"
ctx.stroke();
} }
} }
}, },
doDuplicatesVanish() { //draw power ups but give duplicates some electricity dupExplode() {
//remove power ups after 3 seconds
for (let i = 0, len = powerUp.length; i < len; ++i) { for (let i = 0, len = powerUp.length; i < len; ++i) {
if (powerUp[i].isDuplicated && Math.random() < 0.004) { // (1-0.004)^150 = chance to be removed after 3 seconds if (powerUp[i].isDuplicated) {
b.explosion(powerUp[i].position, 150 + (10 + 3 * Math.random()) * powerUp[i].size); if (Math.random() < 0.003) { // (1-0.003)^240 = chance to be removed after 4 seconds, 240 = 4 seconds * 60 cycles per second
Matter.Composite.remove(engine.world, powerUp[i]); b.explosion(powerUp[i].position, 175 + (11 + 3 * Math.random()) * powerUp[i].size);
powerUp.splice(i, 1); Matter.Composite.remove(engine.world, powerUp[i]);
break powerUp.splice(i, 1);
} break
}
ctx.globalAlpha = 0.4 * Math.sin(m.cycle * 0.25) + 0.6
for (let i = 0, len = powerUp.length; i < len; ++i) {
ctx.beginPath();
ctx.arc(powerUp[i].position.x, powerUp[i].position.y, powerUp[i].size, 0, 2 * Math.PI);
ctx.fillStyle = powerUp[i].color;
ctx.fill();
}
ctx.globalAlpha = 1;
for (let i = 0, len = powerUp.length; i < len; ++i) {
if (powerUp[i].isDuplicated && Math.random() < 0.3) {
//draw electricity
const mag = 5 + powerUp[i].size / 5
let unit = Vector.rotate({
x: mag,
y: mag
}, 2 * Math.PI * Math.random())
let path = {
x: powerUp[i].position.x + unit.x,
y: powerUp[i].position.y + unit.y
} }
ctx.beginPath(); if (Math.random() < 0.3) { //draw electricity
ctx.moveTo(path.x, path.y); const mag = 4 + powerUp[i].size / 5
for (let i = 0; i < 6; i++) { let unit = Vector.rotate({ x: mag, y: mag }, 2 * Math.PI * Math.random())
unit = Vector.rotate(unit, 3 * (Math.random() - 0.5)) let path = { x: powerUp[i].position.x + unit.x, y: powerUp[i].position.y + unit.y }
path = Vector.add(path, unit) ctx.beginPath();
ctx.lineTo(path.x, path.y); ctx.moveTo(path.x, path.y);
for (let i = 0; i < 6; i++) {
unit = Vector.rotate(unit, 4 * (Math.random() - 0.5))
path = Vector.add(path, unit)
ctx.lineTo(path.x, path.y);
}
ctx.lineWidth = 0.5 + 2 * Math.random();
ctx.strokeStyle = "#000"
ctx.stroke();
} }
ctx.lineWidth = 0.5 + 2 * Math.random();
ctx.strokeStyle = "#000"
ctx.stroke();
} }
} }
}, },
@@ -371,7 +326,7 @@ const powerUps = {
return return
} }
if (tech.isCancelDuplication) { if (tech.isCancelDuplication) {
tech.duplication += 0.043 tech.duplication += 0.041
tech.maxDuplicationEvent() tech.maxDuplicationEvent()
simulation.makeTextLog(`tech.duplicationChance() <span class='color-symbol'>+=</span> ${0.043}`) simulation.makeTextLog(`tech.duplicationChance() <span class='color-symbol'>+=</span> ${0.043}`)
simulation.circleFlare(0.043); simulation.circleFlare(0.043);
@@ -1255,6 +1210,10 @@ const powerUps = {
const choose = localSettings.entanglement.gunIndexes[i] const choose = localSettings.entanglement.gunIndexes[i]
// text += `<div class="choose-grid-module" onclick="powerUps.choose('gun',${gun})"><div class="grid-title"><div class="circle-grid gun"></div> &nbsp; ${b.guns[gun].name}</div> ${b.guns[gun].description}</div>` // text += `<div class="choose-grid-module" onclick="powerUps.choose('gun',${gun})"><div class="grid-title"><div class="circle-grid gun"></div> &nbsp; ${b.guns[gun].name}</div> ${b.guns[gun].description}</div>`
text += powerUps.gunText(choose, `powerUps.choose('gun',${choose})`) text += powerUps.gunText(choose, `powerUps.choose('gun',${choose})`)
//consider not adding guns the player currently has?
} }
for (let i = 0; i < localSettings.entanglement.techIndexes.length; i++) { //add tech for (let i = 0; i < localSettings.entanglement.techIndexes.length; i++) { //add tech
let choose = localSettings.entanglement.techIndexes[i] let choose = localSettings.entanglement.techIndexes[i]
@@ -1566,32 +1525,34 @@ const powerUps = {
powerUp.splice(index, 1); powerUp.splice(index, 1);
} }
}, },
directSpawn(x, y, target, moving = true, mode = null, size = powerUps[target].size()) { directSpawn(x, y, target, moving = true, mode = null, size = powerUps[target].size(), isDuplicated = false) {
let index = powerUp.length; let index = powerUp.length;
target = powerUps[target]; let properties = {
powerUp[index] = Matter.Bodies.polygon(x, y, 0, size, {
density: 0.001, density: 0.001,
frictionAir: 0.03, frictionAir: 0.03,
restitution: 0.85, restitution: 0.85,
inertia: Infinity, //prevents rotation
collisionFilter: { collisionFilter: {
group: 0, group: 0,
category: cat.powerUp, category: cat.powerUp,
mask: cat.map | cat.powerUp mask: cat.map | cat.powerUp
}, },
color: target.color, color: powerUps[target].color,
effect: target.effect, effect: powerUps[target].effect,
name: target.name, name: powerUps[target].name,
size: size size: size
});
if (mode) powerUp[index].mode = mode
if (moving) {
Matter.Body.setVelocity(powerUp[index], {
x: (Math.random() - 0.5) * 15,
y: Math.random() * -9 - 3
});
} }
Composite.add(engine.world, powerUp[index]); //add to world let polygonSides
if (isDuplicated) {
polygonSides = tech.isPowerUpsVanish ? 3 : Math.floor(4 + 2 * Math.random())
properties.isDuplicated = true
} else {
properties.inertia = Infinity //prevents rotation for circles only
polygonSides = 0
}
powerUp[index] = Matter.Bodies.polygon(x, y, polygonSides, size, properties);
if (mode) powerUp[index].mode = mode
if (moving) Matter.Body.setVelocity(powerUp[index], { x: (Math.random() - 0.5) * 15, y: Math.random() * -9 - 3 });
Composite.add(engine.world, powerUp[index]);
}, },
spawn(x, y, target, moving = true, mode = null, size = powerUps[target].size()) { spawn(x, y, target, moving = true, mode = null, size = powerUps[target].size()) {
if ( if (
@@ -1601,7 +1562,7 @@ const powerUps = {
if (tech.isBoostReplaceAmmo && target === 'ammo') target = 'boost' if (tech.isBoostReplaceAmmo && target === 'ammo') target = 'boost'
powerUps.directSpawn(x, y, target, moving, mode, size) powerUps.directSpawn(x, y, target, moving, mode, size)
if (Math.random() < tech.duplicationChance()) { if (Math.random() < tech.duplicationChance()) {
powerUps.directSpawn(x, y, target, moving, mode, size) powerUps.directSpawn(x, y, target, moving, mode, size, true)
powerUp[powerUp.length - 1].isDuplicated = true powerUp[powerUp.length - 1].isDuplicated = true
// if (tech.isPowerUpsVanish) powerUp[powerUp.length - 1].endCycle = simulation.cycle + 300 // if (tech.isPowerUpsVanish) powerUp[powerUp.length - 1].endCycle = simulation.cycle + 300
} }

View File

@@ -1003,9 +1003,13 @@ const simulation = {
} }
} }
}; };
fallCheck(mob);
fallCheck(body); fallCheck(body);
fallCheck(powerUp, true); fallCheck(powerUp, true);
let i = mob.length;
while (i--) {
if (mob[i].position.y > simulation.fallHeight) mob[i].death();
}
} }
} }
}, },

View File

@@ -236,7 +236,7 @@ const tech = {
if (m.coupling && (m.fieldMode === 0 || m.fieldMode === 5)) dmg *= 1 + 0.015 * m.coupling if (m.coupling && (m.fieldMode === 0 || m.fieldMode === 5)) dmg *= 1 + 0.015 * m.coupling
if (m.isSneakAttack && m.sneakAttackCycle + Math.min(120, 0.5 * (m.cycle - m.enterCloakCycle)) > m.cycle) dmg *= 4.33 * (1 + 0.033 * m.coupling) if (m.isSneakAttack && m.sneakAttackCycle + Math.min(120, 0.5 * (m.cycle - m.enterCloakCycle)) > m.cycle) dmg *= 4.33 * (1 + 0.033 * m.coupling)
if (tech.deathSkipTime) dmg *= 1 + 0.6 * tech.deathSkipTime if (tech.deathSkipTime) dmg *= 1 + 0.6 * tech.deathSkipTime
if (tech.isTechDebt) dmg *= tech.totalCount > 2 ? Math.pow(0.85, tech.totalCount - 20) : 4 - 0.15 * tech.totalCount // if (tech.isTechDebt) dmg *= Math.min(Math.pow(0.85, tech.totalCount - 20), 4 - 0.15 * tech.totalCount) if (tech.isTechDebt) dmg *= tech.totalCount > 20 ? Math.pow(0.85, tech.totalCount - 20) : 4 - 0.15 * tech.totalCount // if (tech.isTechDebt) dmg *= Math.min(Math.pow(0.85, tech.totalCount - 20), 4 - 0.15 * tech.totalCount)
if (tech.isFlipFlopDamage && tech.isFlipFlopOn) dmg *= 1.555 if (tech.isFlipFlopDamage && tech.isFlipFlopOn) dmg *= 1.555
if (tech.isAnthropicDamage && tech.isDeathAvoidedThisLevel) dmg *= 2.3703599 if (tech.isAnthropicDamage && tech.isDeathAvoidedThisLevel) dmg *= 2.3703599
if (tech.isDupDamage) dmg *= 1 + Math.min(1, tech.duplicationChance()) if (tech.isDupDamage) dmg *= 1 + Math.min(1, tech.duplicationChance())
@@ -259,7 +259,7 @@ const tech = {
return dmg return dmg
}, },
duplicationChance() { duplicationChance() {
return Math.min(1, Math.max(0, (tech.isPowerUpsVanish ? 0.12 : 0) + (tech.isStimulatedEmission ? 0.15 : 0) + tech.duplication + tech.duplicateChance + 0.05 * tech.isExtraGunField + m.duplicateChance + tech.fieldDuplicate + tech.cloakDuplication + (tech.isAnthropicTech && tech.isDeathAvoidedThisLevel ? 0.5 : 0) + tech.isQuantumEraserDuplication * (1 - 0.016 * (simulation.difficultyMode ** 2)))) return Math.min(1, Math.max(0, (tech.isPowerUpsVanish ? 0.13 : 0) + (tech.isStimulatedEmission ? 0.15 : 0) + tech.duplication + tech.duplicateChance + 0.05 * tech.isExtraGunField + m.duplicateChance + tech.fieldDuplicate + tech.cloakDuplication + (tech.isAnthropicTech && tech.isDeathAvoidedThisLevel ? 0.5 : 0) + tech.isQuantumEraserDuplication * (1 - 0.016 * (simulation.difficultyMode ** 2))))
}, },
isScaleMobsWithDuplication: false, isScaleMobsWithDuplication: false,
maxDuplicationEvent() { maxDuplicationEvent() {
@@ -3517,7 +3517,8 @@ const tech = {
{ {
name: "technical debt", name: "technical debt",
descriptionFunction() { descriptionFunction() {
return `<strong>+300%</strong> <strong class='color-d'>damage</strong> <strong>15%</strong> <strong class='color-d'>damage</strong><br>for each <strong class='color-m'>tech</strong> you have learned <em>(${(Math.floor(100 * (Math.min(Math.pow(0.85, tech.totalCount - 20), 4 - 0.15 * tech.totalCount))) - 100)}%)</em>` // return `<strong>+300%</strong> <strong class='color-d'>damage</strong> <strong>15%</strong> <strong class='color-d'>damage</strong><br>for each <strong class='color-m'>tech</strong> you have learned <em>(+${(Math.floor(100 * (Math.min(Math.pow(0.85, tech.totalCount - 20), 4 - 0.15 * tech.totalCount))) - 100)}%)</em>`
return `<strong>+300%</strong> <strong class='color-d'>damage</strong> <strong>15%</strong> <strong class='color-d'>damage</strong><br>for each <strong class='color-m'>tech</strong> you have learned <em>(${(tech.totalCount > 20 ? 100 * (Math.pow(0.85, tech.totalCount - 20) - 1) : 100 * (3 - 0.15 * tech.totalCount)).toFixed(0)}%)</em>`
}, },
maxCount: 1, maxCount: 1,
count: 0, count: 0,
@@ -3658,7 +3659,7 @@ const tech = {
}, },
{ {
name: "paradigm shift", name: "paradigm shift",
description: `<strong>clicking</strong> <strong class='color-m'>tech</strong> while paused <strong>ejects</strong> them<br><strong>20%</strong> chance to remove without <strong>ejecting</strong>`, description: `when <strong>paused</strong> clicking a <strong class='color-m'>tech</strong> <strong>ejects</strong> it<br>with a <strong>20%</strong> chance to remove without <strong>ejecting</strong>`,
maxCount: 1, maxCount: 1,
count: 0, count: 0,
frequency: 1, frequency: 1,
@@ -3676,7 +3677,7 @@ const tech = {
}, },
{ {
name: "unified field theory", name: "unified field theory",
description: `<span style = 'font-size:90%;'><strong>clicking</strong> the <strong class='color-f'>field</strong> box when <strong>paused</strong> cycles your <strong class='color-f'>field</strong><br><strong>double</strong> the <strong class='flicker'>frequency</strong> of finding <strong class='color-f'>field</strong><strong class='color-m'>tech</strong></span>`, description: `when <strong>paused</strong> clicking your <strong class='color-f'>field</strong> <strong>cycles</strong> it<br><strong>double</strong> the <strong class='flicker'>frequency</strong> of finding <strong class='color-f'>field</strong><strong class='color-m'>tech</strong>`,
maxCount: 1, maxCount: 1,
count: 0, count: 0,
frequency: 1, frequency: 1,
@@ -3724,17 +3725,27 @@ const tech = {
{ {
name: "quintessence", name: "quintessence",
descriptionFunction() { descriptionFunction() {
let converted = powerUps.research.count * this.couplingToResearch * 10 if (this.count) {
if (this.count) converted = this.researchUsed * this.couplingToResearch * 10 converted = this.researchUsed * this.couplingToResearch
let orbText
if (converted > 15) {
orbText = `${converted} ${powerUps.orb.coupling()}`
} else {
orbText = powerUps.orb.coupling(converted)
}
return `convert ${this.researchUsed} ${powerUps.orb.research(1)} into <strong>${orbText}</strong><br><em>${m.couplingDescription(1)} per ${powerUps.orb.coupling(1)}</em>`
let orbText
if (converted > 15) {
orbText = `${converted} ${powerUps.orb.coupling()}`
} else { } else {
orbText = powerUps.orb.coupling(converted) let converted = powerUps.research.count * this.couplingToResearch
let orbText
if (converted > 15) {
orbText = `${converted} ${powerUps.orb.coupling()}`
} else {
orbText = powerUps.orb.coupling(converted)
}
return `convert ${powerUps.research.count} ${powerUps.orb.research(1)} into <strong>${orbText}</strong><br><em>${m.couplingDescription(1)} per ${powerUps.orb.coupling(1)}</em>`
} }
// return `use all your ${powerUps.orb.research(1)} to spawn <strong>${orbText}</strong><br>that each give <strong>+0.1</strong> <strong class='color-coupling'>coupling</strong>`//<br>${m.couplingDescription(1)} ${m.fieldMode === 0 ? "" : "per <strong class='color-coupling'>coupling</strong>"}
return `use all your ${powerUps.orb.research(1)} to spawn <strong>${orbText}</strong><br><em>${m.couplingDescription(1)} per ${powerUps.orb.coupling(1)}</em>`
}, },
maxCount: 1, maxCount: 1,
@@ -3762,10 +3773,10 @@ const tech = {
if (!simulation.paused && !simulation.isChoosing) { //&& !(simulation.cycle % 2) if (!simulation.paused && !simulation.isChoosing) { //&& !(simulation.cycle % 2)
powerUps.research.changeRerolls(-1) powerUps.research.changeRerolls(-1)
this.researchUsed++ this.researchUsed++
powerUps.spawn(m.pos.x + 50 * (Math.random() - 0.5), m.pos.y + 50 * (Math.random() - 0.5), "coupling"); powerUps.spawnDelay("coupling", this.couplingToResearch)
} }
} else { //exit delay loop } // else exit delay loop
}
} }
requestAnimationFrame(cycle); requestAnimationFrame(cycle);
}, },
@@ -3881,7 +3892,7 @@ const tech = {
}, },
{ {
name: "futures exchange", name: "futures exchange",
description: "clicking <strong class='color-cancel'>cancel</strong> for a <strong class='color-f'>field</strong>, <strong class='color-m'>tech</strong>, or <strong class='color-g'>gun</strong><br>gives <strong>+4.3%</strong> power up <strong class='color-dup'>duplication</strong> chance", description: "clicking <strong class='color-cancel'>cancel</strong> for a <strong class='color-f'>field</strong>, <strong class='color-m'>tech</strong>, or <strong class='color-g'>gun</strong><br>gives <strong>+4.1%</strong> power up <strong class='color-dup'>duplication</strong> chance",
// descriptionFunction() { // descriptionFunction() {
// return `clicking <strong style = 'font-size:150%;'>×</strong> to <strong>cancel</strong> a <strong class='color-f'>field</strong>, <strong class='color-m'>tech</strong>, or <strong class='color-g'>gun</strong><br>gives <strong>+${4.9 - 0.15*simulation.difficultyMode}%</strong> power up <strong class='color-dup'>duplication</strong> chance` // return `clicking <strong style = 'font-size:150%;'>×</strong> to <strong>cancel</strong> a <strong class='color-f'>field</strong>, <strong class='color-m'>tech</strong>, or <strong class='color-g'>gun</strong><br>gives <strong>+${4.9 - 0.15*simulation.difficultyMode}%</strong> power up <strong class='color-dup'>duplication</strong> chance`
// }, // },
@@ -3904,7 +3915,7 @@ const tech = {
}, },
{ {
name: "replication", name: "replication",
description: "<strong>+10%</strong> chance to <strong class='color-dup'>duplicate</strong> spawned <strong>power ups</strong><br><strong>+33%</strong> <strong class='color-junk'>JUNK</strong> to <strong class='color-m'>tech</strong> pool", description: "<strong>+9%</strong> chance to <strong class='color-dup'>duplicate</strong> spawned <strong>power ups</strong><br><strong>+33%</strong> <strong class='color-junk'>JUNK</strong> to <strong class='color-m'>tech</strong> pool",
maxCount: 9, maxCount: 9,
count: 0, count: 0,
frequency: 1, frequency: 1,
@@ -3914,7 +3925,7 @@ const tech = {
}, },
requires: "below 100% duplication chance", requires: "below 100% duplication chance",
effect() { effect() {
tech.duplicateChance += 0.1 tech.duplicateChance += 0.09
powerUps.setPowerUpMode(); //needed after adjusting duplication chance powerUps.setPowerUpMode(); //needed after adjusting duplication chance
if (!build.isExperimentSelection && !simulation.isTextLogOpen) simulation.circleFlare(0.11); if (!build.isExperimentSelection && !simulation.isTextLogOpen) simulation.circleFlare(0.11);
this.refundAmount += tech.addJunkTechToPool(0.33) this.refundAmount += tech.addJunkTechToPool(0.33)
@@ -3952,7 +3963,7 @@ const tech = {
}, },
{ {
name: "metastability", name: "metastability",
description: "<strong>+12%</strong> chance to <strong class='color-dup'>duplicate</strong> spawned <strong>power ups</strong><br><strong class='color-dup'>duplicates</strong> <strong class='color-e'>explode</strong> with a <strong>3</strong> second <strong>half-life</strong>", description: "<strong>+13%</strong> chance to <strong class='color-dup'>duplicate</strong> spawned <strong>power ups</strong><br><strong class='color-dup'>duplicates</strong> <strong class='color-e'>explode</strong> with a <strong>4</strong> second <strong>half-life</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
frequency: 1, frequency: 1,
@@ -4046,7 +4057,7 @@ const tech = {
tech.damage *= this.damage tech.damage *= this.damage
}, },
remove() { remove() {
if (this.count > 0) { if (this.count > 0 && m.alive) {
tech.duplication += 0.1 tech.duplication += 0.1
powerUps.setPowerUpMode(); //needed after adjusting duplication chance powerUps.setPowerUpMode(); //needed after adjusting duplication chance
tech.damage /= this.damage tech.damage /= this.damage
@@ -4138,11 +4149,11 @@ const tech = {
pool = shuffle(pool); //shuffles order of maps pool = shuffle(pool); //shuffles order of maps
let removeCount = 0 let removeCount = 0
for (let i = 0, len = pool.length * this.damagePerRemoved; i < len; i++) removeCount += tech.removeTech(pool[i]) for (let i = 0, len = pool.length * this.damagePerRemoved; i < len; i++) removeCount += tech.removeTech(pool[i])
this.damage = 1 + this.damagePerRemoved * removeCount this.damage = this.damagePerRemoved * removeCount
tech.damage *= this.damage tech.damage *= (1 + this.damage)
}, },
remove() { remove() {
if (this.count) tech.damage /= this.damage if (this.count) tech.damage /= (1 + this.damage)
} }
}, },
{ {

View File

@@ -9,7 +9,7 @@ body {
margin: 0; margin: 0;
overflow: hidden; overflow: hidden;
cursor: auto; cursor: auto;
transition: background-color 0.2s ease-in-out; /* transition: background-color 0.2s ease-in-out; */
} }
canvas { canvas {

View File

@@ -1,23 +1,22 @@
******************************************************** NEXT PATCH ************************************************** ******************************************************** NEXT PATCH **************************************************
setting - minimal HUD new community map!! underpass by Richard0820
remove: defense bar, damage bar, tech, in game console
improved text clarity on coupling duplicated power ups aren't circles
removed tech decoupling metastability makes power ups triangles instead of circles
3->4 seconds of half life before exploding
only metastability duplicated power ups have the lighting graphic
added cloaking and sneak attack graphics mob's that fall off the map now die instead of just being removed
also, the 50% defense when cloaked is now clear from the defense bar so they can still spawn power ups
ternary 44->83% damage but requires current gun to have ammo/3 (was any gun) you can pick up power ups from slightly farther away (450)
wormhole invariant: uses much less energy to pause time but less far away when not facing the power up (100)
standing wave has less recoil when blocking accretion has less lag at high amounts of heal power ups following you
several other bug fixes
new images
bug fixes
*********************************************************** TODO ***************************************************** *********************************************************** TODO *****************************************************
use ephemera to replace things use ephemera to replace things
JUNK? JUNK?
request animation stuff request animation stuff
simulation checks simulation checks