wikipedia links

tech, field, and gun names are now clickable wikipedia searches
  works in pause and experiment modes
  several names have also been adjusted
This commit is contained in:
landgreen
2021-10-05 17:55:04 -07:00
parent d81eff43fc
commit 8d1222301d
7 changed files with 208 additions and 134 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@@ -102,7 +102,7 @@ const b = {
for (let i = 0; i < 4; i++) powerUps.spawn(m.pos.x + 50 * (Math.random() - 0.5), m.pos.y + 50 * (Math.random() - 0.5), "ammo"); for (let i = 0; i < 4; i++) powerUps.spawn(m.pos.x + 50 * (Math.random() - 0.5), m.pos.y + 50 * (Math.random() - 0.5), "ammo");
} }
}, },
refundAmmo() { //triggers after firing when you removed ammo for a gun, but didn't need to (like a rail gun misfire) refundAmmo() { //triggers after firing when you removed ammo for a gun, but didn't need to (like a railgun misfire)
if (tech.isCrouchAmmo && input.down) { if (tech.isCrouchAmmo && input.down) {
tech.isCrouchAmmo-- tech.isCrouchAmmo--
if ((tech.isCrouchAmmo) % 2) { if ((tech.isCrouchAmmo) % 2) {
@@ -4430,7 +4430,7 @@ const b = {
fire() {} fire() {}
}, },
{ {
name: "wave beam", name: "matter wave",
description: "emit a <strong>wave packet</strong> of oscillating particles<br>that propagates through <strong>solids</strong>", description: "emit a <strong>wave packet</strong> of oscillating particles<br>that propagates through <strong>solids</strong>",
ammo: 0, ammo: 0,
ammoPack: 120, ammoPack: 120,
@@ -5189,7 +5189,7 @@ const b = {
} }
}, },
{ {
name: "rail gun", name: "railgun",
description: "use <strong class='color-f'>energy</strong> to launch a high-speed <strong>dense</strong> rod<br><strong>hold</strong> left mouse to charge, <strong>release</strong> to fire", description: "use <strong class='color-f'>energy</strong> to launch a high-speed <strong>dense</strong> rod<br><strong>hold</strong> left mouse to charge, <strong>release</strong> to fire",
ammo: 0, ammo: 0,
ammoPack: 3.5, ammoPack: 3.5,

View File

@@ -172,6 +172,13 @@ window.onresize = () => {
//********************************************************************** //**********************************************************************
// experimental build grid display and pause // experimental build grid display and pause
//********************************************************************** //**********************************************************************
//set wikipedia link
for (let i = 0, len = tech.tech.length; i < len; i++) {
if (!tech.tech[i].link) {
tech.tech[i].link = `<a target="_blank" href='https://en.wikipedia.org/w/index.php?search=${encodeURIComponent(tech.tech[i].name).replace(/'/g, '%27')}&title=Special:Search' style="color: #000;">${tech.tech[i].name}</a>`
}
}
const build = { const build = {
// onLoadPowerUps() { // onLoadPowerUps() {
// const set = getUrlVars() // const set = getUrlVars()
@@ -241,7 +248,7 @@ const build = {
</svg> </svg>
</div>`; </div>`;
for (let i = 0, len = b.inventory.length; i < len; i++) { for (let i = 0, len = b.inventory.length; i < len; i++) {
text += `<div class="pause-grid-module"><div class="grid-title"><div class="circle-grid gun"></div> &nbsp; ${b.guns[b.inventory[i]].name} - <span style="font-size:100%;font-weight: 100;">${b.guns[b.inventory[i]].ammo}</span></div> ${b.guns[b.inventory[i]].description}</div>` text += `<div class="pause-grid-module"><div class="grid-title"><div class="circle-grid gun"></div> &nbsp; ${build.nameLink(b.guns[b.inventory[i]].name)} - <span style="font-size:100%;font-weight: 100;">${b.guns[b.inventory[i]].ammo}</span></div> ${b.guns[b.inventory[i]].description}</div>`
} }
let el = document.getElementById("pause-grid-left") let el = document.getElementById("pause-grid-left")
el.style.display = "grid" el.style.display = "grid"
@@ -249,7 +256,7 @@ const build = {
//left side //left side
text = ""; text = "";
text += `<div class="pause-grid-module" id ="pause-field"><div class="grid-title"><div class="circle-grid field"></div> &nbsp; ${m.fieldUpgrades[m.fieldMode].name}</div> ${m.fieldUpgrades[m.fieldMode].description}</div>` text += `<div class="pause-grid-module" id ="pause-field"><div class="grid-title"><div class="circle-grid field"></div> &nbsp; ${build.nameLink(m.fieldUpgrades[m.fieldMode].name)}</div> ${m.fieldUpgrades[m.fieldMode].description}</div>`
for (let i = 0, len = tech.tech.length; i < len; i++) { for (let i = 0, len = tech.tech.length; i < len; i++) {
if (tech.tech[i].count > 0 && !tech.tech[i].isNonRefundable) { if (tech.tech[i].count > 0 && !tech.tech[i].isNonRefundable) {
const isCount = tech.tech[i].count > 1 ? `(${tech.tech[i].count}x)` : ""; const isCount = tech.tech[i].count > 1 ? `(${tech.tech[i].count}x)` : "";
@@ -259,23 +266,23 @@ const build = {
<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> </span>
&nbsp; &nbsp; &nbsp; &nbsp; ${tech.tech[i].name} ${isCount}</div>${tech.tech[i].description}</div></div>` &nbsp; &nbsp; &nbsp; &nbsp; ${tech.tech[i].link} ${isCount}</div>${tech.tech[i].description}</div></div>`
} else if (tech.tech[i].isGunTech) { } else if (tech.tech[i].isGunTech) {
text += `<div class="pause-grid-module"><div class="grid-title"> text += `<div class="pause-grid-module"><div class="grid-title">
<span style="position:relative;"> <span style="position:relative;">
<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> </span>
&nbsp; &nbsp; &nbsp; &nbsp; ${tech.tech[i].name} ${isCount}</div>${tech.tech[i].description}</div></div>` &nbsp; &nbsp; &nbsp; &nbsp; ${tech.tech[i].link} ${isCount}</div>${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> &nbsp; ${tech.tech[i].name} ${isCount}</div>${tech.tech[i].description}</div></div>` text += `<div class="pause-grid-module"><div class="grid-title lore-text"><div class="circle-grid lore"></div> &nbsp; ${tech.tech[i].name} ${isCount}</div>${tech.tech[i].description}</div></div>`
// } else if (tech.tech[i].isJunk) { // } else if (tech.tech[i].isJunk) {
// text += `<div class="pause-grid-module"><div class="grid-title"><div class="circle-grid junk"></div> &nbsp; ${tech.tech[i].name} ${isCount}</div>${tech.tech[i].description}</div></div>` // text += `<div class="pause-grid-module"><div class="grid-title"><div class="circle-grid junk"></div> &nbsp; ${tech.tech[i].name} ${isCount}</div>${tech.tech[i].description}</div></div>`
} else { } else {
text += `<div class="pause-grid-module"><div class="grid-title"><div class="circle-grid tech"></div> &nbsp; ${tech.tech[i].name} ${isCount}</div>${tech.tech[i].description}</div></div>` text += `<div class="pause-grid-module"><div class="grid-title"><div class="circle-grid tech"></div> &nbsp; ${tech.tech[i].link} ${isCount}</div>${tech.tech[i].description}</div></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].name}</div>${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].description}</div></div>`
} }
} }
el = document.getElementById("pause-grid-right") el = document.getElementById("pause-grid-right")
@@ -369,7 +376,7 @@ const build = {
<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> </span>
&nbsp; &nbsp; &nbsp; &nbsp; ${tech.tech[i].name} ${isCount}</div>${tech.tech[i].description} &nbsp; &nbsp; &nbsp; &nbsp; ${tech.tech[i].link} ${isCount}</div>${tech.tech[i].description}
</div>` </div>`
// <div class="circle-grid gun" style="position:absolute; top:-3px; left:-3px; opacity:1; height: 33px; width:33px;"></div> // <div class="circle-grid gun" style="position:absolute; top:-3px; left:-3px; opacity:1; height: 33px; width:33px;"></div>
// <div class="circle-grid tech" style="position:absolute; top:5px; left:5px;opacity:1;height: 20px; width:20px;border: #fff solid 2px;"></div> // <div class="circle-grid tech" style="position:absolute; top:5px; left:5px;opacity:1;height: 20px; width:20px;border: #fff solid 2px;"></div>
@@ -382,18 +389,18 @@ const build = {
<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> </span>
&nbsp; &nbsp; &nbsp; &nbsp; ${tech.tech[i].name} ${isCount}</div>${tech.tech[i].description} &nbsp; &nbsp; &nbsp; &nbsp; ${tech.tech[i].link} ${isCount}</div>${tech.tech[i].description}
</div>` </div>`
} else } else
if (tech.tech[i].isJunk) { if (tech.tech[i].isJunk) {
// text += `<div class="pause-grid-module"><div class="grid-title"><div class="circle-grid junk"></div> &nbsp; ${tech.tech[i].name} ${isCount}</div>${tech.tech[i].description}</div></div>` // text += `<div class="pause-grid-module"><div class="grid-title"><div class="circle-grid junk"></div> &nbsp; ${tech.tech[i].name} ${isCount}</div>${tech.tech[i].description}</div></div>`
techID.innerHTML = `<div class="grid-title"><div class="circle-grid junk"></div> &nbsp; ${tech.tech[i].name} ${isCount}</div>${tech.tech[i].description}</div>` techID.innerHTML = `<div class="grid-title"><div class="circle-grid junk"></div> &nbsp; ${tech.tech[i].link} ${isCount}</div>${tech.tech[i].description}</div>`
} else if (tech.tech[i].isExperimentalMode) { } else if (tech.tech[i].isExperimentalMode) {
// techID.innerHTML = `${tech.tech[i].description}</div>` // techID.innerHTML = `${tech.tech[i].description}</div>`
techID.innerHTML = `<div class="grid-title">${tech.tech[i].name}</div>${tech.tech[i].description}</div>` techID.innerHTML = `<div class="grid-title">${tech.tech[i].name}</div>${tech.tech[i].description}</div>`
// text += `<div class="grid-title">${tech.tech[i].name}</div> ${tech.tech[i].description}</div>` // text += `<div class="grid-title">${tech.tech[i].name}</div> ${tech.tech[i].description}</div>`
} else { } else {
techID.innerHTML = `<div class="grid-title"><div class="circle-grid tech"></div> &nbsp; ${tech.tech[i].name} ${isCount}</div>${tech.tech[i].description}</div>` techID.innerHTML = `<div class="grid-title"><div class="circle-grid tech"></div> &nbsp; ${tech.tech[i].link} ${isCount}</div>${tech.tech[i].description}</div>`
} }
//deselect selected tech options if you don't have the tech any more // for example: when bot techs are converted after a bot upgrade tech is taken //deselect selected tech options if you don't have the tech any more // for example: when bot techs are converted after a bot upgrade tech is taken
if (tech.tech[i].count === 0 && techID.classList.contains("build-tech-selected")) techID.classList.remove("build-tech-selected"); if (tech.tech[i].count === 0 && techID.classList.contains("build-tech-selected")) techID.classList.remove("build-tech-selected");
@@ -455,10 +462,10 @@ const build = {
</div> </div>
</div>` </div>`
for (let i = 0, len = m.fieldUpgrades.length; i < len; i++) { for (let i = 0, len = m.fieldUpgrades.length; i < len; i++) {
text += `<div id ="field-${i}" class="experiment-grid-module" onclick="build.choosePowerUp(this,${i},'field')"><div class="grid-title"><div class="circle-grid field"></div> &nbsp; ${m.fieldUpgrades[i].name}</div> ${m.fieldUpgrades[i].description}</div>` text += `<div id ="field-${i}" class="experiment-grid-module" onclick="build.choosePowerUp(this,${i},'field')"><div class="grid-title"><div class="circle-grid field"></div> &nbsp; ${build.nameLink(m.fieldUpgrades[i].name)}</div> ${m.fieldUpgrades[i].description}</div>`
} }
for (let i = 0, len = b.guns.length; i < len; i++) { for (let i = 0, len = b.guns.length; i < len; i++) {
text += `<div id = "gun-${i}" class="experiment-grid-module" onclick="build.choosePowerUp(this,${i},'gun')"><div class="grid-title"><div class="circle-grid gun"></div> &nbsp; ${b.guns[i].name}</div> ${b.guns[i].description}</div>` text += `<div id = "gun-${i}" class="experiment-grid-module" onclick="build.choosePowerUp(this,${i},'gun')"><div class="grid-title"><div class="circle-grid gun"></div> &nbsp; ${build.nameLink(b.guns[i].name)}</div> ${b.guns[i].description}</div>`
} }
for (let i = 0, len = tech.tech.length; i < len; i++) { for (let i = 0, len = tech.tech.length; i < len; i++) {
if (!tech.tech[i].isExperimentHide && (!tech.tech[i].isNonRefundable || tech.tech[i].isExperimentalMode)) { if (!tech.tech[i].isExperimentHide && (!tech.tech[i].isNonRefundable || tech.tech[i].isExperimentalMode)) {
@@ -466,7 +473,7 @@ const build = {
if (tech.tech[i].isExperimentalMode) { if (tech.tech[i].isExperimentalMode) {
text += `<div id="tech-${i}" class="experiment-grid-module" onclick="build.choosePowerUp(this,${i},'tech')"><div class="grid-title">${tech.tech[i].name}</div> ${tech.tech[i].description}</div>` text += `<div id="tech-${i}" class="experiment-grid-module" onclick="build.choosePowerUp(this,${i},'tech')"><div class="grid-title">${tech.tech[i].name}</div> ${tech.tech[i].description}</div>`
} else { } else {
text += `<div id="tech-${i}" class="experiment-grid-module" onclick="build.choosePowerUp(this,${i},'tech')"><div class="grid-title"><div class="circle-grid tech"></div> &nbsp; ${tech.tech[i].name}</div> ${tech.tech[i].description}</div>` text += `<div id="tech-${i}" class="experiment-grid-module" onclick="build.choosePowerUp(this,${i},'tech')"><div class="grid-title"><div class="circle-grid tech"></div> &nbsp; ${tech.tech[i].link}</div> ${tech.tech[i].description}</div>`
} }
} else { } else {
text += `<div id="tech-${i}" class="experiment-grid-module experiment-grid-disabled"><div class="grid-title"> ${tech.tech[i].name}</div> ${tech.tech[i].description}</div>` text += `<div id="tech-${i}" class="experiment-grid-module experiment-grid-disabled"><div class="grid-title"> ${tech.tech[i].name}</div> ${tech.tech[i].description}</div>`
@@ -497,6 +504,9 @@ const build = {
} }
} }
}, },
nameLink(text) { //converts text into a clickable wikipedia search
return `<a target="_blank" href='https://en.wikipedia.org/w/index.php?search=${encodeURIComponent(text).replace(/'/g, '%27')}&title=Special:Search' style="color: #000;">${text}</a>`
},
reset() { reset() {
simulation.startGame(true); //starts game, but pauses it simulation.startGame(true); //starts game, but pauses it
build.isExperimentSelection = true; build.isExperimentSelection = true;

View File

@@ -1471,7 +1471,7 @@ const m = {
} }
}, },
{ {
name: "standing wave harmonics", name: "standing wave",
description: "<strong>3</strong> oscillating <strong>shields</strong> are permanently active<br><strong>deflecting</strong> protects you in every <strong>direction</strong><br><strong>deflecting</strong> has <strong>50%</strong> less <strong>recoil</strong>", //drains <strong class='color-f'>energy</strong> description: "<strong>3</strong> oscillating <strong>shields</strong> are permanently active<br><strong>deflecting</strong> protects you in every <strong>direction</strong><br><strong>deflecting</strong> has <strong>50%</strong> less <strong>recoil</strong>", //drains <strong class='color-f'>energy</strong>
drainCD: 0, drainCD: 0,
effect: () => { effect: () => {
@@ -1757,7 +1757,7 @@ const m = {
} }
}, },
{ {
name: "negative mass field", name: "negative mass",
description: "use <strong class='color-f'>energy</strong> to nullify &nbsp;<strong style='letter-spacing: 7px;'>gravity</strong><br>reduce <strong class='color-harm'>harm</strong> by <strong>55%</strong><br>hold <strong class='color-block'>blocks</strong> as if they have a lower <strong>mass</strong>", description: "use <strong class='color-f'>energy</strong> to nullify &nbsp;<strong style='letter-spacing: 7px;'>gravity</strong><br>reduce <strong class='color-harm'>harm</strong> by <strong>55%</strong><br>hold <strong class='color-block'>blocks</strong> as if they have a lower <strong>mass</strong>",
fieldDrawRadius: 0, fieldDrawRadius: 0,
effect: () => { effect: () => {
@@ -1907,7 +1907,7 @@ const m = {
} }
}, },
{ {
name: "nano-scale manufacturing", name: "molecular assembler",
description: "excess <strong class='color-f'>energy</strong> used to build <strong>drones</strong><br>use <strong class='color-f'>energy</strong> to <strong>deflect</strong> mobs<br><strong>double</strong> your default <strong class='color-f'>energy</strong> regeneration", description: "excess <strong class='color-f'>energy</strong> used to build <strong>drones</strong><br>use <strong class='color-f'>energy</strong> to <strong>deflect</strong> mobs<br><strong>double</strong> your default <strong class='color-f'>energy</strong> regeneration",
effect: () => { effect: () => {
// m.fieldMeterColor = "#0c5" // m.fieldMeterColor = "#0c5"

View File

@@ -388,9 +388,9 @@ const simulation = {
} }
}, },
switchGun() { switchGun() {
if (tech.isLongitudinal && b.guns[b.activeGun].name === "wave beam") { if (tech.isLongitudinal && b.guns[b.activeGun].name === "matter wave") {
for (i = 0, len = b.guns.length; i < len; i++) { //find which gun for (i = 0, len = b.guns.length; i < len; i++) { //find which gun
if (b.guns[i].name === "wave beam") { if (b.guns[i].name === "matter wave") {
b.guns[i].waves = []; //empty array of wave bullets b.guns[i].waves = []; //empty array of wave bullets
break; break;
} }
@@ -746,7 +746,7 @@ const simulation = {
if (m.alive) { if (m.alive) {
if (tech.isLongitudinal) { if (tech.isLongitudinal) {
for (i = 0, len = b.guns.length; i < len; i++) { //find which gun for (i = 0, len = b.guns.length; i < len; i++) { //find which gun
if (b.guns[i].name === "wave beam") { if (b.guns[i].name === "matter wave") {
b.guns[i].waves = []; //empty array of wave bullets b.guns[i].waves = []; //empty array of wave bullets
break; break;
} }

File diff suppressed because it is too large Load Diff

View File

@@ -1,13 +1,16 @@
******************************************************** NEXT PATCH ************************************************** ******************************************************** NEXT PATCH **************************************************
new boss: slasherBoss - radially waving short distance lasers tech, field, and gun names are now clickable wikipedia searches
works in pause and experiment modes
aerogel 250%->150% foam damage several names have also been adjusted
bug fixes
******************************************************** TODO ******************************************************** ******************************************************** TODO ********************************************************
bad links:
add link URL to all tech guns and field on page load
but only if URL is undefined so hard to search names can be added in by hand
slasherBoss slasherBoss
sine wave of lasers that travel around vertexes sine wave of lasers that travel around vertexes
10+ sided 10+ sided
@@ -84,7 +87,7 @@ Pilot wave tech
make experiment and understand vibe more obvious make experiment and understand vibe more obvious
mostly in early game or first time players mostly in early game or first time players
look into 360 wave beam lag look into 360 matter wave lag
aoe effect pushes mobs away, then rapidly pulls them in aoe effect pushes mobs away, then rapidly pulls them in
for mines? for mines?
@@ -99,7 +102,7 @@ it would be helpful if there was a mechanism to recover mobs that fly off the ma
make non moving bosses not move after getting hit make non moving bosses not move after getting hit
shooter, shielding, shooter, shielding,
buff rail gun buff railgun
scrolling console history in pause menu? scrolling console history in pause menu?
pause should at least show the last in game console message pause should at least show the last in game console message
@@ -114,7 +117,7 @@ tech: quantized shields - harmonic standing wave field can only lose 33 energy p
doesn't stack with spherical tech doesn't stack with spherical tech
make a tech that improves all charge guns make a tech that improves all charge guns
for: pulse, foam, rail gun for: pulse, foam, railgun
effect: effect:
faster charge rate? faster charge rate?
fire speed already does that... fire speed already does that...
@@ -135,7 +138,7 @@ tech: use the ability for power ups to have custom code
explode if they touch? explode if they touch?
apply the new gun.do functions to other guns apply the new gun.do functions to other guns
rail gun railgun
crouching missile? crouching missile?
works similar to foam works similar to foam
performance issues? performance issues?