diff --git a/js/bullet.js b/js/bullet.js
index 752a589..0f32794 100644
--- a/js/bullet.js
+++ b/js/bullet.js
@@ -397,7 +397,7 @@ const b = {
//player damage
if (Vector.magnitude(Vector.sub(where, player.position)) < radius) {
- const DRAIN = (tech.isExplosionHarm ? 0.63 : 0.45) * (tech.isRadioactiveResistance ? 0.25 : 1)
+ const DRAIN = (tech.isExplosionHarm ? 0.6 : 0.45) * (tech.isRadioactiveResistance ? 0.25 : 1)
if (m.immuneCycle < m.cycle) m.energy -= DRAIN
if (m.energy < 0) {
m.energy = 0
@@ -446,7 +446,7 @@ const b = {
if (dist < radius) {
if (simulation.dmgScale) {
- const harm = tech.isExplosionHarm ? 0.07 : 0.05
+ const harm = tech.isExplosionHarm ? 0.067 : 0.05
if (tech.isImmuneExplosion && m.energy > 0.25) {
// const mitigate = Math.min(1, Math.max(1 - m.energy * 0.5, 0))
m.energy -= 0.25
@@ -3534,7 +3534,7 @@ const b = {
restitution: 0,
density: 0.0005, // 0.001 is normal density
lookFrequency: 19 + Math.floor(7 * Math.random()),
- endCycle: simulation.cycle + Math.floor((900 * tech.isBulletsLastLonger + 360 * Math.random()) + Math.max(0, 150 - bullet.length)), // 13 - 19s
+ endCycle: simulation.cycle + Math.floor((900 * tech.isBulletsLastLonger + 420 * Math.random()) + Math.max(0, 150 - bullet.length)), // 13 - 19s
classType: "bullet",
collisionFilter: {
category: cat.bullet,
@@ -3550,7 +3550,7 @@ const b = {
},
beforeDmg(who) {
Matter.Body.setVelocity(this, Vector.mult(Vector.normalise(Vector.sub(this.position, who.position)), 10 + 10 * Math.random())); //push away from target
- this.endCycle -= 180
+ this.endCycle -= 130
this.cd = simulation.cycle + this.delay;
if (tech.isSporeFreeze) mobs.statusSlow(who, 90)
if (tech.isSpawnBulletsOnDeath && who.alive && who.isDropPowerUp) {
diff --git a/js/index.js b/js/index.js
index 58adc99..24aad57 100644
--- a/js/index.js
+++ b/js/index.js
@@ -108,7 +108,7 @@ function getUrlVars() {
window.addEventListener('load', () => {
const set = getUrlVars()
if (Object.keys(set).length !== 0) {
- build.populateGrid() //trying to solve a bug with this, but maybe it doesn't help
+ // build.populateGrid() //trying to solve a bug with this, but maybe it doesn't help
openExperimentMenu();
//add experimental selections based on url
for (const property in set) {
@@ -166,6 +166,8 @@ window.addEventListener('load', () => {
// Math.seed = Math.abs(Math.hash(Math.initialSeed))
// level.populateLevels()
// }
+ requestAnimationFrame(() => { build.sortTech('have', true) });
+
}
} else if (localSettings.isTrainingNotAttempted && localSettings.runCount < 30) { //make training button more obvious for new players
// document.getElementById("training-button").style.border = "0px #333 solid";
@@ -457,7 +459,7 @@ ${simulation.isCheating ? "
lore disabled" : ""}
-
+
`;
// const style = (tech.isPauseEjectTech && !simulation.isChoosing) ? 'style="animation: techColorCycle 1s linear infinite alternate;"' : ''
@@ -513,7 +515,7 @@ ${simulation.isCheating ? "
lore disabled" : ""}
el.style.display = "grid"
el.innerHTML = text
},
- sortTech(find) {
+ sortTech(find, isExperiment = false) {
const sortKeyword = (a, b) => {
let aHasKeyword = (a.descriptionFunction ? a.descriptionFunction() : a.description).includes(find) || a.name.includes(find)
let bHasKeyword = (b.descriptionFunction ? b.descriptionFunction() : b.description).includes(find) || b.name.includes(find)
@@ -524,39 +526,89 @@ ${simulation.isCheating ? "
lore disabled" : ""}
if (find === 'guntech') {
tech.tech.sort((a, b) => {
+ if (a.isGunTech && b.isGunTech) {
+ if (a.allowed() > b.allowed()) return -1; //sort to the top
+ if (!a.allowed() < b.allowed()) return 1; //sort to the bottom
+ }
if (a.isGunTech && !b.isGunTech) return -1; //sort to the top
if (!a.isGunTech && b.isGunTech) return 1; //sort to the bottom
return 0;
});
} else if (find === 'fieldtech') {
tech.tech.sort((a, b) => {
+ if (a.isFieldTech && b.isFieldTech) {
+ if (a.allowed() > b.allowed()) return -1; //sort to the top
+ if (!a.allowed() < b.allowed()) return 1; //sort to the bottom
+ }
if (a.isFieldTech && !b.isFieldTech) return -1; //sort to the top
if (!a.isFieldTech && b.isFieldTech) return 1; //sort to the bottom
return 0;
});
+ } else if (find === 'allowed') {
+ tech.tech.sort((a, b) => {
+ if (a.allowed() > b.allowed()) return -1; //sort to the top
+ if (!a.allowed() < b.allowed()) return 1; //sort to the bottom
+ return 0;
+ });
+ } else if (find === 'have') {
+ tech.tech.sort((a, b) => {
+ if (a.count > b.count) return -1; //sort to the top
+ if (!a.count < b.count) return 1; //sort to the bottom
+ return 0;
+ });
+ } else if (find === 'heal') {
+ tech.tech.sort((a, b) => {
+ if (a.isHealTech && b.isHealTech) {
+ if (a.allowed() > b.allowed()) return -1; //sort to the top
+ if (!a.allowed() < b.allowed()) return 1; //sort to the bottom
+ }
+ if (a.isHealTech && !b.isHealTech) return -1; //sort to the top
+ if (!a.isHealTech && b.isHealTech) return 1; //sort to the bottom
+ return 0;
+ });
+ } else if (find === 'bot') {
+ tech.tech.sort((a, b) => {
+ if (a.isBotTech && b.isBotTech) {
+ if (a.allowed() > b.allowed()) return -1; //sort to the top
+ if (!a.allowed() < b.allowed()) return 1; //sort to the bottom
+ }
+ if (a.isBotTech && !b.isBotTech) return -1; //sort to the top
+ if (!a.isBotTech && b.isBotTech) return 1; //sort to the bottom
+ return 0;
+ });
+ } else if (document.getElementById("sort-input").value === 'skin') {
+ tech.tech.sort((a, b) => {
+ if (a.isSkin && b.isSkin) {
+ if (a.allowed() > b.allowed()) return -1; //sort to the top
+ if (!a.allowed() < b.allowed()) return 1; //sort to the bottom
+ }
+ if (a.isSkin && !b.isSkin) return -1; //sort to the top
+ if (!a.isSkin && b.isSkin) return 1; //sort to the bottom
+ return 0;
+ });
+ } else if (document.getElementById("sort-input").value === 'junk') {
+ tech.tech.sort((a, b) => {
+ if (a.isJunk && !b.isJunk) return -1; //sort to the top
+ if (!a.isJunk && b.isJunk) return 1; //sort to the bottom
+ return 0;
+ });
} else if (find === 'damage') {
tech.tech.sort(sortKeyword);
} else if (find === 'defense') {
tech.tech.sort(sortKeyword);
} else if (find === 'energy') {
tech.tech.sort(sortKeyword);
- } else if (find === 'heal') {
- tech.tech.sort((a, b) => {
- if (a.isHealTech && !b.isHealTech) return -1; //sort to the top
- if (!a.isHealTech && b.isHealTech) return 1; //sort to the bottom
- return 0;
- });
- } else if (find === 'bot') {
- tech.tech.sort((a, b) => {
- if (a.isBotTech && !b.isBotTech) return -1; //sort to the top
- if (!a.isBotTech && b.isBotTech) return 1; //sort to the bottom
- return 0;
- });
} else if (find === 'input') {
find = document.getElementById("sort-input").value;
tech.tech.sort(sortKeyword);
}
- build.generatePauseRight() //makes the right side of the pause menu with the tech
+ if (isExperiment) {
+ build.populateGrid()
+ // build.updateExperimentText()
+ document.getElementById("tech-0").scrollIntoView(); //scroll to the first tech after sorting
+ } else {
+ build.generatePauseRight() //makes the right side of the pause menu with the tech
+ }
document.getElementById("sort-input").value = find; //make the sorted string display in the keyword search input field
},
unPauseGrid() {
@@ -675,7 +727,9 @@ ${simulation.isCheating ? "
lore disabled" : ""}
}, 50);
}
}
- //update tech text
+ build.updateExperimentText(isAllowed)
+ },
+ updateExperimentText(isAllowed = false) {
for (let i = 0, len = tech.tech.length; i < len; i++) {
const techID = document.getElementById("tech-" + i)
if ((!tech.tech[i].isJunk || localSettings.isJunkExperiment) && !tech.tech[i].isLore) {
@@ -726,69 +780,76 @@ ${simulation.isCheating ? "
lore disabled" : ""}
},
populateGrid() { //background-color:var(--build-bg-color);
let text = `
-