borders for no image selection menu
mob damage difficulty setting is lower recycling now flashes green when it heals merged cancel and research bars for single column selection added some dark grey borders for no images selection mode new images with midJourney V5 spores, pilot wave, standing wave bug fixes
|
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 69 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 47 KiB |
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 79 KiB |
@@ -106,6 +106,7 @@
|
|||||||
<option value="staircase">
|
<option value="staircase">
|
||||||
<option value="perplex">
|
<option value="perplex">
|
||||||
<option value="n-gon">
|
<option value="n-gon">
|
||||||
|
<option value="buttonbutton">
|
||||||
<option value="vats">
|
<option value="vats">
|
||||||
<option value="yingYang">
|
<option value="yingYang">
|
||||||
<option value="basement">
|
<option value="basement">
|
||||||
|
|||||||
4433
js/bullet.js
127
js/index.js
@@ -14,7 +14,7 @@ Math.hash = s => {
|
|||||||
|
|
||||||
document.getElementById("seed").placeholder = Math.initialSeed = String(Math.floor(Date.now() % 100000))
|
document.getElementById("seed").placeholder = Math.initialSeed = String(Math.floor(Date.now() % 100000))
|
||||||
Math.seed = Math.abs(Math.hash(Math.initialSeed)) //update randomizer seed in case the player changed it
|
Math.seed = Math.abs(Math.hash(Math.initialSeed)) //update randomizer seed in case the player changed it
|
||||||
Math.seededRandom = function(min = 0, max = 1) { // in order to work 'Math.seed' must NOT be undefined
|
Math.seededRandom = function (min = 0, max = 1) { // in order to work 'Math.seed' must NOT be undefined
|
||||||
Math.seed = (Math.seed * 9301 + 49297) % 233280;
|
Math.seed = (Math.seed * 9301 + 49297) % 233280;
|
||||||
return min + Math.seed / 233280 * (max - min);
|
return min + Math.seed / 233280 * (max - min);
|
||||||
}
|
}
|
||||||
@@ -100,7 +100,7 @@ let color = { //light
|
|||||||
//difficulty is 0 easy, 1 normal, 2 hard, 4 why
|
//difficulty is 0 easy, 1 normal, 2 hard, 4 why
|
||||||
function getUrlVars() {
|
function getUrlVars() {
|
||||||
let vars = {};
|
let vars = {};
|
||||||
window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m, k, v) {
|
window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (m, k, v) {
|
||||||
vars[k] = v;
|
vars[k] = v;
|
||||||
});
|
});
|
||||||
return vars;
|
return vars;
|
||||||
@@ -201,7 +201,7 @@ const ctx = canvas.getContext("2d");
|
|||||||
document.body.style.backgroundColor = "#fff";
|
document.body.style.backgroundColor = "#fff";
|
||||||
|
|
||||||
//disable pop up menu on right click
|
//disable pop up menu on right click
|
||||||
document.oncontextmenu = function() {
|
document.oncontextmenu = function () {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -287,18 +287,18 @@ const build = {
|
|||||||
localSettings.isHideImages = !localSettings.isHideImages
|
localSettings.isHideImages = !localSettings.isHideImages
|
||||||
if (localSettings.isAllowed) localStorage.setItem("localSettings", JSON.stringify(localSettings)); //update local storage
|
if (localSettings.isAllowed) localStorage.setItem("localSettings", JSON.stringify(localSettings)); //update local storage
|
||||||
if (from === 'experiment') {
|
if (from === 'experiment') {
|
||||||
// build.startExperiment()
|
|
||||||
// openExperimentMenu()
|
|
||||||
build.reset();
|
build.reset();
|
||||||
// build.populateGrid();
|
|
||||||
// build.choosePowerUp(null, 'none')
|
|
||||||
} else if (from === 'pause') {
|
} else if (from === 'pause') {
|
||||||
build.unPauseGrid()
|
build.unPauseGrid()
|
||||||
build.pauseGrid() //redraw pause text with images
|
build.pauseGrid() //redraw pause text with images
|
||||||
} else { //settings
|
|
||||||
//nothing needs to be here I think
|
|
||||||
}
|
}
|
||||||
|
if (localSettings.isHideImages) {
|
||||||
|
document.getElementById("choose-grid").classList.add('choose-grid-no-images');
|
||||||
|
document.getElementById("choose-grid").classList.remove('choose-grid');
|
||||||
|
} else {
|
||||||
|
document.getElementById("choose-grid").classList.add('choose-grid');
|
||||||
|
document.getElementById("choose-grid").classList.remove('choose-grid-no-images');
|
||||||
|
}
|
||||||
document.getElementById("hide-images").checked = localSettings.isHideImages
|
document.getElementById("hide-images").checked = localSettings.isHideImages
|
||||||
// console.log(localSettings.isHideImages, from)
|
// console.log(localSettings.isHideImages, from)
|
||||||
},
|
},
|
||||||
@@ -331,30 +331,30 @@ const build = {
|
|||||||
</svg><span style="font-size:1.5em;font-weight: 600; float: right;">PAUSED</span>
|
</svg><span style="font-size:1.5em;font-weight: 600; float: right;">PAUSED</span>
|
||||||
<br>
|
<br>
|
||||||
<label for="hide-images-pause" title="hide images for fields, guns, and tech" style="font-size:1.3em;" >hide images:</label>
|
<label for="hide-images-pause" title="hide images for fields, guns, and tech" style="font-size:1.3em;" >hide images:</label>
|
||||||
<input onclick="build.showImages('pause')" type="checkbox" id="hide-images-pause" name="hide-images-pause" ${localSettings.isHideImages? "checked": ""}>
|
<input onclick="build.showImages('pause')" type="checkbox" id="hide-images-pause" name="hide-images-pause" ${localSettings.isHideImages ? "checked" : ""}>
|
||||||
<span style="float: right;">press ${input.key.pause} to resume</span>
|
<span style="float: right;">press ${input.key.pause} to resume</span>
|
||||||
<br>
|
<br>
|
||||||
<br><strong class='color-d'>damage</strong>: ${((tech.damageFromTech())).toPrecision(4)} difficulty: ${((m.dmgScale)).toPrecision(4)}
|
<br><strong class='color-d'>damage</strong>: ${((tech.damageFromTech())).toPrecision(4)} difficulty: ${((m.dmgScale)).toPrecision(4)}
|
||||||
<br><strong class='color-defense'>defense</strong>: ${tech.isEnergyHealth ? (1-Math.pow(m.defense(), 0.13)).toPrecision(5) : (1-m.defense()).toPrecision(5) } difficulty: ${(1/simulation.dmgScale).toPrecision(4)}
|
<br><strong class='color-defense'>defense</strong>: ${tech.isEnergyHealth ? (1 - Math.pow(m.defense(), 0.13)).toPrecision(5) : (1 - m.defense()).toPrecision(5)} difficulty: ${(1 / simulation.dmgScale).toPrecision(4)}
|
||||||
<br><strong><em>fire rate</em></strong>: ${((1-b.fireCDscale)*100).toFixed(b.fireCDscale < 0.1 ? 2 : 0)}%
|
<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)}%`: ""}
|
${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)} <span style = 'font-size:90%;'>`+m.couplingDescription()+"</span>": ""}
|
${m.coupling ? `<br><strong class='color-coupling'>coupling</strong>: ${(m.coupling).toFixed(2)} <span style = 'font-size:90%;'>` + m.couplingDescription() + "</span>" : ""}
|
||||||
${botText}
|
${botText}
|
||||||
<br>
|
<br>
|
||||||
<br><strong class='color-h'>health</strong>: (${(m.health*100).toFixed(0)} / ${(m.maxHealth*100).toFixed(0)})
|
<br><strong class='color-h'>health</strong>: (${(m.health * 100).toFixed(0)} / ${(m.maxHealth * 100).toFixed(0)})
|
||||||
<span style="float: right;">mass: ${player.mass.toFixed(1)}</span>
|
<span style="float: right;">mass: ${player.mass.toFixed(1)}</span>
|
||||||
<br><strong class='color-f'>energy</strong>: (${(m.energy*100).toFixed(0)} / ${(m.maxEnergy*100).toFixed(0)}) +(${(m.fieldRegen*6000).toFixed(0)}/s)
|
<br><strong class='color-f'>energy</strong>: (${(m.energy * 100).toFixed(0)} / ${(m.maxEnergy * 100).toFixed(0)}) + (${(m.fieldRegen * 6000).toFixed(0)}/s)
|
||||||
<span style="float: right;">position: (${player.position.x.toFixed(1)}, ${player.position.y.toFixed(1)})</span>
|
<span style="float: right;">position: (${player.position.x.toFixed(1)}, ${player.position.y.toFixed(1)})</span>
|
||||||
<br><strong class='color-g'>gun</strong>: ${b.activeGun === null || b.activeGun === undefined ? "undefined":b.guns[b.activeGun].name} <strong class='color-g'>ammo</strong>: ${b.activeGun === null || b.activeGun === undefined ? "0":b.guns[b.activeGun].ammo}
|
<br><strong class='color-g'>gun</strong>: ${b.activeGun === null || b.activeGun === undefined ? "undefined" : b.guns[b.activeGun].name} <strong class='color-g'>ammo</strong>: ${b.activeGun === null || b.activeGun === undefined ? "0" : b.guns[b.activeGun].ammo}
|
||||||
<span style="float: right;">mouse: (${simulation.mouseInGame.x.toFixed(1)}, ${simulation.mouseInGame.y.toFixed(1)})</span>
|
<span style="float: right;">mouse: (${simulation.mouseInGame.x.toFixed(1)}, ${simulation.mouseInGame.y.toFixed(1)})</span>
|
||||||
<br><strong class='color-m'>tech</strong>: ${tech.totalCount} <strong class='color-r'>research</strong>: ${powerUps.research.count}
|
<br><strong class='color-m'>tech</strong>: ${tech.totalCount} <strong class='color-r'>research</strong>: ${powerUps.research.count}
|
||||||
<span style="float: right;">velocity: (${player.velocity.x.toFixed(3)}, ${player.velocity.y.toFixed(3)})</span>
|
<span style="float: right;">velocity: (${player.velocity.x.toFixed(3)}, ${player.velocity.y.toFixed(3)})</span>
|
||||||
${junkCount ? `<br><strong class='color-junk'>JUNK</strong>: ${(junkCount / totalCount * 100).toFixed(1)}% `: ""}
|
${junkCount ? `<br><strong class='color-junk'>JUNK</strong>: ${(junkCount / totalCount * 100).toFixed(1)}% ` : ""}
|
||||||
<br>
|
<br>
|
||||||
<br>level: ${level.levelsCleared} ${level.levels[level.onLevel]} (${level.difficultyText()})
|
<br>level: ${level.levelsCleared} ${level.levels[level.onLevel]} (${level.difficultyText()})
|
||||||
<br>seed: ${Math.initialSeed} ${m.cycle} cycles
|
<br>seed: ${Math.initialSeed} ${m.cycle} cycles
|
||||||
<br>mobs: ${mob.length} blocks: ${body.length} bullets: ${bullet.length} power ups: ${powerUp.length}
|
<br>mobs: ${mob.length} blocks: ${body.length} bullets: ${bullet.length} power ups: ${powerUp.length}
|
||||||
${simulation.isCheating ? "<br><br><em>lore disabled</em>": ""}
|
${simulation.isCheating ? "<br><br><em>lore disabled</em>" : ""}
|
||||||
</span></div>`;
|
</span></div>`;
|
||||||
// deaths: ${mobs.mobDeaths}
|
// deaths: ${mobs.mobDeaths}
|
||||||
if (tech.isPauseSwitchField && !simulation.isChoosing) {
|
if (tech.isPauseSwitchField && !simulation.isChoosing) {
|
||||||
@@ -415,7 +415,7 @@ ${simulation.isCheating ? "<br><br><em>lore disabled</em>": ""}
|
|||||||
const style = (localSettings.isHideImages || tech.tech[i].isJunk || tech.tech[i].isLore) ? `style="height:auto;"` : `style = "background-image: url('img/${tech.tech[i].name}.webp');"`
|
const style = (localSettings.isHideImages || tech.tech[i].isJunk || tech.tech[i].isLore) ? `style="height:auto;"` : `style = "background-image: url('img/${tech.tech[i].name}.webp');"`
|
||||||
const techCountText = tech.tech[i].count > 1 ? `(${tech.tech[i].count}x)` : "";
|
const techCountText = tech.tech[i].count > 1 ? `(${tech.tech[i].count}x)` : "";
|
||||||
if (tech.tech[i].isNonRefundable) {
|
if (tech.tech[i].isNonRefundable) {
|
||||||
text += `<div class="pause-grid-module" id ="${i}-pause-tech" style = "border: 0px; opacity:0.5; font-size: 60%; line-height: 130%; margin: 1px; padding: 6px;"><div class="grid-title">${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" style = "border: 0px; opacity:0.5; font-size: 60%; line-height: 130%; margin: 1px; padding: 6px;"><div class="grid-title">${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].isLore) {
|
// } else if (tech.tech[i].isLore) {
|
||||||
// text += `<div class="pause-grid-module"><div class="grid-title lore-text"><div class="circle-grid lore"></div> ${tech.tech[i].name} ${techCountText}</div>${tech.tech[i].descriptionFunction ? tech.tech[i].descriptionFunction() :tech.tech[i].description}</div></div>`
|
// text += `<div class="pause-grid-module"><div class="grid-title lore-text"><div class="circle-grid lore"></div> ${tech.tech[i].name} ${techCountText}</div>${tech.tech[i].descriptionFunction ? tech.tech[i].descriptionFunction() :tech.tech[i].description}</div></div>`
|
||||||
} else if (tech.tech[i].isFieldTech) {
|
} else if (tech.tech[i].isFieldTech) {
|
||||||
@@ -432,7 +432,7 @@ ${simulation.isCheating ? "<br><br><em>lore disabled</em>": ""}
|
|||||||
text += build.techText(i) + "</div>"
|
text += build.techText(i) + "</div>"
|
||||||
}
|
}
|
||||||
} else if (tech.tech[i].isLost) {
|
} 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>`
|
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>`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
el = document.getElementById("pause-grid-right")
|
el = document.getElementById("pause-grid-right")
|
||||||
@@ -478,7 +478,7 @@ ${simulation.isCheating ? "<br><br><em>lore disabled</em>": ""}
|
|||||||
techText(i) {
|
techText(i) {
|
||||||
return `<div class="card-text" >
|
return `<div class="card-text" >
|
||||||
<div class="grid-title" ><div class="circle-grid tech"></div> ${build.nameLink(tech.tech[i].name)} ${tech.tech[i].count > 1 ? `(${tech.tech[i].count}x)` : ""}</div>
|
<div class="grid-title" ><div class="circle-grid tech"></div> ${build.nameLink(tech.tech[i].name)} ${tech.tech[i].count > 1 ? `(${tech.tech[i].count}x)` : ""}</div>
|
||||||
${tech.tech[i].descriptionFunction ? tech.tech[i].descriptionFunction() :tech.tech[i].description}</div>`
|
${tech.tech[i].descriptionFunction ? tech.tech[i].descriptionFunction() : tech.tech[i].description}</div>`
|
||||||
},
|
},
|
||||||
skinTechText(i) {
|
skinTechText(i) {
|
||||||
return `<div class="card-text"> <div class="grid-title">
|
return `<div class="card-text"> <div class="grid-title">
|
||||||
@@ -486,7 +486,7 @@ ${simulation.isCheating ? "<br><br><em>lore disabled</em>": ""}
|
|||||||
<div class="circle-grid-skin"></div>
|
<div class="circle-grid-skin"></div>
|
||||||
<div class="circle-grid-skin-eye"></div>
|
<div class="circle-grid-skin-eye"></div>
|
||||||
</span> ${build.nameLink(tech.tech[i].name)} ${tech.tech[i].count > 1 ? `(${tech.tech[i].count}x)` : ""}</div>
|
</span> ${build.nameLink(tech.tech[i].name)} ${tech.tech[i].count > 1 ? `(${tech.tech[i].count}x)` : ""}</div>
|
||||||
${tech.tech[i].descriptionFunction ? tech.tech[i].descriptionFunction() :tech.tech[i].description}</div>`
|
${tech.tech[i].descriptionFunction ? tech.tech[i].descriptionFunction() : tech.tech[i].description}</div>`
|
||||||
},
|
},
|
||||||
gunTechText(i) {
|
gunTechText(i) {
|
||||||
return `<div class="card-text"> <div class="grid-title">
|
return `<div class="card-text"> <div class="grid-title">
|
||||||
@@ -494,7 +494,7 @@ ${simulation.isCheating ? "<br><br><em>lore disabled</em>": ""}
|
|||||||
<div class="circle-grid tech" style="position:absolute; top:0; left:0;opacity:0.8;"></div>
|
<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>
|
<div class="circle-grid gun" style="position:absolute; top:0; left:10px; opacity:0.65;"></div>
|
||||||
</span> ${build.nameLink(tech.tech[i].name)} ${tech.tech[i].count > 1 ? `(${tech.tech[i].count}x)` : ""}</div>
|
</span> ${build.nameLink(tech.tech[i].name)} ${tech.tech[i].count > 1 ? `(${tech.tech[i].count}x)` : ""}</div>
|
||||||
${tech.tech[i].descriptionFunction ? tech.tech[i].descriptionFunction() :tech.tech[i].description}</div>`
|
${tech.tech[i].descriptionFunction ? tech.tech[i].descriptionFunction() : tech.tech[i].description}</div>`
|
||||||
},
|
},
|
||||||
fieldTechText(i) {
|
fieldTechText(i) {
|
||||||
return `<div class="card-text"><div class="grid-title">
|
return `<div class="card-text"><div class="grid-title">
|
||||||
@@ -502,12 +502,12 @@ ${simulation.isCheating ? "<br><br><em>lore disabled</em>": ""}
|
|||||||
<div class="circle-grid tech" style="position:absolute; top:0; left:0;opacity:0.8;"></div>
|
<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>
|
<div class="circle-grid field" style="position:absolute; top:0; left:10px;opacity:0.65;"></div>
|
||||||
</span> ${build.nameLink(tech.tech[i].name)} ${tech.tech[i].count > 1 ? `(${tech.tech[i].count}x)` : ""}</div>
|
</span> ${build.nameLink(tech.tech[i].name)} ${tech.tech[i].count > 1 ? `(${tech.tech[i].count}x)` : ""}</div>
|
||||||
${tech.tech[i].descriptionFunction ? tech.tech[i].descriptionFunction() :tech.tech[i].description}</div>`
|
${tech.tech[i].descriptionFunction ? tech.tech[i].descriptionFunction() : tech.tech[i].description}</div>`
|
||||||
},
|
},
|
||||||
junkTechText(i) {
|
junkTechText(i) {
|
||||||
return `<div class="card-text">
|
return `<div class="card-text">
|
||||||
<div class="grid-title"><div class="circle-grid junk"></div> ${build.nameLink(tech.tech[i].name)} ${tech.tech[i].count > 1 ? `(${tech.tech[i].count}x)` : ""}</div>
|
<div class="grid-title"><div class="circle-grid junk"></div> ${build.nameLink(tech.tech[i].name)} ${tech.tech[i].count > 1 ? `(${tech.tech[i].count}x)` : ""}</div>
|
||||||
${tech.tech[i].descriptionFunction ? tech.tech[i].descriptionFunction() :tech.tech[i].description}</div>`
|
${tech.tech[i].descriptionFunction ? tech.tech[i].descriptionFunction() : tech.tech[i].description}</div>`
|
||||||
},
|
},
|
||||||
choosePowerUp(index, type, isAllowed = false) {
|
choosePowerUp(index, type, isAllowed = false) {
|
||||||
if (type === "gun") {
|
if (type === "gun") {
|
||||||
@@ -594,7 +594,7 @@ ${simulation.isCheating ? "<br><br><em>lore disabled</em>": ""}
|
|||||||
techID.setAttribute("onClick", `javascript: build.choosePowerUp(${i},'tech')`);
|
techID.setAttribute("onClick", `javascript: build.choosePowerUp(${i},'tech')`);
|
||||||
}
|
}
|
||||||
} else { //disabled color for disabled tech
|
} else { //disabled color for disabled tech
|
||||||
techID.innerHTML = `<div class="grid-title">${tech.tech[i].name}</div>${tech.tech[i].descriptionFunction ? tech.tech[i].descriptionFunction() :tech.tech[i].description}</div>`
|
techID.innerHTML = `<div class="grid-title">${tech.tech[i].name}</div>${tech.tech[i].descriptionFunction ? tech.tech[i].descriptionFunction() : tech.tech[i].description}</div>`
|
||||||
if (!techID.classList.contains("experiment-grid-disabled")) {
|
if (!techID.classList.contains("experiment-grid-disabled")) {
|
||||||
techID.classList.add("experiment-grid-disabled");
|
techID.classList.add("experiment-grid-disabled");
|
||||||
techID.onclick = null
|
techID.onclick = null
|
||||||
@@ -630,7 +630,7 @@ ${simulation.isCheating ? "<br><br><em>lore disabled</em>": ""}
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label for="hide-images-experiment" title="reload experiment with no images for fields, guns, and tech">hide images:</label>
|
<label for="hide-images-experiment" title="reload experiment with no images for fields, guns, and tech">hide images:</label>
|
||||||
<input onclick="build.showImages('experiment')" type="checkbox" id="hide-images-experiment" name="hide-images-experiment" style="width:17px; height:17px; margin-bottom: 15px;" ${localSettings.isHideImages? "checked": ""}>
|
<input onclick="build.showImages('experiment')" type="checkbox" id="hide-images-experiment" name="hide-images-experiment" style="width:17px; height:17px; margin-bottom: 15px;" ${localSettings.isHideImages ? "checked" : ""}>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<svg class="SVG-button" onclick="build.reset()" width="50" height="25">
|
<svg class="SVG-button" onclick="build.reset()" width="50" height="25">
|
||||||
@@ -775,17 +775,17 @@ ${simulation.isCheating ? "<br><br><em>lore disabled</em>": ""}
|
|||||||
}
|
}
|
||||||
console.log('n-gon build URL copied to clipboard.\nPaste into browser address bar.')
|
console.log('n-gon build URL copied to clipboard.\nPaste into browser address bar.')
|
||||||
console.log(url)
|
console.log(url)
|
||||||
navigator.clipboard.writeText(url).then(function() {
|
navigator.clipboard.writeText(url).then(function () {
|
||||||
/* clipboard successfully set */
|
/* clipboard successfully set */
|
||||||
if (isCustom) {
|
if (isCustom) {
|
||||||
setTimeout(function() {
|
setTimeout(function () {
|
||||||
alert('n-gon build URL copied to clipboard.\nPaste into browser address bar.')
|
alert('n-gon build URL copied to clipboard.\nPaste into browser address bar.')
|
||||||
}, 300);
|
}, 300);
|
||||||
}
|
}
|
||||||
}, function() {
|
}, function () {
|
||||||
/* clipboard write failed */
|
/* clipboard write failed */
|
||||||
if (isCustom) {
|
if (isCustom) {
|
||||||
setTimeout(function() {
|
setTimeout(function () {
|
||||||
alert('copy failed')
|
alert('copy failed')
|
||||||
}, 300);
|
}, 300);
|
||||||
}
|
}
|
||||||
@@ -946,23 +946,23 @@ const input = {
|
|||||||
setKeys(event) {
|
setKeys(event) {
|
||||||
//check for duplicate keys
|
//check for duplicate keys
|
||||||
if (event.code && !(
|
if (event.code && !(
|
||||||
event.code === "ArrowRight" ||
|
event.code === "ArrowRight" ||
|
||||||
event.code === "ArrowLeft" ||
|
event.code === "ArrowLeft" ||
|
||||||
event.code === "ArrowUp" ||
|
event.code === "ArrowUp" ||
|
||||||
event.code === "ArrowDown" ||
|
event.code === "ArrowDown" ||
|
||||||
event.code === input.key.fire ||
|
event.code === input.key.fire ||
|
||||||
event.code === input.key.field ||
|
event.code === input.key.field ||
|
||||||
event.code === input.key.up ||
|
event.code === input.key.up ||
|
||||||
event.code === input.key.down ||
|
event.code === input.key.down ||
|
||||||
event.code === input.key.left ||
|
event.code === input.key.left ||
|
||||||
event.code === input.key.right ||
|
event.code === input.key.right ||
|
||||||
event.code === input.key.pause ||
|
event.code === input.key.pause ||
|
||||||
// event.code === "Escape" ||
|
// event.code === "Escape" ||
|
||||||
event.code === input.key.nextGun ||
|
event.code === input.key.nextGun ||
|
||||||
event.code === input.key.previousGun ||
|
event.code === input.key.previousGun ||
|
||||||
event.code === input.key.testing ||
|
event.code === input.key.testing ||
|
||||||
event.code === "Digit1" || event.code === "Digit2" || event.code === "Digit3" || event.code === "Digit4" || event.code === "Digit5" || event.code === "Digit6" || event.code === "Digit7" || event.code === "Digit8" || event.code === "Digit9" || event.code === "Digit0" || event.code === "Minus" || event.code === "Equal"
|
event.code === "Digit1" || event.code === "Digit2" || event.code === "Digit3" || event.code === "Digit4" || event.code === "Digit5" || event.code === "Digit6" || event.code === "Digit7" || event.code === "Digit8" || event.code === "Digit9" || event.code === "Digit0" || event.code === "Minus" || event.code === "Equal"
|
||||||
)) {
|
)) {
|
||||||
switch (input.focus.id) {
|
switch (input.focus.id) {
|
||||||
case "key-fire":
|
case "key-fire":
|
||||||
input.key.fire = event.code
|
input.key.fire = event.code
|
||||||
@@ -1013,14 +1013,14 @@ document.getElementById("control-table").addEventListener('click', (event) => {
|
|||||||
window.addEventListener("keydown", input.setKeys);
|
window.addEventListener("keydown", input.setKeys);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
document.getElementById("control-details").addEventListener("toggle", function() {
|
document.getElementById("control-details").addEventListener("toggle", function () {
|
||||||
input.controlTextUpdate()
|
input.controlTextUpdate()
|
||||||
input.endKeySensing();
|
input.endKeySensing();
|
||||||
})
|
})
|
||||||
|
|
||||||
document.getElementById("control-reset").addEventListener('click', input.setDefault);
|
document.getElementById("control-reset").addEventListener('click', input.setDefault);
|
||||||
|
|
||||||
window.addEventListener("keyup", function(event) {
|
window.addEventListener("keyup", function (event) {
|
||||||
switch (event.code) {
|
switch (event.code) {
|
||||||
case input.key.right:
|
case input.key.right:
|
||||||
case "ArrowRight":
|
case "ArrowRight":
|
||||||
@@ -1047,7 +1047,7 @@ window.addEventListener("keyup", function(event) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
window.addEventListener("keydown", function(event) {
|
window.addEventListener("keydown", function (event) {
|
||||||
// console.log(event.code)
|
// console.log(event.code)
|
||||||
switch (event.code) {
|
switch (event.code) {
|
||||||
case input.key.right:
|
case input.key.right:
|
||||||
@@ -1081,7 +1081,7 @@ window.addEventListener("keydown", function(event) {
|
|||||||
case input.key.pause:
|
case input.key.pause:
|
||||||
if (!simulation.isChoosing && input.isPauseKeyReady && m.alive) {
|
if (!simulation.isChoosing && input.isPauseKeyReady && m.alive) {
|
||||||
input.isPauseKeyReady = false
|
input.isPauseKeyReady = false
|
||||||
setTimeout(function() {
|
setTimeout(function () {
|
||||||
input.isPauseKeyReady = true
|
input.isPauseKeyReady = true
|
||||||
}, 300);
|
}, 300);
|
||||||
if (simulation.paused) {
|
if (simulation.paused) {
|
||||||
@@ -1110,7 +1110,7 @@ window.addEventListener("keydown", function(event) {
|
|||||||
}
|
}
|
||||||
m.energy = energy //return to current energy
|
m.energy = energy //return to current energy
|
||||||
// document.getElementById("pause-field").innerHTML = `<div class="grid-title"><div class="circle-grid field"></div> ${m.fieldUpgrades[m.fieldMode].name}</div> ${m.fieldUpgrades[m.fieldMode].description}`
|
// document.getElementById("pause-field").innerHTML = `<div class="grid-title"><div class="circle-grid field"></div> ${m.fieldUpgrades[m.fieldMode].name}</div> ${m.fieldUpgrades[m.fieldMode].description}`
|
||||||
document.getElementById("pause-field").style.backgroundImage = `url('img/field/${m.fieldUpgrades[m.fieldMode].name}${m.fieldMode === 0 ? Math.floor(Math.random()*10) : ""}.webp')`
|
document.getElementById("pause-field").style.backgroundImage = `url('img/field/${m.fieldUpgrades[m.fieldMode].name}${m.fieldMode === 0 ? Math.floor(Math.random() * 10) : ""}.webp')`
|
||||||
document.getElementById("pause-field").innerHTML = `
|
document.getElementById("pause-field").innerHTML = `
|
||||||
<div class="card-text" style = "animation: fieldColorCycle 1s linear infinite alternate;">
|
<div class="card-text" style = "animation: fieldColorCycle 1s linear infinite alternate;">
|
||||||
<div class="grid-title"><div class="circle-grid field"></div> ${build.nameLink(m.fieldUpgrades[m.fieldMode].name)}</div>
|
<div class="grid-title"><div class="circle-grid field"></div> ${build.nameLink(m.fieldUpgrades[m.fieldMode].name)}</div>
|
||||||
@@ -1310,7 +1310,7 @@ window.addEventListener("keydown", function(event) {
|
|||||||
break
|
break
|
||||||
case "b":
|
case "b":
|
||||||
tech.isRerollDamage = true
|
tech.isRerollDamage = true
|
||||||
powerUps.research.changeRerolls(100000)
|
powerUps.research.changeRerolls(1000000)
|
||||||
break
|
break
|
||||||
case "r":
|
case "r":
|
||||||
m.resetHistory();
|
m.resetHistory();
|
||||||
@@ -1564,10 +1564,10 @@ document.getElementById("difficulty-select").addEventListener("input", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
document.getElementById("updates").addEventListener("toggle", function() {
|
document.getElementById("updates").addEventListener("toggle", function () {
|
||||||
function loadJSON(path, success, error) { //generic function to get JSON
|
function loadJSON(path, success, error) { //generic function to get JSON
|
||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
xhr.onreadystatechange = function() {
|
xhr.onreadystatechange = function () {
|
||||||
if (xhr.readyState === XMLHttpRequest.DONE) {
|
if (xhr.readyState === XMLHttpRequest.DONE) {
|
||||||
if (xhr.status === 200) {
|
if (xhr.status === 200) {
|
||||||
if (success)
|
if (success)
|
||||||
@@ -1586,7 +1586,7 @@ document.getElementById("updates").addEventListener("toggle", function() {
|
|||||||
|
|
||||||
/// https://api.github.com/repos/landgreen/n-gon/stats/commit_activity
|
/// https://api.github.com/repos/landgreen/n-gon/stats/commit_activity
|
||||||
loadJSON('https://api.github.com/repos/landgreen/n-gon/commits',
|
loadJSON('https://api.github.com/repos/landgreen/n-gon/commits',
|
||||||
function(data) {
|
function (data) {
|
||||||
// console.log(data)
|
// console.log(data)
|
||||||
for (let i = 0, len = 20; i < len; i++) {
|
for (let i = 0, len = 20; i < len; i++) {
|
||||||
text += "<strong>" + data[i].commit.author.date.substr(0, 10) + "</strong> - "; //+ "<br>"
|
text += "<strong>" + data[i].commit.author.date.substr(0, 10) + "</strong> - "; //+ "<br>"
|
||||||
@@ -1595,14 +1595,14 @@ document.getElementById("updates").addEventListener("toggle", function() {
|
|||||||
}
|
}
|
||||||
document.getElementById("updates-div").innerHTML = text.replace(/\n/g, "<br />")
|
document.getElementById("updates-div").innerHTML = text.replace(/\n/g, "<br />")
|
||||||
},
|
},
|
||||||
function(xhr) {
|
function (xhr) {
|
||||||
console.error(xhr);
|
console.error(xhr);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
const sound = {
|
const sound = {
|
||||||
tone(frequency, end = 1000, gain = 0.05) {
|
tone(frequency, end = 1000, gain = 0.05) {
|
||||||
const audioCtx = new(window.AudioContext || window.webkitAudioContext)(); //setup audio context
|
const audioCtx = new (window.AudioContext || window.webkitAudioContext)(); //setup audio context
|
||||||
const oscillator = audioCtx.createOscillator();
|
const oscillator = audioCtx.createOscillator();
|
||||||
const gainNode = audioCtx.createGain();
|
const gainNode = audioCtx.createGain();
|
||||||
gainNode.gain.value = gain; //controls volume
|
gainNode.gain.value = gain; //controls volume
|
||||||
@@ -1618,7 +1618,7 @@ const sound = {
|
|||||||
// return audioCtx
|
// return audioCtx
|
||||||
},
|
},
|
||||||
portamento(frequency, end = 1000, shiftRate = 10, gain = 0.05) {
|
portamento(frequency, end = 1000, shiftRate = 10, gain = 0.05) {
|
||||||
const audioCtx = new(window.AudioContext || window.webkitAudioContext)(); //setup audio context
|
const audioCtx = new (window.AudioContext || window.webkitAudioContext)(); //setup audio context
|
||||||
const oscillator = audioCtx.createOscillator();
|
const oscillator = audioCtx.createOscillator();
|
||||||
const gainNode = audioCtx.createGain();
|
const gainNode = audioCtx.createGain();
|
||||||
gainNode.gain.value = gain; //controls volume
|
gainNode.gain.value = gain; //controls volume
|
||||||
@@ -1681,6 +1681,9 @@ if (!localSettings.isHideImages) {
|
|||||||
}
|
}
|
||||||
// console.log(urls, images)
|
// console.log(urls, images)
|
||||||
});
|
});
|
||||||
|
document.getElementById("choose-grid").classList.add('choose-grid');
|
||||||
|
} else {
|
||||||
|
document.getElementById("choose-grid").classList.add('choose-grid-no-images');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
1429
js/level.js
24
js/lore.js
@@ -2,15 +2,7 @@ const lore = {
|
|||||||
techCount: 0,
|
techCount: 0,
|
||||||
techGoal: 7,
|
techGoal: 7,
|
||||||
setTechGoal() {
|
setTechGoal() {
|
||||||
if (simulation.difficultyMode === 1) {
|
this.techGoal = Math.max(1, Math.floor(8 - 1.5 * simulation.difficultyMode))
|
||||||
this.techGoal = 8
|
|
||||||
} else if (simulation.difficultyMode === 2) {
|
|
||||||
this.techGoal = 5
|
|
||||||
} else if (simulation.difficultyMode === 4) {
|
|
||||||
this.techGoal = 2
|
|
||||||
} else if (simulation.difficultyMode === 6) {
|
|
||||||
this.techGoal = 1
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
talkingColor: "#dff", //set color of graphic on level.null
|
talkingColor: "#dff", //set color of graphic on level.null
|
||||||
isSpeech: false,
|
isSpeech: false,
|
||||||
@@ -55,8 +47,8 @@ const lore = {
|
|||||||
trainer: {
|
trainer: {
|
||||||
color: "#f20",
|
color: "#f20",
|
||||||
voice: undefined,
|
voice: undefined,
|
||||||
text: function(say) {
|
text: function (say) {
|
||||||
simulation.makeTextLog(`input.audio(<span style="color:#888; font-size: 70%;">${(Date.now()/1000).toFixed(0)} s</span>)<span class='color-symbol'>:</span> "<span style="color:${this.color};">${say}</span>"`, Infinity);
|
simulation.makeTextLog(`input.audio(<span style="color:#888; font-size: 70%;">${(Date.now() / 1000).toFixed(0)} s</span>)<span class='color-symbol'>:</span> "<span style="color:${this.color};">${say}</span>"`, Infinity);
|
||||||
lore.talkingColor = this.color
|
lore.talkingColor = this.color
|
||||||
const utterance = new SpeechSynthesisUtterance(say);
|
const utterance = new SpeechSynthesisUtterance(say);
|
||||||
utterance.lang = "en-AU" //"en-IN"; //de-DE en-GB fr-FR en-US en-AU
|
utterance.lang = "en-AU" //"en-IN"; //de-DE en-GB fr-FR en-US en-AU
|
||||||
@@ -67,9 +59,9 @@ const lore = {
|
|||||||
anand: {
|
anand: {
|
||||||
color: "#e0c",
|
color: "#e0c",
|
||||||
voice: undefined,
|
voice: undefined,
|
||||||
text: function(say) {
|
text: function (say) {
|
||||||
if (level.levels[level.onLevel] === undefined) { //only talk if on the lore level (which is undefined because it is popped out of the level.levels array)
|
if (level.levels[level.onLevel] === undefined) { //only talk if on the lore level (which is undefined because it is popped out of the level.levels array)
|
||||||
simulation.makeTextLog(`input.audio(<span style="color:#888; font-size: 70%;">${(Date.now()/1000).toFixed(0)} s</span>)<span class='color-symbol'>:</span> "<span style="color:${this.color};">${say}</span>"`, Infinity);
|
simulation.makeTextLog(`input.audio(<span style="color:#888; font-size: 70%;">${(Date.now() / 1000).toFixed(0)} s</span>)<span class='color-symbol'>:</span> "<span style="color:${this.color};">${say}</span>"`, Infinity);
|
||||||
lore.talkingColor = this.color
|
lore.talkingColor = this.color
|
||||||
if (lore.isSpeech) {
|
if (lore.isSpeech) {
|
||||||
const utterance = new SpeechSynthesisUtterance(say);
|
const utterance = new SpeechSynthesisUtterance(say);
|
||||||
@@ -101,9 +93,9 @@ const lore = {
|
|||||||
},
|
},
|
||||||
miriam: {
|
miriam: {
|
||||||
color: "#f20",
|
color: "#f20",
|
||||||
text: function(say) {
|
text: function (say) {
|
||||||
if (level.levels[level.onLevel] === undefined) { //only talk if on the lore level (which is undefined because it is popped out of the level.levels array)
|
if (level.levels[level.onLevel] === undefined) { //only talk if on the lore level (which is undefined because it is popped out of the level.levels array)
|
||||||
simulation.makeTextLog(`input.audio(<span style="color:#888; font-size: 70%;">${(Date.now()/1000).toFixed(0)} s</span>)<span class='color-symbol'>:</span> "<span style="color:${this.color};">${say}</span>"`, Infinity);
|
simulation.makeTextLog(`input.audio(<span style="color:#888; font-size: 70%;">${(Date.now() / 1000).toFixed(0)} s</span>)<span class='color-symbol'>:</span> "<span style="color:${this.color};">${say}</span>"`, Infinity);
|
||||||
lore.talkingColor = this.color
|
lore.talkingColor = this.color
|
||||||
if (lore.isSpeech) {
|
if (lore.isSpeech) {
|
||||||
utterance = new SpeechSynthesisUtterance(say);
|
utterance = new SpeechSynthesisUtterance(say);
|
||||||
@@ -116,7 +108,7 @@ const lore = {
|
|||||||
lore.isSpeech = false
|
lore.isSpeech = false
|
||||||
lore.nextSentence()
|
lore.nextSentence()
|
||||||
}
|
}
|
||||||
speechFrozen = setTimeout(function() { // speech frozen after 10 seconds of no end
|
speechFrozen = setTimeout(function () { // speech frozen after 10 seconds of no end
|
||||||
console.log('speech frozen')
|
console.log('speech frozen')
|
||||||
lore.isSpeech = false
|
lore.isSpeech = false
|
||||||
lore.nextSentence()
|
lore.nextSentence()
|
||||||
|
|||||||
4530
js/player.js
@@ -75,7 +75,7 @@ const powerUps = {
|
|||||||
}
|
}
|
||||||
let text = '<span style="position:relative;">'
|
let text = '<span style="position:relative;">'
|
||||||
for (let i = 0; i < num; i++) {
|
for (let i = 0; i < num; i++) {
|
||||||
text += `<div class="research-circle" style="position:absolute; top:1.5px; left:${i*8}px;"></div>`
|
text += `<div class="research-circle" style="position:absolute; top:1.5px; left:${i * 8}px;"></div>`
|
||||||
}
|
}
|
||||||
text += '</span> '
|
text += '</span> '
|
||||||
for (let i = 0; i < num; i++) {
|
for (let i = 0; i < num; i++) {
|
||||||
@@ -90,7 +90,7 @@ const powerUps = {
|
|||||||
}
|
}
|
||||||
let text = '<span style="position:relative;">'
|
let text = '<span style="position:relative;">'
|
||||||
for (let i = 0; i < num; i++) {
|
for (let i = 0; i < num; i++) {
|
||||||
text += `<div class="ammo-circle" style="position:absolute; top:1.5px; left:${i*8}px;"></div>`
|
text += `<div class="ammo-circle" style="position:absolute; top:1.5px; left:${i * 8}px;"></div>`
|
||||||
}
|
}
|
||||||
text += '</span> '
|
text += '</span> '
|
||||||
for (let i = 0; i < num; i++) {
|
for (let i = 0; i < num; i++) {
|
||||||
@@ -106,7 +106,7 @@ const powerUps = {
|
|||||||
}
|
}
|
||||||
let text = '<span style="position:relative;">'
|
let text = '<span style="position:relative;">'
|
||||||
for (let i = 0; i < num; i++) {
|
for (let i = 0; i < num; i++) {
|
||||||
text += `<div class="heal-circle-energy" style="position:absolute; top:1px; left:${i*10}px;"></div>`
|
text += `<div class="heal-circle-energy" style="position:absolute; top:1px; left:${i * 10}px;"></div>`
|
||||||
}
|
}
|
||||||
text += '</span> '
|
text += '</span> '
|
||||||
for (let i = 0; i < num; i++) {
|
for (let i = 0; i < num; i++) {
|
||||||
@@ -120,7 +120,7 @@ const powerUps = {
|
|||||||
}
|
}
|
||||||
let text = '<span style="position:relative;">'
|
let text = '<span style="position:relative;">'
|
||||||
for (let i = 0; i < num; i++) {
|
for (let i = 0; i < num; i++) {
|
||||||
text += `<div class="heal-circle" style="position:absolute; top:1px; left:${i*10}px;"></div>`
|
text += `<div class="heal-circle" style="position:absolute; top:1px; left:${i * 10}px;"></div>`
|
||||||
}
|
}
|
||||||
text += '</span> '
|
text += '</span> '
|
||||||
for (let i = 0; i < num; i++) {
|
for (let i = 0; i < num; i++) {
|
||||||
@@ -139,7 +139,7 @@ const powerUps = {
|
|||||||
}
|
}
|
||||||
let text = '<span style="position:relative;">'
|
let text = '<span style="position:relative;">'
|
||||||
for (let i = 0; i < num; i++) {
|
for (let i = 0; i < num; i++) {
|
||||||
text += `<div class="coupling-circle" style="position:absolute; top:1.5px; left:${i*6}px;"></div>`
|
text += `<div class="coupling-circle" style="position:absolute; top:1.5px; left:${i * 6}px;"></div>`
|
||||||
}
|
}
|
||||||
text += '</span> '
|
text += '</span> '
|
||||||
for (let i = 0; i < num; i++) {
|
for (let i = 0; i < num; i++) {
|
||||||
@@ -154,7 +154,7 @@ const powerUps = {
|
|||||||
}
|
}
|
||||||
let text = '<span style="position:relative;">'
|
let text = '<span style="position:relative;">'
|
||||||
for (let i = 0; i < num; i++) {
|
for (let i = 0; i < num; i++) {
|
||||||
text += `<div class="boost-circle" style="position:absolute; top:1.5px; left:${i*8}px;"></div>`
|
text += `<div class="boost-circle" style="position:absolute; top:1.5px; left:${i * 8}px;"></div>`
|
||||||
}
|
}
|
||||||
text += '</span> '
|
text += '</span> '
|
||||||
for (let i = 0; i < num; i++) {
|
for (let i = 0; i < num; i++) {
|
||||||
@@ -164,7 +164,7 @@ const powerUps = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
totalPowerUps: 0, //used for tech that count power ups at the end of a level
|
totalPowerUps: 0, //used for tech that count power ups at the end of a level
|
||||||
do() {},
|
do() { },
|
||||||
setDupChance() {
|
setDupChance() {
|
||||||
if (tech.duplicationChance() > 0 || tech.isAnthropicTech) {
|
if (tech.duplicationChance() > 0 || tech.isAnthropicTech) {
|
||||||
if (tech.isPowerUpsVanish) {
|
if (tech.isPowerUpsVanish) {
|
||||||
@@ -639,6 +639,8 @@ const powerUps = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
cancelText(type) {
|
cancelText(type) {
|
||||||
|
// if (localSettings.isHideImages) { }
|
||||||
|
|
||||||
if (tech.isSuperDeterminism) {
|
if (tech.isSuperDeterminism) {
|
||||||
return `<div></div>`
|
return `<div></div>`
|
||||||
} else if (tech.isCancelTech) {
|
} else if (tech.isCancelTech) {
|
||||||
@@ -655,18 +657,54 @@ const powerUps = {
|
|||||||
text += `<div onclick="powerUps.research.use('${type}')" class='research-card'>` // style = "margin-left: 192px; margin-right: -192px;"
|
text += `<div onclick="powerUps.research.use('${type}')" class='research-card'>` // style = "margin-left: 192px; margin-right: -192px;"
|
||||||
tech.junkResearchNumber = Math.ceil(4 * Math.random())
|
tech.junkResearchNumber = Math.ceil(4 * Math.random())
|
||||||
text += `<div><div> <span style="position:relative;">`
|
text += `<div><div> <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;width: 1.15em;height: 1.15em;"></div>`
|
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;width: 1.15em;height: 1.15em;"></div>`
|
||||||
|
}
|
||||||
text += `</span> <span class='research-select'>pseudoscience</span></div></div></div>`
|
text += `</span> <span class='research-select'>pseudoscience</span></div></div></div>`
|
||||||
} else if (powerUps.research.count > 0) {
|
} else if (powerUps.research.count > 0) {
|
||||||
text += `<div onclick="powerUps.research.use('${type}')" class='research-card' >` // style = "margin-left: 192px; margin-right: -192px;"
|
text += `<div onclick="powerUps.research.use('${type}')" class='research-card' >` // style = "margin-left: 192px; margin-right: -192px;"
|
||||||
text += `<div><div><span style="position:relative;">`
|
text += `<div><div><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="font-size:0.82em; position:absolute; top:0; left:${(18 - len*0.21)*i}px ;opacity:0.8; border: 1px #fff solid;"></div>`
|
for (let i = 0, len = Math.min(powerUps.research.count, 30); i < len; i++) text += `<div class="circle-grid research" style="font-size:0.82em; position:absolute; top:0; left:${(18 - len * 0.21) * i}px ;opacity:0.8; border: 1px #fff solid;"></div>`
|
||||||
text += `</span> <span class='research-select'>${tech.isResearchReality?"<span class='alt'>alternate reality</span>": "research"}</span></div></div></div>`
|
text += `</span> <span class='research-select'>${tech.isResearchReality ? "<span class='alt'>alternate reality</span>" : "research"}</span></div></div></div>`
|
||||||
} else {
|
} else {
|
||||||
text += `<div></div>`
|
text += `<div></div>`
|
||||||
}
|
}
|
||||||
return text
|
return text
|
||||||
},
|
},
|
||||||
|
researchAndCancelText(type) {
|
||||||
|
let text = `<div class='research-cancel'>`
|
||||||
|
if (type === "entanglement") {
|
||||||
|
text += `<span class='research-card entanglement flipX' style="width: 275px;"><span style="letter-spacing: 6px;">entanglement</span></span>` //‌
|
||||||
|
} else if (tech.isJunkResearch && powerUps.research.currentRerollCount < 3) {
|
||||||
|
text += `<span onclick="powerUps.research.use('${type}')" class='research-card' style="width: 275px;float: left;">` // style = "margin-left: 192px; margin-right: -192px;"
|
||||||
|
tech.junkResearchNumber = Math.ceil(4 * Math.random())
|
||||||
|
text += `<div><div><span style="position:relative;">`
|
||||||
|
for (let i = 0, len = tech.junkResearchNumber; i < len; i++) {
|
||||||
|
text += `<div class="circle-grid junk" style="position:absolute; top:0; left:${15 * i}px ;opacity:0.8; border: 1px #fff solid;width: 1.15em;height: 1.15em;"></div>`
|
||||||
|
}
|
||||||
|
text += `</span> <span class='research-select'>${tech.isResearchReality ? "<span class='alt'>alternate reality</span>" : "research"}</span></div></div></span>`
|
||||||
|
} else if (powerUps.research.count > 0) {
|
||||||
|
text += `<span onclick="powerUps.research.use('${type}')" class='research-card' style="width: 275px;float: left;">` // style = "margin-left: 192px; margin-right: -192px;"
|
||||||
|
text += `<div><div><span style="position:relative;">`
|
||||||
|
let researchCap = 18
|
||||||
|
if (tech.isCancelTech) researchCap -= 2
|
||||||
|
if (canvas.width < 1951) researchCap -= 3
|
||||||
|
if (canvas.width < 1711) researchCap -= 4
|
||||||
|
for (let i = 0, len = Math.min(powerUps.research.count, researchCap); i < len; i++) {
|
||||||
|
text += `<div class="circle-grid research" style="font-size:0.82em; position:absolute; top:0; left:${(18 - len * 0.21) * i}px ;opacity:0.8; border: 1px #fff solid;"></div>`
|
||||||
|
}
|
||||||
|
text += `</span> <span class='research-select'>${tech.isResearchReality ? "<span class='alt'>alternate reality</span>" : "research"}</span></div></div></span>`
|
||||||
|
} else {
|
||||||
|
text += `<span class='research-card' style="width: 275px;float: right; background-color: #bbb;">research</span>` //‌
|
||||||
|
}
|
||||||
|
if (tech.isCancelTech) {
|
||||||
|
text += `<span class='cancel-card' onclick='powerUps.endDraft("${type}",true)' style="width: 115px;float: right;font-size:0.9em;padding-top:5px">randomize</span>`
|
||||||
|
} else {
|
||||||
|
text += `<span class='cancel-card' onclick='powerUps.endDraft("${type}",true)' style="width: 95px;float: right;">cancel</span>`
|
||||||
|
}
|
||||||
|
|
||||||
|
return text + "</div>"
|
||||||
|
},
|
||||||
buildColumns(totalChoices, type) {
|
buildColumns(totalChoices, type) {
|
||||||
let width
|
let width
|
||||||
if (canvas.width < 1710) {
|
if (canvas.width < 1710) {
|
||||||
@@ -676,18 +714,17 @@ const powerUps = {
|
|||||||
} else {
|
} else {
|
||||||
width = "384px"
|
width = "384px"
|
||||||
}
|
}
|
||||||
// if (canvas.width < 1500) {
|
|
||||||
// width = "340px"
|
|
||||||
// } else if (canvas.width < 1950) {
|
|
||||||
// width = "360px"
|
|
||||||
// } else {
|
|
||||||
// width = "384px"
|
|
||||||
// }
|
|
||||||
let text = ""
|
let text = ""
|
||||||
if (totalChoices === 1 || localSettings.isHideImages || canvas.width < 1200) {
|
if (localSettings.isHideImages) {
|
||||||
document.getElementById("choose-grid").style.gridTemplateColumns = width
|
document.getElementById("choose-grid").style.gridTemplateColumns = width
|
||||||
text += powerUps.cancelText(type)
|
text += powerUps.researchAndCancelText(type)
|
||||||
text += powerUps.researchText(type)
|
} else if (totalChoices === 1 || canvas.width < 1200) {
|
||||||
|
document.getElementById("choose-grid").style.gridTemplateColumns = width
|
||||||
|
text += powerUps.researchAndCancelText(type)
|
||||||
|
// console.log('hi')
|
||||||
|
// text += powerUps.cancelText(type)
|
||||||
|
// text += powerUps.researchText(type)
|
||||||
} else if (totalChoices === 2) {
|
} else if (totalChoices === 2) {
|
||||||
document.getElementById("choose-grid").style.gridTemplateColumns = `repeat(2, ${width})`
|
document.getElementById("choose-grid").style.gridTemplateColumns = `repeat(2, ${width})`
|
||||||
text += powerUps.researchText(type)
|
text += powerUps.researchText(type)
|
||||||
@@ -727,14 +764,14 @@ const powerUps = {
|
|||||||
${b.guns[choose].description}</div></div>`
|
${b.guns[choose].description}</div></div>`
|
||||||
},
|
},
|
||||||
fieldText(choose, click) {
|
fieldText(choose, click) {
|
||||||
const style = localSettings.isHideImages ? powerUps.hideStyle : `style="background-image: url('img/field/${m.fieldUpgrades[choose].name}${choose === 0 ? Math.floor(Math.random()*10) : ""}.webp');"`
|
const style = localSettings.isHideImages ? powerUps.hideStyle : `style="background-image: url('img/field/${m.fieldUpgrades[choose].name}${choose === 0 ? Math.floor(Math.random() * 10) : ""}.webp');"`
|
||||||
return `<div class="choose-grid-module card-background" onclick="${click}" onauxclick="${click}"${style}>
|
return `<div class="choose-grid-module card-background" onclick="${click}" onauxclick="${click}"${style}>
|
||||||
<div class="card-text">
|
<div class="card-text">
|
||||||
<div class="grid-title"><div class="circle-grid field"></div> ${m.fieldUpgrades[choose].name}</div>
|
<div class="grid-title"><div class="circle-grid field"></div> ${m.fieldUpgrades[choose].name}</div>
|
||||||
${m.fieldUpgrades[choose].description}</div></div>`
|
${m.fieldUpgrades[choose].description}</div></div>`
|
||||||
},
|
},
|
||||||
techText(choose, click) {
|
techText(choose, click) {
|
||||||
const techCountText = tech.tech[choose].count > 0 ? `(${tech.tech[choose].count+1}x)` : "";
|
const techCountText = tech.tech[choose].count > 0 ? `(${tech.tech[choose].count + 1}x)` : "";
|
||||||
const style = localSettings.isHideImages || tech.tech[choose].isLore ? powerUps.hideStyle : `style="background-image: url('img/${tech.tech[choose].name}.webp');"`
|
const style = localSettings.isHideImages || tech.tech[choose].isLore ? powerUps.hideStyle : `style="background-image: url('img/${tech.tech[choose].name}.webp');"`
|
||||||
return `<div class="choose-grid-module card-background" onclick="${click}" onauxclick="${click}"${style}>
|
return `<div class="choose-grid-module card-background" onclick="${click}" onauxclick="${click}"${style}>
|
||||||
<div class="card-text">
|
<div class="card-text">
|
||||||
@@ -742,7 +779,7 @@ const powerUps = {
|
|||||||
${tech.tech[choose].descriptionFunction ? tech.tech[choose].descriptionFunction() : tech.tech[choose].description}</div></div>`
|
${tech.tech[choose].descriptionFunction ? tech.tech[choose].descriptionFunction() : tech.tech[choose].description}</div></div>`
|
||||||
},
|
},
|
||||||
skinTechText(choose, click) {
|
skinTechText(choose, click) {
|
||||||
const techCountText = tech.tech[choose].count > 0 ? `(${tech.tech[choose].count+1}x)` : "";
|
const techCountText = tech.tech[choose].count > 0 ? `(${tech.tech[choose].count + 1}x)` : "";
|
||||||
const style = localSettings.isHideImages ? powerUps.hideStyle : `style="background-image: url('img/${tech.tech[choose].name}.webp');"`
|
const style = localSettings.isHideImages ? powerUps.hideStyle : `style="background-image: url('img/${tech.tech[choose].name}.webp');"`
|
||||||
return `<div class="choose-grid-module card-background" onclick="${click}" onauxclick="${click}"${style}>
|
return `<div class="choose-grid-module card-background" onclick="${click}" onauxclick="${click}"${style}>
|
||||||
<div class="card-text">
|
<div class="card-text">
|
||||||
@@ -755,7 +792,7 @@ const powerUps = {
|
|||||||
${tech.tech[choose].descriptionFunction ? tech.tech[choose].descriptionFunction() : tech.tech[choose].description}</div></div>`
|
${tech.tech[choose].descriptionFunction ? tech.tech[choose].descriptionFunction() : tech.tech[choose].description}</div></div>`
|
||||||
},
|
},
|
||||||
fieldTechText(choose, click) {
|
fieldTechText(choose, click) {
|
||||||
const techCountText = tech.tech[choose].count > 0 ? `(${tech.tech[choose].count+1}x)` : "";
|
const techCountText = tech.tech[choose].count > 0 ? `(${tech.tech[choose].count + 1}x)` : "";
|
||||||
const style = localSettings.isHideImages ? powerUps.hideStyle : `style="background-image: url('img/${tech.tech[choose].name}.webp');"`
|
const style = localSettings.isHideImages ? powerUps.hideStyle : `style="background-image: url('img/${tech.tech[choose].name}.webp');"`
|
||||||
return `<div class="choose-grid-module card-background" onclick="${click}" onauxclick="${click}"${style}>
|
return `<div class="choose-grid-module card-background" onclick="${click}" onauxclick="${click}"${style}>
|
||||||
<div class="card-text">
|
<div class="card-text">
|
||||||
@@ -768,7 +805,7 @@ const powerUps = {
|
|||||||
${tech.tech[choose].descriptionFunction ? tech.tech[choose].descriptionFunction() : tech.tech[choose].description}</div></div>`
|
${tech.tech[choose].descriptionFunction ? tech.tech[choose].descriptionFunction() : tech.tech[choose].description}</div></div>`
|
||||||
},
|
},
|
||||||
gunTechText(choose, click) {
|
gunTechText(choose, click) {
|
||||||
const techCountText = tech.tech[choose].count > 0 ? `(${tech.tech[choose].count+1}x)` : "";
|
const techCountText = tech.tech[choose].count > 0 ? `(${tech.tech[choose].count + 1}x)` : "";
|
||||||
const style = localSettings.isHideImages ? powerUps.hideStyle : `style="background-image: url('img/${tech.tech[choose].name}.webp');"`
|
const style = localSettings.isHideImages ? powerUps.hideStyle : `style="background-image: url('img/${tech.tech[choose].name}.webp');"`
|
||||||
return `<div class="choose-grid-module card-background" onclick="${click}" onauxclick="${click}"${style}>
|
return `<div class="choose-grid-module card-background" onclick="${click}" onauxclick="${click}"${style}>
|
||||||
<div class="card-text">
|
<div class="card-text">
|
||||||
@@ -781,7 +818,7 @@ const powerUps = {
|
|||||||
${tech.tech[choose].descriptionFunction ? tech.tech[choose].descriptionFunction() : tech.tech[choose].description}</div></div>`
|
${tech.tech[choose].descriptionFunction ? tech.tech[choose].descriptionFunction() : tech.tech[choose].description}</div></div>`
|
||||||
},
|
},
|
||||||
junkTechText(choose, click) {
|
junkTechText(choose, click) {
|
||||||
const techCountText = tech.tech[choose].count > 0 ? `(${tech.tech[choose].count+1}x)` : "";
|
const techCountText = tech.tech[choose].count > 0 ? `(${tech.tech[choose].count + 1}x)` : "";
|
||||||
const style = localSettings.isHideImages ? powerUps.hideStyle : `style="background-size: contain;background-repeat: no-repeat;background-image: url('img/junk.webp');"`
|
const style = localSettings.isHideImages ? powerUps.hideStyle : `style="background-size: contain;background-repeat: no-repeat;background-image: url('img/junk.webp');"`
|
||||||
if (!localSettings.isHideImages) {
|
if (!localSettings.isHideImages) {
|
||||||
setTimeout(() => { //delay so that the html element exists
|
setTimeout(() => { //delay so that the html element exists
|
||||||
@@ -873,7 +910,7 @@ const powerUps = {
|
|||||||
// const isCount = tech.tech[choose].count > 0 ? `(${tech.tech[choose].count+1}x)` : "";
|
// const isCount = tech.tech[choose].count > 0 ? `(${tech.tech[choose].count+1}x)` : "";
|
||||||
// text += `<div class="choose-grid-module" onclick="powerUps.choose('tech',${choose})"><div class="grid-title"> <span id = "cellular-rule-id${this.id}" style = "font-size: 150%;font-family: 'Courier New', monospace;">⭓▸●■</span> ${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"> <span id = "cellular-rule-id${this.id}" style = "font-size: 150%;font-family: 'Courier New', monospace;">⭓▸●■</span> ${tech.tech[choose].name} ${isCount}</div>${tech.tech[choose].descriptionFunction ? tech.tech[choose].descriptionFunction() : tech.tech[choose].description}</div>`
|
||||||
const choose = botTech[Math.floor(Math.random() * botTech.length)];
|
const choose = botTech[Math.floor(Math.random() * botTech.length)];
|
||||||
const techCountText = tech.tech[choose].count > 0 ? `(${tech.tech[choose].count+1}x)` : "";
|
const techCountText = tech.tech[choose].count > 0 ? `(${tech.tech[choose].count + 1}x)` : "";
|
||||||
const style = localSettings.isHideImages ? powerUps.hideStyle : `style="background-image: url('img/${tech.tech[choose].name}.webp');"`
|
const style = localSettings.isHideImages ? powerUps.hideStyle : `style="background-image: url('img/${tech.tech[choose].name}.webp');"`
|
||||||
text += `<div class="choose-grid-module card-background" onclick="powerUps.choose('tech',${choose})" ${style}>
|
text += `<div class="choose-grid-module card-background" onclick="powerUps.choose('tech',${choose})" ${style}>
|
||||||
<div class="card-text">
|
<div class="card-text">
|
||||||
@@ -938,7 +975,7 @@ const powerUps = {
|
|||||||
// const isCount = tech.tech[choose].count > 0 ? `(${tech.tech[choose].count+1}x)` : "";
|
// const isCount = tech.tech[choose].count > 0 ? `(${tech.tech[choose].count+1}x)` : "";
|
||||||
// text += `<div class="choose-grid-module" onclick="powerUps.choose('tech',${choose})"><div class="grid-title"> <span id = "cellular-rule-id${this.id}" style = "font-size: 150%;font-family: 'Courier New', monospace;">⭓▸●■</span> ${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"> <span id = "cellular-rule-id${this.id}" style = "font-size: 150%;font-family: 'Courier New', monospace;">⭓▸●■</span> ${tech.tech[choose].name} ${isCount}</div>${tech.tech[choose].descriptionFunction ? tech.tech[choose].descriptionFunction() : tech.tech[choose].description}</div>`
|
||||||
const choose = botTech[Math.floor(Math.random() * botTech.length)];
|
const choose = botTech[Math.floor(Math.random() * botTech.length)];
|
||||||
const techCountText = tech.tech[choose].count > 0 ? `(${tech.tech[choose].count+1}x)` : "";
|
const techCountText = tech.tech[choose].count > 0 ? `(${tech.tech[choose].count + 1}x)` : "";
|
||||||
const style = localSettings.isHideImages ? powerUps.hideStyle : `style="background-image: url('img/${tech.tech[choose].name}.webp');"`
|
const style = localSettings.isHideImages ? powerUps.hideStyle : `style="background-image: url('img/${tech.tech[choose].name}.webp');"`
|
||||||
text += `<div class="choose-grid-module card-background" onclick="powerUps.choose('tech',${choose})" ${style}>
|
text += `<div class="choose-grid-module card-background" onclick="powerUps.choose('tech',${choose})" ${style}>
|
||||||
<div class="card-text">
|
<div class="card-text">
|
||||||
@@ -1021,7 +1058,7 @@ const powerUps = {
|
|||||||
}
|
}
|
||||||
removeOption(choose) //move from future options pool to avoid repeats on this selection
|
removeOption(choose) //move from future options pool to avoid repeats on this selection
|
||||||
tech.tech[choose].isRecentlyShown = true //this flag prevents this option from being shown the next time you pick up a tech power up
|
tech.tech[choose].isRecentlyShown = true //this flag prevents this option from being shown the next time you pick up a tech power up
|
||||||
const isCount = tech.tech[choose].count > 0 ? `(${tech.tech[choose].count+1}x)` : "";
|
const isCount = tech.tech[choose].count > 0 ? `(${tech.tech[choose].count + 1}x)` : "";
|
||||||
if (tech.tech[choose].isFieldTech) {
|
if (tech.tech[choose].isFieldTech) {
|
||||||
text += powerUps.fieldTechText(choose, `powerUps.choose('tech',${choose})`)
|
text += powerUps.fieldTechText(choose, `powerUps.choose('tech',${choose})`)
|
||||||
} else if (tech.tech[choose].isGunTech) {
|
} else if (tech.tech[choose].isGunTech) {
|
||||||
@@ -1045,7 +1082,7 @@ const powerUps = {
|
|||||||
// const isCount = tech.tech[choose].count > 0 ? `(${tech.tech[choose].count+1}x)` : "";
|
// const isCount = tech.tech[choose].count > 0 ? `(${tech.tech[choose].count+1}x)` : "";
|
||||||
// text += `<div class="choose-grid-module" onclick="powerUps.choose('tech',${choose})"><div class="grid-title"> <span id = "cellular-rule-id${this.id}" style = "font-size: 150%;font-family: 'Courier New', monospace;">⭓▸●■</span> ${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"> <span id = "cellular-rule-id${this.id}" style = "font-size: 150%;font-family: 'Courier New', monospace;">⭓▸●■</span> ${tech.tech[choose].name} ${isCount}</div> ${tech.tech[choose].descriptionFunction ? tech.tech[choose].descriptionFunction() : tech.tech[choose].description}</div>`
|
||||||
const choose = botTech[Math.floor(Math.random() * botTech.length)];
|
const choose = botTech[Math.floor(Math.random() * botTech.length)];
|
||||||
const techCountText = tech.tech[choose].count > 0 ? `(${tech.tech[choose].count+1}x)` : "";
|
const techCountText = tech.tech[choose].count > 0 ? `(${tech.tech[choose].count + 1}x)` : "";
|
||||||
const style = localSettings.isHideImages ? powerUps.hideStyle : `style="background-image: url('img/${tech.tech[choose].name}.webp');"`
|
const style = localSettings.isHideImages ? powerUps.hideStyle : `style="background-image: url('img/${tech.tech[choose].name}.webp');"`
|
||||||
text += `<div class="choose-grid-module card-background" onclick="powerUps.choose('tech',${choose})" ${style}>
|
text += `<div class="choose-grid-module card-background" onclick="powerUps.choose('tech',${choose})" ${style}>
|
||||||
<div class="card-text">
|
<div class="card-text">
|
||||||
@@ -1162,7 +1199,7 @@ const powerUps = {
|
|||||||
}
|
}
|
||||||
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]
|
||||||
const isCount = tech.tech[choose].count > 0 ? `(${tech.tech[choose].count+1}x)` : "";
|
const isCount = tech.tech[choose].count > 0 ? `(${tech.tech[choose].count + 1}x)` : "";
|
||||||
|
|
||||||
if (choose === null || tech.tech[choose].count + 1 > tech.tech[choose].maxCount || !tech.tech[choose].allowed()) {
|
if (choose === null || tech.tech[choose].count + 1 > tech.tech[choose].maxCount || !tech.tech[choose].allowed()) {
|
||||||
// text += `<div class="choose-grid-module" style = "background-color: #efeff5; border: 0px; opacity:0.5; font-size: 60%; line-height: 130%; margin: 1px; padding-top: 6px; padding-bottom: 6px;"><div class="grid-title">${tech.tech[choose].name} <span style = "color: #aaa;font-weight: normal;font-size:80%;">- incoherent</span></div></div>`
|
// text += `<div class="choose-grid-module" style = "background-color: #efeff5; border: 0px; opacity:0.5; font-size: 60%; line-height: 130%; margin: 1px; padding-top: 6px; padding-bottom: 6px;"><div class="grid-title">${tech.tech[choose].name} <span style = "color: #aaa;font-weight: normal;font-size:80%;">- incoherent</span></div></div>`
|
||||||
|
|||||||
@@ -1137,31 +1137,16 @@ const simulation = {
|
|||||||
// },
|
// },
|
||||||
checks() {
|
checks() {
|
||||||
if (!(m.cycle % 15)) { //4 times a second
|
if (!(m.cycle % 15)) { //4 times a second
|
||||||
//update defense bar
|
const defense = m.defense() //update defense bar
|
||||||
const defense = m.defense()
|
|
||||||
if (m.lastCalculatedDefense !== defense) {
|
if (m.lastCalculatedDefense !== defense) {
|
||||||
document.getElementById("defense-bar").style.width = Math.floor(300 * m.maxHealth * (1 - defense)) + "px";
|
document.getElementById("defense-bar").style.width = Math.floor(300 * m.maxHealth * (1 - defense)) + "px";
|
||||||
|
|
||||||
// if (m.lastCalculatedDefense === 1) document.getElementById("defense-bar").style.display = "inline"
|
|
||||||
// if (defense === 1) document.getElementById("defense-bar").style.display = "none"
|
|
||||||
// Math.pow(m.defense(), 0.13)
|
|
||||||
m.lastCalculatedDefense = defense
|
m.lastCalculatedDefense = defense
|
||||||
// console.log(defense)
|
|
||||||
}
|
}
|
||||||
|
const damage = tech.damageFromTech() //update damage bar
|
||||||
//update damage bar
|
|
||||||
const damage = tech.damageFromTech()
|
|
||||||
if (m.lastCalculatedDamage !== damage) {
|
if (m.lastCalculatedDamage !== damage) {
|
||||||
canvas.width
|
document.getElementById("damage-bar").style.height = Math.floor(Math.atan(0.25 * damage - 0.25) / 1.65 * canvas.height) + "px";
|
||||||
// document.getElementById("damage-bar").style.width = Math.floor(Math.atan(damage - 1) / 6.28 * canvas.width) + "px";
|
|
||||||
document.getElementById("damage-bar").style.height = Math.floor(Math.atan(damage - 1) / 3.14 * canvas.height) + "px";
|
|
||||||
|
|
||||||
m.lastCalculatedDamage = damage
|
m.lastCalculatedDamage = damage
|
||||||
console.log(damage)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if (!(m.cycle % 60)) { //once a second
|
if (!(m.cycle % 60)) { //once a second
|
||||||
//energy overfill
|
//energy overfill
|
||||||
@@ -1211,7 +1196,17 @@ const simulation = {
|
|||||||
if (isNaN(player.position.x)) m.death();
|
if (isNaN(player.position.x)) m.death();
|
||||||
if (m.lastKillCycle + 300 > m.cycle) { //effects active for 5 seconds after killing a mob
|
if (m.lastKillCycle + 300 > m.cycle) { //effects active for 5 seconds after killing a mob
|
||||||
if (tech.isEnergyRecovery && m.immuneCycle < m.cycle) m.energy += m.maxEnergy * 0.05
|
if (tech.isEnergyRecovery && m.immuneCycle < m.cycle) m.energy += m.maxEnergy * 0.05
|
||||||
if (tech.isHealthRecovery) m.addHealth(0.005 * m.maxHealth)
|
if (tech.isHealthRecovery) {
|
||||||
|
const heal = 0.005 * m.maxHealth
|
||||||
|
m.addHealth(heal)
|
||||||
|
simulation.drawList.push({ //add dmg to draw queue
|
||||||
|
x: m.pos.x,
|
||||||
|
y: m.pos.y,
|
||||||
|
radius: Math.sqrt(heal) * 150,
|
||||||
|
color: "rgba(0,255,200,0.6)",
|
||||||
|
time: 8
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(m.cycle % 420)) { //once every 7 seconds
|
if (!(m.cycle % 420)) { //once every 7 seconds
|
||||||
|
|||||||
994
js/spawn.js
20756
js/tech.js
65
style.css
@@ -161,7 +161,7 @@ summary {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
#choose-grid {
|
.choose-grid {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
@@ -180,9 +180,34 @@ summary {
|
|||||||
transition: opacity 0.25s linear;
|
transition: opacity 0.25s linear;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
-ms-overflow-style: none;
|
-ms-overflow-style: none;
|
||||||
/* IE and Edge */
|
|
||||||
scrollbar-width: none;
|
scrollbar-width: none;
|
||||||
/* Firefox */
|
}
|
||||||
|
|
||||||
|
.choose-grid-no-images {
|
||||||
|
border-radius: 12px;
|
||||||
|
border: 10px solid #444;
|
||||||
|
gap: 10px;
|
||||||
|
background-color: #444;
|
||||||
|
/* padding: 10px 1px; */
|
||||||
|
|
||||||
|
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
margin: 0px;
|
||||||
|
z-index: 12;
|
||||||
|
max-height: 99vh;
|
||||||
|
font-size: 1.3em;
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 384px;
|
||||||
|
align-items: stretch;
|
||||||
|
visibility: hidden;
|
||||||
|
opacity: 0;
|
||||||
|
transition: opacity 0.25s linear;
|
||||||
|
overflow: auto;
|
||||||
|
-ms-overflow-style: none;
|
||||||
|
scrollbar-width: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
#choose-grid::-webkit-scrollbar {
|
#choose-grid::-webkit-scrollbar {
|
||||||
@@ -356,6 +381,7 @@ summary {
|
|||||||
margin-right: -1px;
|
margin-right: -1px;
|
||||||
font-size: 0.92em;
|
font-size: 0.92em;
|
||||||
min-height: 88px;
|
min-height: 88px;
|
||||||
|
/* border-radius: 5px; */
|
||||||
}
|
}
|
||||||
|
|
||||||
.cancel-card {
|
.cancel-card {
|
||||||
@@ -390,19 +416,31 @@ summary {
|
|||||||
background-color: var(--hover-card-color);
|
background-color: var(--hover-card-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.research-cancel {
|
||||||
|
display: flex;
|
||||||
|
gap: 10px;
|
||||||
|
line-height: 160%;
|
||||||
|
/* background-color: var(--card-color); */
|
||||||
|
font-size: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
/* keeps 5 columns at 1440px */
|
/* keeps 5 columns at 1440px */
|
||||||
@media (min-width: 1710px) and (max-width: 1950px) {
|
@media (min-width: 1710px) and (max-width: 1950px) {
|
||||||
|
|
||||||
.experiment-grid-module,
|
.experiment-grid-module,
|
||||||
.choose-grid-module,
|
.choose-grid-module,
|
||||||
.pause-grid-module {
|
.pause-grid-module,
|
||||||
|
.research-cancel {
|
||||||
line-height: 143%;
|
line-height: 143%;
|
||||||
font-size: 0.68em;
|
font-size: 0.68em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.research-cancel {
|
||||||
|
font-size: 0.9em;
|
||||||
|
}
|
||||||
|
|
||||||
#experiment-grid,
|
#experiment-grid,
|
||||||
#choose-grid,
|
.choose-grid,
|
||||||
.pause-grid {
|
.pause-grid {
|
||||||
grid-template-columns: repeat(auto-fit, 340px);
|
grid-template-columns: repeat(auto-fit, 340px);
|
||||||
}
|
}
|
||||||
@@ -426,8 +464,12 @@ summary {
|
|||||||
font-size: 0.58em;
|
font-size: 0.58em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.research-cancel {
|
||||||
|
font-size: 0.8em;
|
||||||
|
}
|
||||||
|
|
||||||
#experiment-grid,
|
#experiment-grid,
|
||||||
#choose-grid,
|
.choose-grid,
|
||||||
.pause-grid {
|
.pause-grid {
|
||||||
grid-template-columns: repeat(auto-fit, 285px);
|
grid-template-columns: repeat(auto-fit, 285px);
|
||||||
}
|
}
|
||||||
@@ -512,7 +554,7 @@ summary {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.experiment-grid-disabled[data-descr]:hover::after {
|
.experiment-grid-disabled[data-descr]:hover::after {
|
||||||
content: '\a \00a0 \00a0 \00a0 REQUIRES:\a \00a0 \00a0 \00a0 'attr(data-descr);
|
content: '\a \00a0 \00a0 \00a0 REQUIRES:\a \00a0 \00a0 \00a0 ' attr(data-descr);
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
@@ -564,7 +606,7 @@ summary {
|
|||||||
right: 4px;
|
right: 4px;
|
||||||
height: 0px;
|
height: 0px;
|
||||||
width: 7px;
|
width: 7px;
|
||||||
transition: height 0.15s linear;
|
transition: height 0.25s linear;
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
@@ -580,7 +622,7 @@ summary {
|
|||||||
left: 15px;
|
left: 15px;
|
||||||
height: 7px;
|
height: 7px;
|
||||||
width: 0px;
|
width: 0px;
|
||||||
transition: width 0.3s linear;
|
transition: width 0.25s linear;
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
@@ -588,18 +630,21 @@ summary {
|
|||||||
border-right: 1.5px solid #777;
|
border-right: 1.5px solid #777;
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
#health {
|
#health {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 15px;
|
top: 15px;
|
||||||
left: 15px;
|
left: 15px;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
width: 0px;
|
width: 0px;
|
||||||
transition: width 1s ease-out; z-index: 2;
|
transition: width 1s ease-out;
|
||||||
|
z-index: 2;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
background-color: rgb(9, 245, 166);
|
background-color: rgb(9, 245, 166);
|
||||||
border-right: 2px solid rgb(51, 162, 125);
|
border-right: 2px solid rgb(51, 162, 125);
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
#health-bg {
|
#health-bg {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 15px;
|
top: 15px;
|
||||||
|
|||||||
68
todo.txt
@@ -1,13 +1,23 @@
|
|||||||
******************************************************** NEXT PATCH **************************************************
|
******************************************************** NEXT PATCH **************************************************
|
||||||
|
|
||||||
added defense bar to HUD
|
mob damage difficulty setting is lower
|
||||||
new community map commandeer by Desboot
|
recycling now flashes green when it heals
|
||||||
|
|
||||||
|
merged cancel and research bars for single column selection
|
||||||
|
added some dark grey borders for no images selection mode
|
||||||
|
|
||||||
|
new images with midJourney V5
|
||||||
|
spores, pilot wave, standing wave
|
||||||
|
|
||||||
bug fixes
|
bug fixes
|
||||||
|
|
||||||
*********************************************************** TODO *****************************************************
|
*********************************************************** TODO *****************************************************
|
||||||
|
|
||||||
switch to prettier formatter or remove beautify
|
wormhole tech - teleport away mobs with mass below 3 when they get too near the player
|
||||||
|
short CD, small energy cost, only mobs below a mass
|
||||||
|
|
||||||
|
foam gun could have a knock back effect
|
||||||
|
maybe with pressure vessel?
|
||||||
|
|
||||||
extend brainstorming animation timers to fps cap?
|
extend brainstorming animation timers to fps cap?
|
||||||
will it be smoother or choppier?
|
will it be smoother or choppier?
|
||||||
@@ -22,59 +32,12 @@ level element - mover, transport
|
|||||||
extend uncertainty to superballs
|
extend uncertainty to superballs
|
||||||
maybe make aiming them more random?
|
maybe make aiming them more random?
|
||||||
|
|
||||||
live updating defense and damage HUD?
|
|
||||||
makes more sense for defense
|
|
||||||
for damage many effects only apply to one type of damage so it would show up
|
|
||||||
update frequency
|
|
||||||
per s
|
|
||||||
every cycle? (only if canvas)
|
|
||||||
don't include difficulty effects
|
|
||||||
draw in canvas or html?
|
|
||||||
add border for readability
|
|
||||||
a number
|
|
||||||
bars
|
|
||||||
horizontal
|
|
||||||
vertical
|
|
||||||
circles
|
|
||||||
defense
|
|
||||||
color: grey, white
|
|
||||||
scales from 0-1
|
|
||||||
wrapped around health bar like armor
|
|
||||||
what about mass-energy which has no health bar
|
|
||||||
at defense = 1 outlines health bar fully
|
|
||||||
health bar
|
|
||||||
color: keep red (green?)
|
|
||||||
red is the same as mob health bars
|
|
||||||
damage
|
|
||||||
color: red if not used for health
|
|
||||||
scales from 1-infinity maps to 0->1
|
|
||||||
1-1/(1+damage)
|
|
||||||
diagetic UI Elements
|
|
||||||
ammo number?
|
|
||||||
doesn't text look choppy when camera moves?
|
|
||||||
health bar could be rendered similarly to energy bar
|
|
||||||
what about 2 bezier curves on left and right of player head that looks like 1/3 circleRadiusScale
|
|
||||||
rotate the curves as the head rotates
|
|
||||||
what about 2 bezier both above player
|
|
||||||
as the total energy and health increases the curses could asymptotically approach a maximum length as max energy/health goes to infinity
|
|
||||||
|
|
||||||
|
|
||||||
foam gun could have a knock back effect
|
|
||||||
maybe with pressure vessel?
|
|
||||||
|
|
||||||
perfect diamagnatism could bounce on mobs, or even map elements?
|
perfect diamagnatism could bounce on mobs, or even map elements?
|
||||||
could work like a rocket jump?
|
could work like a rocket jump?
|
||||||
|
|
||||||
field tech: negative mass, wormhole?
|
|
||||||
tech: do 60% damage when not touching ground
|
|
||||||
tech: 50% defense when not touching ground
|
|
||||||
|
|
||||||
Tech: Von Neuman probes - Drones will consume blocks to replicate themselves
|
Tech: Von Neuman probes - Drones will consume blocks to replicate themselves
|
||||||
it's a little too similar to the drone repair tech, but I kinda like it better. drones that eat blocks and spit out more drones is cool
|
it's a little too similar to the drone repair tech, but I kinda like it better. drones that eat blocks and spit out more drones is cool
|
||||||
|
|
||||||
when gaining ammo have the ammo test quickly count up by Math.floor(1/20x) of the total ammo given
|
|
||||||
maybe bold, flash the text for a second after
|
|
||||||
|
|
||||||
tech: parry - immune to harm for 0.25-0.5 seconds after pressing field button
|
tech: parry - immune to harm for 0.25-0.5 seconds after pressing field button
|
||||||
needs a 5 second CD?
|
needs a 5 second CD?
|
||||||
|
|
||||||
@@ -95,7 +58,6 @@ tech - after standing wave runs out of energy from blocking, gain a buff
|
|||||||
aoe damage like railgun
|
aoe damage like railgun
|
||||||
push mobs away
|
push mobs away
|
||||||
|
|
||||||
|
|
||||||
level: lock
|
level: lock
|
||||||
should there be something in the top part of the map?
|
should there be something in the top part of the map?
|
||||||
add alt versions of left and right sides
|
add alt versions of left and right sides
|
||||||
@@ -1242,14 +1204,16 @@ if pause is pressed while selecting power ups, display pause menu on top of sele
|
|||||||
metamaterial cloaking - Scientific photography by Miki Asai, by Bruce Munro
|
metamaterial cloaking - Scientific photography by Miki Asai, by Bruce Munro
|
||||||
molecular assembler - by Laurie Greasley 16-bit Isometric
|
molecular assembler - by Laurie Greasley 16-bit Isometric
|
||||||
wormhole - by Tim White
|
wormhole - by Tim White
|
||||||
|
pilot wave -
|
||||||
|
|
||||||
nail gun - Screenprint
|
nail gun - Screenprint
|
||||||
shotgun - blueprint by Dan McPharlin
|
shotgun - blueprint by Dan McPharlin
|
||||||
grenades, missiles, explosions - by Victo Ngai
|
grenades, missiles, explosions - by Victo Ngai
|
||||||
spores - by Ernst Haeckel
|
spores - turquoise black spores on a white background full color scientific anatomy by Ernst Haeckel
|
||||||
drones - tilt-shift photography
|
drones - tilt-shift photography
|
||||||
super balls - By Akari Toriyama
|
super balls - By Akari Toriyama
|
||||||
wave - sound wave oscilloscope by Paul Catherall, concentric circles by Paul Catherall
|
wave - sound wave oscilloscope by Paul Catherall, concentric circles by Paul Catherall
|
||||||
|
Barbara Takenaga's painting depicting a clean sound wave on aoscilloscope device --ar 3:2 --v 5
|
||||||
foam - black blobs Ink doodle
|
foam - black blobs Ink doodle
|
||||||
harpoon - by Eiichiro Oda
|
harpoon - by Eiichiro Oda
|
||||||
mine - by Dan McPharlin
|
mine - by Dan McPharlin
|
||||||
|
|||||||