biohazard map

new level biohazard by INOOBBOI AND THESHWARMA
  enable community maps in settings

some coupling tech spawns power ups instead of directly giving coupling
fine-structure constant gives 60 coupling power ups, lose 0.5 coupling after mob collision
tech: decoupling: when ON: +5.00 coupling  OFF: spawn a WIMP
  (probably adds coupling drift bugs)

JUNK tech - boost - spawn a large number of boost power ups

several bug fixes
  mob - flutter is no longer treated as a boss
This commit is contained in:
landgreen
2022-09-04 10:47:57 -07:00
parent cc1bbeb53b
commit 9e613a281e
9 changed files with 1438 additions and 1730 deletions

View File

@@ -119,11 +119,25 @@ function collisionChecks(event) {
if (document.getElementById("tech-flip-flop")) document.getElementById("tech-flip-flop").innerHTML = ` = <strong>OFF</strong>`
m.eyeFillColor = 'transparent'
m.damage(dmg);
if (tech.isFlipFlopCoupling) {
m.couplingChange(-5)
for (let i = 0; i < mob.length; i++) {
if (mob[i].isDecoupling) mob[i].alive = false //remove WIMP
}
spawn.WIMP()
mob[mob.length - 1].isDecoupling = true //so you can find it to remove
}
} else {
tech.isFlipFlopOn = true //immune to damage this hit, lose immunity for next hit
if (document.getElementById("tech-flip-flop")) document.getElementById("tech-flip-flop").innerHTML = ` = <strong>ON</strong>`
m.eyeFillColor = m.fieldMeterColor //'#0cf'
if (!tech.isFlipFlopHarm) m.damage(dmg);
if (tech.isFlipFlopCoupling) {
m.couplingChange(5)
for (let i = 0; i < mob.length; i++) {
if (mob[i].isDecoupling) mob[i].alive = false //remove WIMP
}
}
}
if (tech.isFlipFlopHealth) {
m.setMaxHealth();
@@ -146,6 +160,7 @@ function collisionChecks(event) {
simulation.makeTextLog(`simulation.amplitude <span class='color-symbol'>=</span> ${Math.random()}`);
}
if (tech.isPiezo) m.energy += 20.48;
if (tech.isCouplingNoHit) m.couplingChange(-0.5)
if (tech.isStimulatedEmission) powerUps.ejectTech()
if (mob[k].onHit) mob[k].onHit();
if (m.immuneCycle < m.cycle + m.collisionImmuneCycles) m.immuneCycle = m.cycle + m.collisionImmuneCycles; //player is immune to damage for 30 cycles

View File

@@ -257,7 +257,7 @@ const build = {
<br><strong class='color-defense'>defense</strong>: ${(1-m.harmReduction()).toPrecision(3)} &nbsp; &nbsp; difficulty: ${(1/simulation.dmgScale).toPrecision(3)}
${b.fireCDscale < 1 ? `<br><strong><em>fire rate</em></strong>: ${((1-b.fireCDscale)*100).toFixed(b.fireCDscale < 0.1 ? 2 : 0)}%`: ""}
${tech.duplicationChance() ? `<br><strong class='color-dup'>duplication</strong>: ${(tech.duplicationChance()*100).toFixed(0)}%`: ""}
${m.coupling ? `<br><strong class='color-coupling'>coupling</strong>: ${(m.coupling).toFixed(2)} &nbsp; <span style = 'font-size:90%;'>`+m.couplingDescription(true)+"</span>": ""}
${m.coupling ? `<br><strong class='color-coupling'>coupling</strong>: ${(m.coupling).toFixed(2)} &nbsp; <span style = 'font-size:90%;'>`+m.couplingDescription()+"</span>": ""}
${botText}
<br>
<br><strong class='color-h'>health</strong>: (${(m.health*100).toFixed(0)} / ${(m.maxHealth*100).toFixed(0)})

File diff suppressed because it is too large Load Diff

View File

@@ -317,6 +317,7 @@ const m = {
},
alive: false,
switchWorlds() {
powerUps.boost.endCycle = 0
const totalGuns = b.inventory.length
//track ammo/ ammoPack count
let ammoCount = 0
@@ -506,7 +507,7 @@ const m = {
},
baseHealth: 1,
setMaxHealth() {
m.maxHealth = m.baseHealth + tech.extraMaxHealth + tech.isFallingDamage + 4 * tech.isFlipFlop * tech.isFlipFlopOn * tech.isFlipFlopHealth + (m.fieldMode === 0 || m.fieldMode === 5) * 0.5 * m.coupling
m.maxHealth = m.baseHealth + tech.extraMaxHealth + tech.isFallingDamage + 4 * tech.isFlipFlop * tech.isFlipFlopOn * tech.isFlipFlopHealth //+ (m.fieldMode === 0 || m.fieldMode === 5) * 0.5 * m.coupling
document.getElementById("health-bg").style.width = `${Math.floor(300 * m.maxHealth)}px`
simulation.makeTextLog(`<span class='color-var'>m</span>.<span class='color-h'>maxHealth</span> <span class='color-symbol'>=</span> ${m.maxHealth.toFixed(2)}`)
if (m.health > m.maxHealth) m.health = m.maxHealth;
@@ -658,11 +659,11 @@ 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.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})`)
@@ -1565,11 +1566,10 @@ const m = {
}
},
hold() {},
couplingDescription(isScaled = false) {
const couple = isScaled ? m.coupling : 1
couplingDescription(couple = m.coupling) {
switch (m.fieldMode) {
case 0: //field emitter
return `gain the effects of <strong>all</strong> <strong class='color-f'>fields</strong>`
return `gain the <strong class='color-coupling'>coupling</strong> effects of <strong>all</strong> <strong class='color-f'>fields</strong>`
case 1: //standing wave
return `<span style = 'font-size:95%;'><strong>deflecting</strong> condenses +${couple.toFixed(1)} <strong class='color-s'>ice IX</strong></span>`
case 2: //perfect diamagnetism
@@ -1591,12 +1591,16 @@ const m = {
return `<span style = 'font-size:89%;'>after eating <strong class='color-block'>blocks</strong> <strong>+${(20*couple).toFixed(0)}</strong> <strong class='color-f'>energy</strong></span>`
}
},
couplingChange() {
couplingChange(change = 0) {
if (change > 0) simulation.makeTextLog(`m.coupling <span class='color-symbol'>+=</span> ${change}`, 60);
m.coupling += change
if (m.coupling < 0) m.coupling = 0 //can't go negative
// m.setMaxEnergy();
// m.setMaxHealth();
m.setFieldRegen()
mobs.setMobSpawnHealth();
powerUps.setDupChance();
if ((m.fieldMode === 0 || m.fieldMode === 9) && !build.isExperimentSelection && !simulation.isTextLogOpen) simulation.circleFlare(0.4);
// m.collisionImmuneCycles = 30 + m.coupling * 120 //2 seconds
// switch (m.fieldMode) {
@@ -2681,7 +2685,6 @@ const m = {
},
{
name: "time dilation",
// description: "use <strong class='color-f'>energy</strong> to <strong style='letter-spacing: 1px;'>stop time</strong><br>while time is stopped you can <strong>move</strong> and <strong>fire</strong><br>and <strong>collisions</strong> do <strong>50%</strong> less <strong class='color-defense'>harm</strong>",
description: "use <strong class='color-f'>energy</strong> to <strong style='letter-spacing: 2px;'>stop time</strong><br><strong>+25%</strong> movement, jumping, and <strong><em>fire rate</em></strong><br>generate <strong>18</strong> <strong class='color-f'>energy</strong> per second",
set() {
// m.fieldMeterColor = "#0fc"
@@ -2720,6 +2723,7 @@ const m = {
this.rewindCount = 0
m.grabPowerUpRange2 = 300000
m.hold = function() {
console.log(m.fieldCDcycle)
m.grabPowerUp();
// //grab power ups
// for (let i = 0, len = powerUp.length; i < len; ++i) {

View File

@@ -355,11 +355,7 @@ const powerUps = {
powerUps.spawn(m.pos.x + 40 * (Math.random() - 0.5), m.pos.y + 40 * (Math.random() - 0.5), spawnType, false);
}
}
if (tech.isCancelCouple) {
simulation.makeTextLog(`m.coupling <span class='color-symbol'>+=</span> 0.5`);
m.coupling += 0.5
m.couplingChange()
}
if (tech.isCancelCouple) powerUps.coupling.spawnDelay(5)
// if (tech.isCancelTech && Math.random() < 0.3) {
// powerUps.spawn(m.pos.x + 40 * (Math.random() - 0.5), m.pos.y + 40 * (Math.random() - 0.5), "tech", false);
// simulation.makeTextLog(`<strong>options exchange</strong>: returns 1 <strong class='color-m'>tech</strong>`)
@@ -402,10 +398,22 @@ const powerUps = {
return 13;
},
effect() {
simulation.makeTextLog(`m.coupling <span class='color-symbol'>+=</span> 0.1`);
m.coupling += 0.1
m.couplingChange()
m.couplingChange(0.1)
},
spawnDelay(num) {
let count = num
let respawnDrones = () => {
if (count > 0) {
requestAnimationFrame(respawnDrones);
if (!simulation.paused && !simulation.isChoosing) { //&& !(simulation.cycle % 2)
count--
const where = { x: m.pos.x + 50 * (Math.random() - 0.5), y: m.pos.y + 50 * (Math.random() - 0.5) }
powerUps.spawn(where.x, where.y, "coupling");
}
}
}
requestAnimationFrame(respawnDrones);
}
},
boost: {
name: "boost",
@@ -429,7 +437,7 @@ const powerUps = {
ctx.lineWidth = 4
ctx.stroke();
}
}
},
},
research: {
count: 0,
@@ -1069,151 +1077,20 @@ const powerUps = {
}
}
},
// effectOld() {
// if (m.alive) {
// function pick(skip1 = null, skip2 = null, skip3 = null, skip4 = null) {
// let options = [];
// for (let i = 0; i < tech.tech.length; i++) {
// if (tech.tech[i].count < tech.tech[i].maxCount && i !== skip1 && i !== skip2 && i !== skip3 && i !== skip4 && tech.tech[i].allowed() && !tech.tech[i].isBanished) {
// for (let j = 0, len = tech.tech[i].frequency; j < len; j++) options.push(i);
// }
// }
// powerUps.tech.lastTotalChoices = options.length //this is recorded so that banish can know how many tech were available
// const totalChoices = tech.isDeterminism ? 1 : 3 + tech.extraChoices * 2
// if (powerUps.tech.choiceLog.length > totalChoices || powerUps.tech.choiceLog.length === totalChoices) { //make sure this isn't the first time getting a power up and there are previous choices to remove
// for (let i = 0; i < totalChoices; i++) { //repeat for each choice from the last selection
// if (options.length > totalChoices) {
// for (let j = 0, len = options.length; j < len; j++) {
// if (powerUps.tech.choiceLog[powerUps.tech.length - 1 - i] === options[j]) {
// options.splice(j, 1) //remove previous choice from option pool
// break;
// }
// }
// }
// }
// }
// if (options.length > 0) {
// // const choose = options[Math.floor(Math.random() * options.length)]
// const choose = options[Math.floor(Math.seededRandom(0, options.length))]
// const isCount = tech.tech[choose].count > 0 ? `(${tech.tech[choose].count+1}x)` : "";
// if (tech.tech[choose].isFieldTech) {
// text += `<div class="choose-grid-module" onclick="powerUps.choose('tech',${choose})"><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[choose].name} ${isCount}</div>${tech.tech[choose].descriptionFunction ? tech.tech[choose].descriptionFunction() :tech.tech[choose].description}</div></div>`
// } else if (tech.tech[choose].isGunTech) {
// text += `<div class="choose-grid-module" onclick="powerUps.choose('tech',${choose})"><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>
// </span>
// &nbsp; &nbsp; &nbsp; &nbsp; ${tech.tech[choose].name} ${isCount}</div>${tech.tech[choose].descriptionFunction ? tech.tech[choose].descriptionFunction() :tech.tech[choose].description}</div></div>`
// } else if (tech.tech[choose].isLore) {
// text += `<div class="choose-grid-module" onclick="powerUps.choose('tech',${choose})"><div class="grid-title lore-text"><div class="circle-grid lore"></div> &nbsp; ${tech.tech[choose].name} ${isCount}</div>${tech.tech[choose].descriptionFunction ? tech.tech[choose].descriptionFunction() : tech.tech[choose].description}</div>`
// } else if (tech.tech[choose].isJunk) {
// text += `<div class="choose-grid-module" onclick="powerUps.choose('tech',${choose})"><div class="grid-title"><div class="circle-grid junk"></div> &nbsp; ${tech.tech[choose].name} ${isCount}</div>${tech.tech[choose].descriptionFunction ? tech.tech[choose].descriptionFunction() : tech.tech[choose].description}</div>`
// } else {
// text += `<div class="choose-grid-module" onclick="powerUps.choose('tech',${choose})"><div class="grid-title"><div class="circle-grid tech"></div> &nbsp; ${tech.tech[choose].name} ${isCount}</div>${tech.tech[choose].descriptionFunction ? tech.tech[choose].descriptionFunction() : tech.tech[choose].description}</div>`
// }
// // text += `<div class="choose-grid-module" onclick="powerUps.choose('tech',${choose})"><div class="grid-title"><div class="circle-grid tech"></div> &nbsp; ${tech.tech[choose].name}</div> ${tech.tech[choose].description}</div>`
// return choose
// } else if (tech.isBanish) { //if no tech options available eject banish tech
// for (let i = 0, len = tech.tech.length; i < len; i++) {
// if (tech.tech[i].name === "decoherence") powerUps.ejectTech(i)
// }
// }
// }
// let text = ""
// if (!tech.isSuperDeterminism) text += `<div class='cancel' onclick='powerUps.endDraft("tech",true)'>${tech.isCancelTech ? "?":"✕"}</div>`
// text += `<h3 style = 'color:#fff; text-align:left; margin: 0px;'>tech</h3>`
// let choice1 = pick()
// // console.log(choice1)
// let choice2 = null
// let choice3 = null
// if (choice1 !== null) {
// powerUps.tech.choiceLog.push(choice1)
// if (!tech.isDeterminism) {
// choice2 = pick(choice1)
// // if (choice2 > -1) text += `<div class="choose-grid-module" onclick="powerUps.choose('tech',${choice2})"><div class="grid-title"><div class="circle-grid tech"></div> &nbsp; ${tech.tech[choice2].name}</div> ${tech.tech[choice2].description}</div>`
// choice3 = pick(choice1, choice2)
// // if (choice3 > -1) text += `<div class="choose-grid-module" onclick="powerUps.choose('tech',${choice3})"><div class="grid-title"><div class="circle-grid tech"></div> &nbsp; ${tech.tech[choice3].name}</div> ${tech.tech[choice3].description}</div>`
// powerUps.tech.choiceLog.push(choice2)
// powerUps.tech.choiceLog.push(choice3)
// }
// if (tech.extraChoices) {
// let choice4 = pick(choice1, choice2, choice3)
// // if (choice4 > -1) text += `<div class="choose-grid-module" onclick="powerUps.choose('tech',${choice4})"><div class="grid-title"><div class="circle-grid tech"></div> &nbsp; ${tech.tech[choice4].name}</div> ${tech.tech[choice4].description}</div>`
// let choice5 = pick(choice1, choice2, choice3, choice4)
// // if (choice5 > -1) text += `<div class="choose-grid-module" onclick="powerUps.choose('tech',${choice5})"><div class="grid-title"><div class="circle-grid tech"></div> &nbsp; ${tech.tech[choice5].name}</div> ${tech.tech[choice5].description}</div>`
// powerUps.tech.choiceLog.push(choice4)
// powerUps.tech.choiceLog.push(choice5)
// }
// // if (powerUps.research.count) text += `<div class="choose-grid-module" onclick="powerUps.research.use('tech')"><div class="grid-title"><div class="circle-grid research"></div> &nbsp; research <span class="research-select">${powerUps.research.count}</span></div></div>`
// if (tech.isExtraGunField) {
// if (Math.random() > 0.5 && b.inventory.length < b.guns.length) {
// //bonus gun in tech menu
// let choiceGun = powerUps.gun.pick(b.guns)
// powerUps.gun.choiceLog.push(choiceGun)
// text += `<div class="choose-grid-module" onclick="powerUps.choose('gun',${choiceGun})"><div class="grid-title"><div class="circle-grid gun"></div> &nbsp; ${b.guns[choiceGun].name}</div> ${b.guns[choiceGun].description}</div>`
// } else {
// //bonus field in tech menu
// let choiceField = powerUps.field.pick(m.fieldUpgrades)
// powerUps.field.choiceLog.push(choiceField)
// text += `<div class="choose-grid-module" onclick="powerUps.choose('field',${choiceField})"><div class="grid-title"><div class="circle-grid field"></div> &nbsp; ${m.fieldUpgrades[choiceField].name}</div> ${m.fieldUpgrades[choiceField].description}</div>`
// }
// }
// if (tech.tooManyTechChoices) {
// tech.tooManyTechChoices--
// for (let i = 0; i < powerUps.tech.lastTotalChoices; i++) pick()
// }
// if (tech.isBrainstorm && !tech.isBrainstormActive && !simulation.isChoosing) {
// tech.isBrainstormActive = true
// let count = 0
// requestAnimationFrame(cycle);
// function cycle() {
// count++
// if (count < tech.brainStormDelay * 5 && simulation.isChoosing) {
// if (!(count % tech.brainStormDelay)) {
// powerUps.tech.effect();
// document.getElementById("choose-grid").style.pointerEvents = "auto"; //turn off the normal 500ms delay
// document.body.style.cursor = "auto";
// document.getElementById("choose-grid").style.transitionDuration = "0s";
// }
// requestAnimationFrame(cycle);
// } else {
// tech.isBrainstormActive = false
// }
// }
// }
// //add in research button or pseudoscience button
// if (tech.isJunkResearch && powerUps.research.currentRerollCount < 3) {
// tech.junkResearchNumber = Math.floor(5 * Math.random())
// text += `<div class="choose-grid-module" onclick="powerUps.research.use('tech')"><div class="grid-title"> <span style="position:relative;">`
// for (let i = 0; i < tech.junkResearchNumber; i++) text += `<div class="circle-grid junk" style="position:absolute; top:0; left:${15*i}px ;opacity:0.8; border: 1px #fff solid;"></div>`
// text += `</span>&nbsp; <span class='research-select'>pseudoscience</span></div></div>`
// } else if (powerUps.research.count) {
// text += `<div class="choose-grid-module" onclick="powerUps.research.use('tech')"><div class="grid-title"> <span style="position:relative;">`
// for (let i = 0, len = Math.min(powerUps.research.count, 30); i < len; i++) text += `<div class="circle-grid research" style="position:absolute; top:0; left:${(18 - len*0.3)*i}px;opacity:0.8; border: 1px #fff solid;"></div>`
// // text += `</span>&nbsp; <span class='research-select'>research</span></div></div>`
// text += `</span>&nbsp; <span class='research-select'>${tech.isResearchReality?"<span class='alt'>alternate reality</span>": "research"}</span></div></div>`
// }
// document.getElementById("choose-grid").innerHTML = text
// powerUps.showDraft();
// }
// }
// }
},
spawnDelay(type, num) {
let count = num
let cycle = () => {
if (count > 0) {
requestAnimationFrame(cycle);
if (!simulation.paused && !simulation.isChoosing) { //&& !(simulation.cycle % 2)
count--
const where = { x: m.pos.x + 50 * (Math.random() - 0.5), y: m.pos.y + 50 * (Math.random() - 0.5) }
powerUps.spawn(where.x, where.y, type);
}
}
}
requestAnimationFrame(cycle);
},
onPickUp(who) {
powerUps.research.currentRerollCount = 0
@@ -1231,25 +1108,30 @@ const powerUps = {
tech.isFlipFlopOn = false
if (document.getElementById("tech-switch")) document.getElementById("tech-switch").innerHTML = ` = <strong>OFF</strong>`
m.eyeFillColor = 'transparent'
if (tech.isFlipFlopCoupling) {
m.couplingChange(-5)
for (let i = 0; i < mob.length; i++) {
if (mob[i].isDecoupling) mob[i].alive = false //remove WIMP
}
spawn.WIMP()
mob[mob.length - 1].isDecoupling = true //so you can find it to remove
}
} else {
tech.isFlipFlopOn = true //immune to damage this hit, lose immunity for next hit
if (document.getElementById("tech-switch")) document.getElementById("tech-switch").innerHTML = ` = <strong>ON</strong>`
m.eyeFillColor = m.fieldMeterColor //'#0cf'
if (tech.isFlipFlopCoupling) {
m.couplingChange(5)
for (let i = 0; i < mob.length; i++) {
if (mob[i].isDecoupling) mob[i].alive = false //remove WIMP
}
}
}
if (tech.isRelayEnergy) m.setMaxEnergy();
}
},
// giveRandomAmmo() {
// const ammoTarget = Math.floor(Math.random() * (b.guns.length));
// const ammo = Math.ceil(b.guns[ammoTarget].ammoPack * 6);
// if (ammo !== Infinity) {
// b.guns[ammoTarget].ammo += ammo;
// simulation.updateGunHUD();
// simulation.makeTextLog(`${b.guns[ammoTarget].name}.<span class='color-g'>ammo</span> <span class='color-symbol'>+=</span> ${ammo}`);
// }
// },
spawnRandomPowerUp(x, y) { //mostly used after mob dies, doesn't always return a power up
if ((Math.random() * Math.random() - 0.3 > Math.sqrt(m.health) && !tech.isEnergyHealth) || Math.random() < 0.04) { //spawn heal chance is higher at low health
if (!tech.isEnergyHealth && (Math.random() * Math.random() - 0.3 > Math.sqrt(m.health)) || Math.random() < 0.04) { //spawn heal chance is higher at low health
powerUps.spawn(x, y, "heal");
return;
}

View File

@@ -775,6 +775,7 @@ const simulation = {
powerUps.field.choiceLog = [];
powerUps.totalPowerUps = 0;
powerUps.research.count = 0;
powerUps.boost.endCycle = 0
m.setFillColors();
// m.maxHealth = 1
// m.maxEnergy = 1

View File

@@ -340,7 +340,7 @@ const spawn = {
}
setTimeout(() => {
this.do = this.awake;
}, 500 + 2000 * Math.random());
}, 1000 * Math.random());
}
this.checkStatus();
};
@@ -2710,7 +2710,6 @@ const spawn = {
flutter(x, y, radius = 20 + 6 * Math.random()) {
mobs.spawn(x, y, 7, radius, '#16576b');
let me = mob[mob.length - 1];
me.isBoss = true;
Matter.Body.setDensity(me, 0.002); //extra dense //normal is 0.001 //makes effective life much larger
// me.damageReduction = 0.04 / (tech.isScaleMobsWithDuplication ? 1 + tech.duplicationChance() : 1)

View File

@@ -57,7 +57,7 @@ const tech = {
}
if (tech.tech[index].count === 0) return 0
const totalRemoved = tech.tech[index].count
simulation.makeTextLog(`<span class='color-var'>tech</span>.removeTech("<span class='color-text'>${tech.tech[index].name}</span>")`)
simulation.makeTextLog(`<span class='color-var'>tech</span>.removeTech("<span class='color-text'>${tech.tech[index].name}</span>")`, 360)
tech.tech[index].remove();
tech.tech[index].count = 0;
tech.totalCount -= totalRemoved
@@ -295,9 +295,7 @@ const tech = {
isNonRefundable: true,
// isExperimentHide: true,
isBadRandomOption: true,
allowed() {
return true
},
allowed: () => true,
requires: "",
effect() {
powerUps.spawn(m.pos.x, m.pos.y, "gun");
@@ -367,7 +365,7 @@ const tech = {
const index = Math.floor(Math.random() * gunTechPool.length)
tech.giveTech(gunTechPool[index]) // choose from the gun pool
tech.tech[gunTechPool[index]].isFromAppliedScience = true //makes it not remove properly under paradigm shift
simulation.makeTextLog(`<span class='color-var'>tech</span>.giveTech("<span class='color-text'>${tech.tech[gunTechPool[index]].name}</span>")`)
simulation.makeTextLog(`<span class='color-var'>tech</span>.giveTech("<span class='color-text'>${tech.tech[gunTechPool[index]].name}</span>")`, 360)
}
}
simulation.boldActiveGunHUD();
@@ -381,9 +379,7 @@ const tech = {
count: 0,
frequency: 1,
frequencyDefault: 1,
allowed() {
return true
},
allowed: () => true,
requires: "",
effect() {
tech.isDamageForGuns = true;
@@ -399,9 +395,7 @@ const tech = {
count: 0,
frequency: 1,
frequencyDefault: 1,
allowed() {
return true
},
allowed: () => true,
requires: "",
effect() {
tech.isFireRateForGuns = true;
@@ -605,9 +599,7 @@ const tech = {
count: 0,
frequency: 1,
frequencyDefault: 1,
allowed() {
return true
},
allowed: () => true,
requires: "",
effect() {
tech.crouchAmmoCount = true
@@ -870,9 +862,7 @@ const tech = {
count: 0,
frequency: 1,
frequencyDefault: 1,
allowed() {
return true
},
allowed: () => true,
requires: "",
effect() {
tech.isBulletsLastLonger += 0.3
@@ -989,9 +979,7 @@ const tech = {
count: 0,
frequency: 1,
frequencyDefault: 1,
allowed() {
return true
},
allowed: () => true,
requires: "",
effect() {
tech.deathSkipTime++
@@ -1008,9 +996,9 @@ const tech = {
frequency: 1,
frequencyDefault: 1,
allowed() {
return !tech.isEnergyHealth
return !tech.isEnergyHealth && !tech.isRewindField
},
requires: "not mass-energy",
requires: "not mass-energy, retrocausality",
effect() {
tech.isNoFireDefense = true
},
@@ -1026,9 +1014,9 @@ const tech = {
frequency: 1,
frequencyDefault: 1,
allowed() {
return true
return !tech.isRewindField
},
requires: "",
requires: "not retrocausality",
effect() {
tech.isNoFireDamage = true
},
@@ -1856,14 +1844,30 @@ const tech = {
requires: "not relay switch",
effect() {
tech.isFlipFlop = true //do you have this tech?
tech.isFlipFlopOn = true //what is the state of flip-Flop?
if (!tech.isFlipFlopOn) {
tech.isFlipFlopOn = true //what is the state of flip-Flop?
if (tech.isFlipFlopCoupling) {
m.couplingChange(5)
for (let i = 0; i < mob.length; i++) {
if (mob[i].isDecoupling) mob[i].alive = false //remove WIMP
}
}
}
if (!m.isShipMode) {
m.draw = m.drawFlipFlop
}
},
remove() {
tech.isFlipFlop = false
tech.isFlipFlopOn = false
if (tech.isFlipFlopOn) {
tech.isFlipFlopOn = false //what is the state of flip-Flop?
if (tech.isFlipFlopCoupling) {
m.couplingChange(5)
for (let i = 0; i < mob.length; i++) {
if (mob[i].isDecoupling) mob[i].alive = false //remove WIMP
}
}
}
m.eyeFillColor = 'transparent'
}
},
@@ -1921,6 +1925,47 @@ const tech = {
tech.isFlipFlopEnergy = false;
}
},
{
name: "decoupling",
link: `<a target="_blank" href='https://en.wikipedia.org/wiki/Decoupling_(cosmology)' class="link">decoupling</a>`,
descriptionFunction() {
//<span style = 'font-size:80%;'>(${ m.couplingDescription(this.bonus)})</span>
return `if <strong class='color-flop'>ON</strong> <strong>+5</strong> <strong class='color-coupling'>coupling</strong><br>if <strong class='color-flop'>OFF</strong> a dangerous particle slowly <strong>chases</strong> you`
},
maxCount: 1,
count: 0,
frequency: 4,
frequencyDefault: 4,
bonus: 5, //coupling given
allowed() {
return tech.isFlipFlop || tech.isRelay
},
requires: "ON/OFF tech",
effect() {
tech.isFlipFlopCoupling = true;
if (tech.isFlipFlopOn) {
m.couplingChange(this.bonus)
} else {
for (let i = 0; i < mob.length; i++) {
if (mob[i].isDecoupling) mob[i].alive = false //remove WIMP
}
spawn.WIMP()
mob[mob.length - 1].isDecoupling = true //so you can find it to remove
}
},
remove() {
tech.isFlipFlopCoupling = false;
if (tech.isFlipFlop || tech.isRelay) {
if (tech.isFlipFlopOn) {
m.couplingChange(-this.bonus)
} else {
for (let i = 0; i < mob.length; i++) {
if (mob[i].isDecoupling) mob[i].alive = false //remove WIMP
}
}
}
}
},
{
name: "relay switch",
description: `toggle <strong class="color-flop">ON</strong> and <strong class="color-flop">OFF</strong> after picking up a <strong>power up</strong><br>unlock advanced <strong class='color-m'>tech</strong> that runs if <strong class="color-flop">ON</strong>`,
@@ -1948,14 +1993,30 @@ const tech = {
requires: "not flip-flop",
effect() {
tech.isRelay = true //do you have this tech?
tech.isFlipFlopOn = true //what is the state of flip-Flop?
if (!tech.isFlipFlopOn) {
tech.isFlipFlopOn = true //what is the state of flip-Flop?
if (tech.isFlipFlopCoupling) {
m.couplingChange(5)
for (let i = 0; i < mob.length; i++) {
if (mob[i].isDecoupling) mob[i].alive = false //remove WIMP
}
}
}
if (!m.isShipMode) {
m.draw = m.drawFlipFlop
}
},
remove() {
tech.isRelay = false
tech.isFlipFlopOn = false
if (tech.isFlipFlopOn) {
tech.isFlipFlopOn = false //what is the state of flip-Flop?
if (tech.isFlipFlopCoupling) {
m.couplingChange(-5)
for (let i = 0; i < mob.length; i++) {
if (mob[i].isDecoupling) mob[i].alive = false //remove WIMP
}
}
}
m.eyeFillColor = 'transparent'
}
},
@@ -2081,9 +2142,7 @@ const tech = {
count: 0,
frequency: 1,
frequencyDefault: 1,
allowed() {
return true
},
allowed: () => true,
requires: "",
effect() {
tech.isDroneOnDamage = true;
@@ -2376,9 +2435,7 @@ const tech = {
count: 0,
frequency: 1,
frequencyDefault: 1,
allowed() {
return true
},
allowed: () => true,
requires: "",
effect() {
tech.isLowEnergyDamage = true;
@@ -3304,9 +3361,7 @@ const tech = {
count: 0,
frequency: 1,
frequencyDefault: 1,
allowed() {
return true
},
allowed: () => true,
requires: "",
effect() {
tech.isBoostPowerUps = true
@@ -3406,7 +3461,7 @@ const tech = {
{
name: "field coupling",
descriptionFunction() {
return `<strong>+1</strong> <strong class='color-coupling'>coupling</strong> <em>(${m.fieldUpgrades[m.fieldMode].name})</em><br>${ m.couplingDescription()} ${m.fieldMode === 0 ? "" : "per <strong class='color-coupling'>coupling</strong>"}`
return `spawn ${powerUps.orb.coupling(10)}<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>"}`
},
maxCount: 9,
count: 0,
@@ -3417,19 +3472,27 @@ const tech = {
},
requires: "",
effect() {
simulation.makeTextLog(`m.coupling <span class='color-symbol'>+=</span> 1`);
m.coupling += 1
m.couplingChange()
powerUps.spawnDelay("coupling", 10)
},
remove() {
m.coupling -= this.count
m.couplingChange()
if (this.count) {
m.couplingChange(-this.count)
}
}
},
{
name: "quintessence",
descriptionFunction() {
return `use all your ${powerUps.orb.research(1)} to get <strong>+${this.count ? this.researchUsed*this.couplingToResearch:powerUps.research.count*this.couplingToResearch}</strong> <strong class='color-coupling'>coupling</strong><br>${ m.couplingDescription()} ${m.fieldMode === 0 ? "" : "per <strong class='color-coupling'>coupling</strong>"}`
let converted = powerUps.research.count * this.couplingToResearch
if (this.count) converted = this.researchUsed * this.couplingToResearch
let orbText
if (converted > 20) {
orbText = `${converted} ${powerUps.orb.coupling()}`
} else {
orbText = powerUps.orb.coupling(converted)
}
return `use all your ${powerUps.orb.research(1)} to spawn <strong>${orbText}<br></strong>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>"}`
},
maxCount: 1,
count: 0,
@@ -3442,35 +3505,32 @@ const tech = {
researchUsed: 0,
couplingToResearch: 0.25,
effect() {
let count = 0
while (powerUps.research.count > 0) {
powerUps.research.changeRerolls(-1)
count += 10
this.researchUsed++
simulation.makeTextLog(`m.coupling <span class='color-symbol'>+=</span> ${(this.couplingToResearch).toFixed(2)}`);
m.coupling += this.couplingToResearch
}
m.couplingChange()
powerUps.spawnDelay("coupling", count)
},
remove() {
if (this.count) {
m.coupling -= this.researchUsed * this.couplingToResearch
m.couplingChange(-this.researchUsed * this.couplingToResearch)
powerUps.research.changeRerolls(this.researchUsed)
this.researchUsed = 0
}
m.couplingChange()
}
},
{
name: "virtual particles",
descriptionFunction() {
return `after mobs <strong>die</strong> they have a <strong>17%</strong> chance to<br>spawn ${powerUps.orb.coupling(1)} that give <strong>+0.1</strong> <strong class='color-coupling'>coupling</strong>`
return `after mobs <strong>die</strong> they have a <strong>17%</strong> chance to<br>spawn ${powerUps.orb.coupling(1)} 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>"}`
},
maxCount: 1,
count: 0,
frequency: 1,
frequencyDefault: 1,
allowed() {
return true
},
allowed: () => true,
requires: "",
effect() {
tech.isCouplingPowerUps = true //about 20-30 mobs per level so at 16% and 0.1 coupling that's about 25 * 0.16 * 0.1 = 0.4 coupling per level with out duplication
@@ -3482,38 +3542,35 @@ const tech = {
{
name: "fine-structure constant",
descriptionFunction() {
return `+${this.value} <strong class='color-coupling'>coupling</strong>, <span style = 'font-size:85%;'><strong>eject</strong> this <strong class='color-m'>tech</strong> after losing <strong class='color-h'>health</strong></span><br>${ m.couplingDescription()} ${m.fieldMode === 0 ? "" : "per <strong class='color-coupling'>coupling</strong>"}`
return `spawn ${this.value} ${powerUps.orb.coupling(1)} that each give <strong>+0.1</strong> <strong class='color-coupling'>coupling</strong>
<br><strong>-0.5</strong> <strong class='color-coupling'>coupling</strong> after mob <strong>collisions</strong>
<br>${m.couplingDescription(1)} ${m.fieldMode === 0 ? "" : "per <strong class='color-coupling'>coupling</strong>"}`
},
maxCount: 1,
count: 0,
frequency: 1,
frequencyDefault: 100,
allowed() {
return true
},
value: 6,
isNonRefundable: true,
allowed: () => true,
value: 60,
requires: "",
effect() {
tech.isCouplingNoHit = true
simulation.makeTextLog(`m.coupling <span class='color-symbol'>+=</span> ${(this.value).toFixed(1)}`);
m.coupling += this.value
m.couplingChange()
this.maxCount = 0
powerUps.spawnDelay("coupling", this.value)
},
remove() {
if (this.count) {
m.coupling -= this.value
m.couplingChange()
} else {
this.maxCount = 1
}
// if (this.count) {
// m.couplingChange(-this.value)
// } else {
// this.maxCount = 1 //reset only take this once per game
// }
tech.isCouplingNoHit = false
}
},
{
name: "residual dipolar coupling",
descriptionFunction() {
return `clicking <strong style = 'font-size:150%;'>×</strong> to <strong>cancel</strong> yields <strong>+0.5</strong> <strong class='color-coupling'>coupling</strong><br>${ m.couplingDescription()} ${m.fieldMode === 0 ? "" : "per <strong class='color-coupling'>coupling</strong>"}`
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>spawns ${powerUps.orb.coupling(5)}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>"}`
},
maxCount: 1,
count: 0,
@@ -3530,6 +3587,24 @@ const tech = {
tech.isCancelCouple = false
}
},
{
name: "commodities exchange",
description: `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>spawns <strong>5-10</strong> ${powerUps.orb.heal()}, ${powerUps.orb.ammo()}, or ${powerUps.orb.research(1)}`,
maxCount: 1,
count: 0,
frequency: 1,
frequencyDefault: 1,
allowed() {
return !tech.isSuperDeterminism
},
requires: "not superdeterminism",
effect() {
tech.isCancelRerolls = true
},
remove() {
tech.isCancelRerolls = false
}
},
{
name: "options exchange",
link: `<a target="_blank" href='https://en.wikipedia.org/wiki/Option_(finance)' class="link">options exchange</a>`,
@@ -3549,24 +3624,6 @@ const tech = {
tech.isCancelTech = false
}
},
{
name: "commodities exchange",
description: `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>spawns <strong>5-10</strong> ${powerUps.orb.heal()}, ${powerUps.orb.ammo()}, or ${powerUps.orb.research(1)}`,
maxCount: 1,
count: 0,
frequency: 1,
frequencyDefault: 1,
allowed() {
return !tech.isSuperDeterminism
},
requires: "not superdeterminism",
effect() {
tech.isCancelRerolls = true
},
remove() {
tech.isCancelRerolls = false
}
},
{
name: "futures exchange",
description: "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.5%</strong> power up <strong class='color-dup'>duplication</strong> chance",
@@ -3797,7 +3854,7 @@ const tech = {
if (tech.tech[i].count > 0 && !tech.tech[i].isNonRefundable) have.push(i)
}
const choose = have[Math.floor(Math.random() * have.length)]
simulation.makeTextLog(`<span class='color-var'>tech</span>.removeTech("<span class='color-text'>${tech.tech[choose].name}</span>")`)
simulation.makeTextLog(`<span class='color-var'>tech</span>.removeTech("<span class='color-text'>${tech.tech[choose].name}</span>")`, 360)
for (let i = 0; i < tech.tech[choose].count; i++) {
powerUps.spawn(m.pos.x, m.pos.y, "gun");
}
@@ -6217,9 +6274,9 @@ const tech = {
frequency: 2,
frequencyDefault: 2,
allowed() {
return tech.haveGunCheck("laser") || (tech.haveGunCheck("harpoon") && !tech.isRailGun)
return tech.haveGunCheck("laser") || (tech.haveGunCheck("harpoon") && !tech.isRailGun) && !tech.isEnergyNoAmmo
},
requires: "harpoon, laser, not railgun",
requires: "harpoon, laser, not railgun, non-renewables",
effect() {
tech.isBoostReplaceAmmo = true
for (let i = powerUp.length - 1; i > -1; i--) {
@@ -6272,7 +6329,7 @@ const tech = {
//pick one option
if (options.length) {
const index = options[Math.floor(Math.random() * options.length)]
simulation.makeTextLog(`<span class='color-var'>tech</span>.giveTech("<span class='color-text'>${tech.tech[index].name}</span>") <em>//optical amplifier</em>`);
simulation.makeTextLog(`<span class='color-var'>tech</span>.giveTech("<span class='color-text'>${tech.tech[index].name}</span>") <em>//optical amplifier</em>`, 360);
tech.giveTech(index)
techGiven++
}
@@ -7647,7 +7704,7 @@ const tech = {
},
{
name: "WIMPs",
description: `at the end of each <strong>level</strong> spawn ${powerUps.orb.research(5)}<br> and a <strong class='color-defense'>harmful</strong> particle that slowly <strong>chases</strong> you`,
description: `at the end of each <strong>level</strong> spawn ${powerUps.orb.research(5)}<br> and a dangerous particle that slowly <strong>chases</strong> you`,
isFieldTech: true,
maxCount: 9,
count: 0,
@@ -8041,6 +8098,41 @@ const tech = {
// },
// remove() {}
// },
{
name: "boost",
maxCount: 1,
count: 0,
frequency: 0,
isJunk: true,
allowed() {
return !build.isExperimentSelection
},
requires: "NOT EXPERIMENT MODE",
effect() {
powerUps.spawnDelay("boost", this.spawnCount)
},
remove() {},
id: 0,
text: "",
delay: 100,
spawnCount: 0,
descriptionFunction() {
let count = 9999 * Math.random()
const loop = () => {
if ((simulation.isChoosing) && m.alive && !build.isExperimentSelection) { //&& (!simulation.isChoosing || this.count === 0) //simulation.paused ||
count += 4.5
const waves = 2 * Math.sin(count * 0.0133) + Math.sin(count * 0.013) + 0.5 * Math.sin(count * 0.031) + 0.33 * Math.sin(count * 0.03)
this.spawnCount = Math.floor(100 * Math.abs(waves))
this.text = `spawn <strong style = "font-family: 'Courier New', monospace;">${this.spawnCount.toLocaleString(undefined, {minimumIntegerDigits:3})}</strong> ${powerUps.orb.boost(1)}<br>that give <strong>+${(powerUps.boost.damage*100).toFixed(0)}%</strong> <strong class='color-d'>damage</strong> for <strong>${(powerUps.boost.duration/60).toFixed(0)}</strong> seconds</span>`
if (document.getElementById(`boost-JUNK-id${this.id}`)) document.getElementById(`boost-JUNK-id${this.id}`).innerHTML = this.text
setTimeout(() => { loop() }, this.delay);
}
}
setTimeout(() => { loop() }, this.delay);
this.id++
return `<span id = "boost-JUNK-id${this.id}">${this.text}</span>`
},
},
{
name: "return",
description: "return to the introduction level<br>reduce combat <strong>difficulty</strong> by <strong>2 levels</strong>",
@@ -8049,9 +8141,7 @@ const tech = {
frequency: 0,
isJunk: true,
isNonRefundable: true,
allowed() {
return true
},
allowed: () => true,
requires: "",
effect() {
level.difficultyDecrease(simulation.difficultyMode * 2)
@@ -8068,9 +8158,7 @@ const tech = {
frequency: 0,
isJunk: true,
isNonRefundable: true,
allowed() {
return true
},
allowed: () => true,
requires: "",
effect() {
setInterval(() => {
@@ -8094,9 +8182,7 @@ const tech = {
frequency: 0,
isJunk: true,
isNonRefundable: true,
allowed() {
return true
},
allowed: () => true,
requires: "",
effect() {
setInterval(() => {
@@ -8136,9 +8222,7 @@ const tech = {
frequency: 0,
isJunk: true,
isNonRefundable: true,
allowed() {
return true
},
allowed: () => true,
requires: "",
effect() {
for (let i = 0; i < 5; i++) powerUps.spawn(m.pos.x + 10 * Math.random(), m.pos.y + 10 * Math.random(), "field");
@@ -8215,9 +8299,7 @@ const tech = {
frequency: 0,
isJunk: true,
isNonRefundable: true,
allowed() {
return true
},
allowed: () => true,
requires: "",
effect() {
tech.giveRandomJUNK()
@@ -8253,9 +8335,7 @@ const tech = {
frequencyDefault: 0,
isJunk: true,
isNonRefundable: true,
allowed() {
return true
},
allowed: () => true,
requires: "",
effect() {
powerUps.spawn(m.pos.x, m.pos.y, "tech");
@@ -8289,9 +8369,7 @@ const tech = {
frequencyDefault: 0,
isJunk: true,
isNonRefundable: true,
allowed() {
return true
},
allowed: () => true,
requires: "",
effect() {
for (let i = 0, len = mob.length; i < len; i++) {
@@ -8317,9 +8395,7 @@ const tech = {
frequency: 0,
frequencyDefault: 0,
isJunk: true,
allowed() {
return true
},
allowed: () => true,
requires: "",
effect() {
@@ -8336,9 +8412,7 @@ const tech = {
frequency: 0,
frequencyDefault: 0,
isJunk: true,
allowed() {
return true
},
allowed: () => true,
requires: "",
effect() {
tech.isBrainstorm = true
@@ -9982,9 +10056,7 @@ const tech = {
count: 0,
frequency: 0,
isJunk: true,
allowed() {
return true
},
allowed: () => true,
requires: "",
effect() {},
remove() {},
@@ -10046,9 +10118,7 @@ const tech = {
count: 0,
frequency: 0,
isJunk: true,
allowed() {
return true
},
allowed: () => true,
requires: "",
effect() {},
remove() {},
@@ -10191,9 +10261,7 @@ const tech = {
frequency: 0,
isJunk: true,
isNonRefundable: true,
allowed() {
return true
},
allowed: () => true,
requires: "",
effect() {
localSettings.personalSeeds.push(Math.initialSeed)
@@ -10672,5 +10740,6 @@ const tech = {
isCancelCouple: null,
isCouplingPowerUps: null,
isBoostPowerUps: null,
isBoostReplaceAmmo: null
isBoostReplaceAmmo: null,
isFlipFlopCoupling: null
}