mass-energy rework

mass-energy is compatible with more tech
  defense works with mass-energy, but is exponentially reduced (~10%)
  damage taken scales with difficulty based heal reduction
    1.3x dmg level 5 hard,  2x dmg level 13 why

ergodicity: 91->66% damage,  no heals -> 1/2 size heals
negative feedback 0.5% -> 1% damage per missing health
negative entropy spawn heals for 33% missing health not 33 flat missing health
  this means it caps at 3 health per level
tech - iceIX freeze effect lasts 2 seconds longer, spawn 10 coupling
  perfect diamagnetism, standing wave

research is less common
path integral comes with 5% JUNK
there are fewer starting power ups on why difficulty

bug fixes:
  fixed the text overflow issue on small screens
  decoherence: if you get a tech that is banished it stops being banished
  you can now have negative research
This commit is contained in:
landgreen
2022-09-26 08:42:34 -07:00
parent 9d0a49de19
commit d7c01ef92c
11 changed files with 458 additions and 366 deletions

View File

@@ -659,11 +659,6 @@ const m = {
},
collisionImmuneCycles: 30,
damage(dmg) {
// if (tech.isCouplingNoHit) {
// for (let i = 0, len = tech.tech.length; i < len; i++) {
// if (tech.tech[i].name === "fine-structure constant") powerUps.ejectTech(i, true)
// }
// }
if (tech.isRewindAvoidDeath && m.energy > 0.6 && dmg > 0.01) {
const steps = Math.floor(Math.min(299, 150 * m.energy))
simulation.makeTextLog(`<span class='color-var'>m</span>.rewind(${steps})`)
@@ -677,9 +672,9 @@ const m = {
if (Math.random() < 0.5) b.drone({ x: m.pos.x + 30 * Math.cos(m.angle) + 100 * (Math.random() - 0.5), y: m.pos.y + 30 * Math.sin(m.angle) + 100 * (Math.random() - 0.5) }) //spawn drone
}
}
if (tech.isEnergyHealth) {
m.energy -= dmg
dmg *= Math.pow(m.harmReduction(), 0.1) //defense has less effect
m.energy -= 0.9 * dmg / Math.sqrt(simulation.healScale) //scale damage with heal reduction difficulty
if (m.energy < 0 || isNaN(m.energy)) { //taking deadly damage
if (tech.isDeathAvoid && powerUps.research.count && !tech.isDeathAvoidedThisLevel) {
tech.isDeathAvoidedThisLevel = true
@@ -738,7 +733,6 @@ const m = {
document.getElementById("dmg").style.transition = "opacity 0s";
document.getElementById("dmg").style.opacity = 0.1 + Math.min(0.6, dmg * 4);
}
if (dmg > 0.03) {
m.lastHit = dmg;
if (dmg > 0.06 / m.holdingMassScale) m.drop(); //drop block if holding // m.holdingMassScale = 0.5 for most fields
@@ -1594,7 +1588,19 @@ const m = {
couplingChange(change = 0) {
if (change > 0 && level.onLevel !== -1) simulation.makeTextLog(`m.coupling <span class='color-symbol'>+=</span> ${change}`, 60); //level.onLevel !== -1 means not on lore level
m.coupling += change
if (m.coupling < 0) m.coupling = 0 //can't go negative
if (m.coupling < 0) {
//look for coupling power ups on this level and remove them to prevent exploiting tech ejections
for (let i = powerUp.length - 1; i > -1; i--) {
if (powerUp[i].name === "coupling") {
Matter.Composite.remove(engine.world, powerUp[i]);
powerUp.splice(i, 1);
m.coupling += 0.1
if (!(m.coupling < 0)) break
}
}
m.coupling = 0 //can't go negative
}
// m.setMaxEnergy();
// m.setMaxHealth();
m.setFieldRegen()
@@ -2922,9 +2928,12 @@ const m = {
//not shooting (or using field) enable cloak
if (m.energy < 0.05 && m.fireCDcycle < m.cycle && !input.fire) m.fireCDcycle = m.cycle
if (m.fireCDcycle + 30 < m.cycle && !input.fire) { //automatically cloak if not firing
if (!m.isCloak) {
const drain = 0.1
if (!m.isCloak && m.energy > drain) {
m.energy -= drain
m.isCloak = true //enter cloak
// m.color = {
// hue: 0,
// sat: 0,