more orbs in text
replaced tech, field, and gun text with orbs orbs length scale with px->em cleaned up simulation variables text in pause menu some minor tech description changes total tech count no longer includes instant tech or removed tech tech: planned obsolescence - at the start of each level eject your oldest tech and gain 1.1 damage heuristics 1.3 -> between 1 and 1.5 fire rate combinatorial optimization 1.35->1.4 damage difficulty reduction per level 0.85->0.87x damage done 1.23->1.22 damage taken
This commit is contained in:
11
js/bullet.js
11
js/bullet.js
@@ -2286,14 +2286,9 @@ const b = {
|
||||
//calculate laser collision
|
||||
let range = tech.isPlasmaRange * (120 + (m.crouch ? 400 : 300) * Math.sqrt(Math.random())) //+ 100 * Math.sin(m.cycle * 0.3);
|
||||
// const dir = m.angle // + 0.04 * (Math.random() - 0.5)
|
||||
const path = [{
|
||||
x: m.pos.x + 20 * Math.cos(m.angle),
|
||||
y: m.pos.y + 20 * Math.sin(m.angle)
|
||||
},
|
||||
{
|
||||
x: m.pos.x + range * Math.cos(m.angle),
|
||||
y: m.pos.y + range * Math.sin(m.angle)
|
||||
}
|
||||
const path = [
|
||||
{ x: m.pos.x + 20 * Math.cos(m.angle), y: m.pos.y + 20 * Math.sin(m.angle) },
|
||||
{ x: m.pos.x + range * Math.cos(m.angle), y: m.pos.y + range * Math.sin(m.angle) }
|
||||
];
|
||||
//check for collisions
|
||||
let best = {
|
||||
|
||||
@@ -122,7 +122,7 @@ function collisionChecks(event) {
|
||||
}
|
||||
if (tech.isPiezo) m.energy += 20.48;
|
||||
if (tech.isCouplingNoHit && m.coupling > 0) {
|
||||
m.couplingChange(-4)
|
||||
m.couplingChange(-3)
|
||||
|
||||
const unit = Vector.rotate({ x: 1, y: 0 }, 6.28 * Math.random())
|
||||
let where = Vector.add(m.pos, Vector.mult(unit, 17))
|
||||
|
||||
163
js/index.js
163
js/index.js
@@ -456,15 +456,17 @@ const build = {
|
||||
generatePauseLeft() {
|
||||
//left side
|
||||
let botText = ""
|
||||
if (tech.nailBotCount) botText += `<br>nail-bots: ${tech.nailBotCount}`
|
||||
if (tech.orbitBotCount) botText += `<br>orbital-bots: ${tech.orbitBotCount}`
|
||||
if (tech.boomBotCount) botText += `<br>boom-bots: ${tech.boomBotCount}`
|
||||
if (tech.laserBotCount) botText += `<br>laser-bots: ${tech.laserBotCount}`
|
||||
if (tech.foamBotCount) botText += `<br>foam-bots: ${tech.foamBotCount}`
|
||||
if (tech.soundBotCount) botText += `<br>sound-bots: ${tech.soundBotCount}`
|
||||
if (tech.dynamoBotCount) botText += `<br>dynamo-bots: ${tech.dynamoBotCount}`
|
||||
if (tech.plasmaBotCount) botText += `<br>plasma-bots: ${tech.plasmaBotCount}`
|
||||
if (tech.missileBotCount) botText += `<br>missile-bots: ${tech.missileBotCount}`
|
||||
if (tech.nailBotCount) botText += `<br>nail-bots ${tech.nailBotCount}`
|
||||
if (tech.orbitBotCount) botText += `<br>orbital-bots ${tech.orbitBotCount}`
|
||||
if (tech.boomBotCount) botText += `<br>boom-bots ${tech.boomBotCount}`
|
||||
if (tech.laserBotCount) botText += `<br>laser-bots ${tech.laserBotCount}`
|
||||
if (tech.foamBotCount) botText += `<br>foam-bots ${tech.foamBotCount}`
|
||||
if (tech.soundBotCount) botText += `<br>sound-bots ${tech.soundBotCount}`
|
||||
if (tech.dynamoBotCount) botText += `<br>dynamo-bots ${tech.dynamoBotCount}`
|
||||
if (tech.plasmaBotCount) botText += `<br>plasma-bots ${tech.plasmaBotCount}`
|
||||
if (tech.missileBotCount) botText += `<br>missile-bots ${tech.missileBotCount}`
|
||||
|
||||
// <strong class='color-g'>${b.activeGun === null || b.activeGun === undefined ? "undefined" : b.guns[b.activeGun].name}</strong> (${b.activeGun === null || b.activeGun === undefined ? "0" : b.guns[b.activeGun].ammo})
|
||||
|
||||
let text = `<div class="pause-grid-module" style="padding: 8px;">
|
||||
<span style="font-size:1.4em;font-weight: 600; float: left;">PAUSED</span>
|
||||
@@ -482,24 +484,33 @@ const build = {
|
||||
<details id = "simulation-variables-details" style="padding: 0 8px;line-height: 140%;">
|
||||
<summary>simulation variables</summary>
|
||||
<div class="pause-details">
|
||||
<strong class='color-d'>damage</strong>: ${((tech.damageFromTech())).toPrecision(4)}x <span style="float: right;"><strong class='color-d'>difficulty:</strong> ${((m.dmgScale)).toPrecision(4)}x</span>
|
||||
<br><strong class='color-defense'>damage taken</strong>: ${(m.defense()).toPrecision(4)}x <span style="float: right;"><strong class='color-defense'>difficulty:</strong> ${(simulation.dmgScale).toPrecision(4)}x</span>
|
||||
<br><strong><em>fire rate</em></strong>: ${(1 / b.fireCDscale).toFixed(2)}x
|
||||
${tech.duplicationChance() ? `<br><strong class='color-dup'>duplication</strong>: ${(tech.duplicationChance() * 100).toFixed(0)}%` : ""}
|
||||
<strong class='color-d'>damage</strong> ${((tech.damageFromTech())).toPrecision(4)}x
|
||||
<span style="float: right;"><strong class='color-d'>level</strong> ${((m.dmgScale)).toPrecision(4)}x</span>
|
||||
<br><strong class='color-defense'>damage taken</strong> ${(m.defense()).toPrecision(4)}x
|
||||
<span style="float: right;"><strong class='color-defense'>level</strong> ${(simulation.dmgScale).toPrecision(4)}x</span>
|
||||
<br><strong class='color-h'>health</strong> (${(m.health * 100).toFixed(0)} / ${(m.maxHealth * 100).toFixed(0)})
|
||||
<span style="float: right;">${powerUps.research.count} ${powerUps.orb.research()}</span>
|
||||
<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;">${tech.totalCount} ${powerUps.orb.tech()}</span>
|
||||
<br><strong><em>fire rate</em></strong> ${(1 / b.fireCDscale).toFixed(2)}x
|
||||
<span style="float: right;">mass ${player.mass.toFixed(1)}</span>
|
||||
${m.coupling ? `<br><span style = 'font-size:90%;'>` + m.couplingDescription(m.coupling) + `</span> from ${(m.coupling).toFixed(0)} ${powerUps.orb.coupling(1)}` : ""}
|
||||
<br><strong class='color-dup'>duplication</strong> ${(tech.duplicationChance() * 100).toFixed(0)}%
|
||||
<span style="float: right;"><strong class='color-junk'>JUNK</strong> ${(100 * tech.junkChance).toFixed(0)}%</span>
|
||||
<br>
|
||||
<br> ${level.levelAnnounce()}
|
||||
<span style="float: right;">position (${player.position.x.toFixed(0)}, ${player.position.y.toFixed(0)})</span>
|
||||
<br>seed ${Math.initialSeed}
|
||||
<span style="float: right;">mouse (${simulation.mouseInGame.x.toFixed(0)}, ${simulation.mouseInGame.y.toFixed(0)})</span>
|
||||
<br>cycles ${m.cycle}
|
||||
<span style="float: right;">velocity (${player.velocity.x.toFixed(2)}, ${player.velocity.y.toFixed(2)})</span>
|
||||
${botText}
|
||||
<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>
|
||||
<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(0)}, ${player.position.y.toFixed(0)})</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}
|
||||
<span style="float: right;">mouse: (${simulation.mouseInGame.x.toFixed(0)}, ${simulation.mouseInGame.y.toFixed(0)})</span>
|
||||
<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(2)}, ${player.velocity.y.toFixed(2)})</span>
|
||||
${tech.junkChance ? `<br><strong class='color-junk'>JUNK</strong>: ${(100 * tech.junkChance).toFixed(1)}% ` : ""}
|
||||
<br>mobs: ${spawn.pickList[0]}, ${spawn.pickList[0]}
|
||||
<br>seed: ${Math.initialSeed} ${m.cycle} cycles
|
||||
<br>mobs: ${mob.length} blocks: ${body.length} bullets: ${bullet.length} power ups: ${powerUp.length} ${simulation.isCheating ? "<br><br><em>lore disabled</em>" : ""}
|
||||
<br>mobs ${mob.length} (${spawn.pickList[0]}, ${spawn.pickList[0]})
|
||||
<span style="float: right;">blocks ${body.length}</span>
|
||||
<br>bullets ${bullet.length}
|
||||
<span style="float: right;">power ups ${powerUp.length}</span>
|
||||
|
||||
${simulation.isCheating ? "<br><br><em>lore disabled</em>" : ""}
|
||||
</div>
|
||||
</details>
|
||||
</div>`
|
||||
@@ -507,11 +518,11 @@ ${tech.junkChance ? `<br><strong class='color-junk'>JUNK</strong>: ${(100 * tech
|
||||
<details id="difficulty-parameters-details" style="padding: 0 8px;">
|
||||
<summary>difficulty parameters</summary>
|
||||
<div class="pause-details">
|
||||
${simulation.difficultyMode > 0 ? `<div class="pause-difficulty-row"><strong>0.85x</strong> <strong class='color-d'>damage</strong> done per level<br><strong>1.23x</strong> <strong class='color-defense'>damage taken</strong> per level</div>` : " "}
|
||||
${simulation.difficultyMode > 1 ? `<div class="pause-difficulty-row"><strong>-5</strong> initial <strong>power ups</strong><br><strong>faster</strong> and <strong>more</strong> mobs per level</div>` : " "}
|
||||
${simulation.difficultyMode > 2 ? `<div class="pause-difficulty-row"><strong>0.85x</strong> <strong class='color-d'>damage</strong> done per level<br><strong>1.23x</strong> <strong class='color-defense'>damage taken</strong> per level</div>` : " "}
|
||||
${simulation.difficultyMode > 3 ? `<div class="pause-difficulty-row"><strong>+1</strong> boss per level<br><strong>-1</strong> <strong class='color-m'>tech</strong> per boss</div>` : " "}
|
||||
${simulation.difficultyMode > 4 ? `<div class="pause-difficulty-row"><strong>0.85x</strong> <strong class='color-d'>damage</strong> done per level<br><strong>1.23x</strong> <strong class='color-defense'>damage taken</strong> per level</div>` : " "}
|
||||
${simulation.difficultyMode > 0 ? `<div class="pause-difficulty-row"><strong>0.87x</strong> <strong class='color-d'>damage</strong> done per level<br><strong>1.22x</strong> <strong class='color-defense'>damage taken</strong> per level</div>` : " "}
|
||||
${simulation.difficultyMode > 1 ? `<div class="pause-difficulty-row"><strong>-5</strong> initial <strong>power ups</strong><br><strong>faster</strong> mobs and <strong>more</strong> mobs</div>` : " "}
|
||||
${simulation.difficultyMode > 2 ? `<div class="pause-difficulty-row"><strong>0.87x</strong> <strong class='color-d'>damage</strong> done per level<br><strong>1.22x</strong> <strong class='color-defense'>damage taken</strong> per level</div>` : " "}
|
||||
${simulation.difficultyMode > 3 ? `<div class="pause-difficulty-row"><strong>+1</strong> boss per level<br><strong>-1</strong> ${powerUps.orb.tech()} per boss</div>` : " "}
|
||||
${simulation.difficultyMode > 4 ? `<div class="pause-difficulty-row"><strong>0.87x</strong> <strong class='color-d'>damage</strong> done per level<br><strong>1.22x</strong> <strong class='color-defense'>damage taken</strong> per level</div>` : " "}
|
||||
${simulation.difficultyMode > 5 ? `<div class="pause-difficulty-row"><strong>3x</strong> chance for <strong>shielded</strong> mobs<br><strong>-3</strong> initial power ups</div>` : " "}
|
||||
</div>
|
||||
</details>
|
||||
@@ -571,15 +582,15 @@ ${tech.junkChance ? `<br><strong class='color-junk'>JUNK</strong>: ${(100 * tech
|
||||
},
|
||||
generatePauseRight() {
|
||||
let text = `<div class="sort">
|
||||
<button onclick="build.sortTech('damage')" class='sort-button'><strong class='color-d'>damage</strong></button>
|
||||
<button onclick="build.sortTech('guntech')" class='sort-button'><strong class='color-g'>gun</strong><strong class='color-m'>tech</strong></button>
|
||||
<button onclick="build.sortTech('fieldtech')" class='sort-button'><strong class='color-f'>field</strong><strong class='color-m'>tech</strong></button>
|
||||
<button onclick="build.sortTech('heal')" class='sort-button'><strong class='color-h'>heal</strong></button>
|
||||
<button onclick="build.sortTech('damage taken')" class='sort-button'><strong style="letter-spacing: 1px;font-weight: 100;">damage taken</strong></button>
|
||||
<button onclick="build.sortTech('energy')" class='sort-button'><strong class='color-f'>energy</strong></button>
|
||||
<input type="search" id="sort-input" style="width: 5em;font-size: 0.6em;color:#000;" placeholder="sort by" />
|
||||
<button onclick="build.sortTech('input')" class='sort-button' style="border-radius: 0em;border: 1.5px #000 solid;font-size: 0.6em;" value="damage">sort</button>
|
||||
</div>`;
|
||||
<button onclick="build.sortTech('guntech')" class='sort-button'>${powerUps.orb.gunTech()}</button>
|
||||
<button onclick="build.sortTech('fieldtech')" class='sort-button'>${powerUps.orb.fieldTech()}</button>
|
||||
<button onclick="build.sortTech('damage')" class='sort-button'><strong class='color-d'>damage</strong></button>
|
||||
<button onclick="build.sortTech('damage taken')" class='sort-button'><strong style="letter-spacing: 1px;font-weight: 100;">dmg taken</strong></button>
|
||||
<button onclick="build.sortTech('heal')" class='sort-button'><strong class='color-h'>heal</strong></button>
|
||||
<button onclick="build.sortTech('energy')" class='sort-button'><strong class='color-f'>energy</strong></button>
|
||||
<input type="search" id="sort-input" style="width: 8em;font-size: 0.6em;color:#000;" placeholder="sort by" />
|
||||
<button onclick="build.sortTech('input')" class='sort-button' style="border-radius: 0em;border: 1.5px #000 solid;font-size: 0.6em;" value="damage">sort</button>
|
||||
</div>`;
|
||||
const ejectClass = (tech.isPauseEjectTech && !simulation.isChoosing) ? 'pause-eject' : ''
|
||||
for (let i = 0, len = tech.tech.length; i < len; i++) {
|
||||
if (tech.tech[i].count > 0) {
|
||||
@@ -924,43 +935,43 @@ ${tech.junkChance ? `<br><strong class='color-junk'>JUNK</strong>: ${(100 * tech
|
||||
// <button onclick="build.sortTech('have', true)" class='sort-button color-m' style="letter-spacing: 1px;font-weight: 800;">have</button>
|
||||
populateGrid() { //background-color:var(--build-bg-color);
|
||||
let text = `
|
||||
<div class="experiment-start-box">
|
||||
<div class="sort" style="border: 0px;">
|
||||
<button onclick="build.sortTech('guntech', true)" class='sort-button'><strong class='color-g'>gun</strong><strong class='color-m'>tech</strong></button>
|
||||
<button onclick="build.sortTech('fieldtech', true)" class='sort-button'><strong class='color-f'>field</strong><strong class='color-m'>tech</strong></button>
|
||||
<button onclick="build.sortTech('damage', true)" class='sort-button'><strong class='color-d'>damage</strong></button>
|
||||
<button onclick="build.sortTech('energy')" class='sort-button'><strong class='color-f'>energy</strong></button>
|
||||
<button onclick="build.sortTech('damage taken', true)" class='sort-button'><strong style="letter-spacing: 1px;font-weight: 100;">damage taken</strong></button>
|
||||
<button onclick="build.sortTech('heal')" class='sort-button'><strong class='color-h'>heal</strong></button>
|
||||
<input type="search" id="sort-input" style="width: 6em;font-size: 0.6em;color:#000;" placeholder="sort by" />
|
||||
<button onclick="build.sortTech('input', true)" class='sort-button' style="border-radius: 0em;border: 1.5px #000 solid;font-size: 0.6em;" value="damage">sort</button>
|
||||
</div>
|
||||
<div>
|
||||
<div style="display: grid;grid-template-columns: repeat(3, 1fr);row-gap: 10px;column-gap: 25px;grid-auto-rows: minmax(5px, auto);margin:-5px 0px 10px 25px;line-height: 100%;">
|
||||
<div style="grid-column: 1;grid-row: 2 / 4;">
|
||||
<svg class="SVG-button" onclick="build.startExperiment()" width="150" height="70" >
|
||||
<g stroke='none' fill='#333' stroke-width="2" font-size="65px" font-family="Ariel, sans-serif">
|
||||
<text x="10" y="57">start</text>
|
||||
</g>
|
||||
</svg>
|
||||
</div>
|
||||
<div style="grid-column: 2;grid-row: 2;">
|
||||
<svg class="SVG-button" onclick="build.reset()" width="50" height="25">
|
||||
<g stroke='none' fill='#333' stroke-width="2" font-size="17px" font-family="Ariel, sans-serif">
|
||||
<text x="5" y="18">reset</text>
|
||||
</g>
|
||||
</svg>
|
||||
</div>
|
||||
<div style="grid-column: 2;grid-row: 3/4;">
|
||||
<svg class="SVG-button" onclick="build.shareURL(true)" width="52" height="25">
|
||||
<g stroke='none' fill='#333' stroke-width="2" font-size="17px" font-family="Ariel, sans-serif">
|
||||
<text x="5" y="18">share</text>
|
||||
</g>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`
|
||||
<div class="experiment-start-box">
|
||||
<div class="sort" style="border: 0px;">
|
||||
<button onclick="build.sortTech('guntech', true)" class='sort-button'>${powerUps.orb.gunTech()}</button>
|
||||
<button onclick="build.sortTech('fieldtech', true)" class='sort-button'>${powerUps.orb.fieldTech()}</button>
|
||||
<button onclick="build.sortTech('damage', true)" class='sort-button'><strong class='color-d'>damage</strong></button>
|
||||
<button onclick="build.sortTech('damage taken', true)" class='sort-button'><strong style="letter-spacing: 1px;font-weight: 100;">dmg taken</strong></button>
|
||||
<button onclick="build.sortTech('heal')" class='sort-button'><strong class='color-h'>heal</strong></button>
|
||||
<button onclick="build.sortTech('energy')" class='sort-button'><strong class='color-f'>energy</strong></button>
|
||||
<input type="search" id="sort-input" style="width: 7.5em;font-size: 0.6em;color:#000;" placeholder="sort by" />
|
||||
<button onclick="build.sortTech('input', true)" class='sort-button' style="border-radius: 0em;border: 1.5px #000 solid;font-size: 0.6em;" value="damage">sort</button>
|
||||
</div>
|
||||
<div>
|
||||
<div style="display: grid;grid-template-columns: repeat(3, 1fr);row-gap: 10px;column-gap: 25px;grid-auto-rows: minmax(5px, auto);margin:-5px 0px 10px 25px;line-height: 100%;">
|
||||
<div style="grid-column: 1;grid-row: 2 / 4;">
|
||||
<svg class="SVG-button" onclick="build.startExperiment()" width="150" height="70" >
|
||||
<g stroke='none' fill='#333' stroke-width="2" font-size="65px" font-family="Ariel, sans-serif">
|
||||
<text x="10" y="57">start</text>
|
||||
</g>
|
||||
</svg>
|
||||
</div>
|
||||
<div style="grid-column: 2;grid-row: 2;">
|
||||
<svg class="SVG-button" onclick="build.reset()" width="50" height="25">
|
||||
<g stroke='none' fill='#333' stroke-width="2" font-size="17px" font-family="Ariel, sans-serif">
|
||||
<text x="5" y="18">reset</text>
|
||||
</g>
|
||||
</svg>
|
||||
</div>
|
||||
<div style="grid-column: 2;grid-row: 3/4;">
|
||||
<svg class="SVG-button" onclick="build.shareURL(true)" width="52" height="25">
|
||||
<g stroke='none' fill='#333' stroke-width="2" font-size="17px" font-family="Ariel, sans-serif">
|
||||
<text x="5" y="18">share</text>
|
||||
</g>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`
|
||||
const hideStyle = `style="height:auto; border: none; background-color: transparent;"`
|
||||
for (let i = 0, len = m.fieldUpgrades.length; i < len; i++) {
|
||||
const style = localSettings.isHideImages ? hideStyle : `style="background-image: url('img/field/${m.fieldUpgrades[i].name}${i === 0 ? m.fieldUpgrades[0].imageNumber : ""}.webp');"`
|
||||
|
||||
73
js/level.js
73
js/level.js
@@ -26,7 +26,7 @@ const level = {
|
||||
// tech.tech[297].frequency = 100
|
||||
// tech.addJunkTechToPool(0.5)
|
||||
// m.couplingChange(10)
|
||||
// m.setField("negative mass") //1 standing wave 2 perfect diamagnetism 3 negative mass 4 molecular assembler 5 plasma torch 6 time dilation 7 metamaterial cloaking 8 pilot wave 9 wormhole 10 grappling hook
|
||||
// m.setField("plasma torch") //1 standing wave 2 perfect diamagnetism 3 negative mass 4 molecular assembler 5 plasma torch 6 time dilation 7 metamaterial cloaking 8 pilot wave 9 wormhole 10 grappling hook
|
||||
// m.energy = 0
|
||||
// powerUps.research.count = 3
|
||||
// tech.isHookWire = true
|
||||
@@ -36,29 +36,28 @@ const level = {
|
||||
// b.giveGuns("super balls") //0 nail gun 1 shotgun 2 super balls 3 wave 4 missiles 5 grenades 6 spores 7 drones 8 foam 9 harpoon 10 mine 11 laser
|
||||
// b.giveGuns("shotgun") //0 nail gun 1 shotgun 2 super balls 3 wave 4 missiles 5 grenades 6 spores 7 drones 8 foam 9 harpoon 10 mine 11 laser
|
||||
// b.giveGuns("wave") //0 nail gun 1 shotgun 2 super balls 3 wave 4 missiles 5 grenades 6 spores 7 drones 8 foam 9 harpoon 10 mine 11 laser
|
||||
// b.giveGuns("laser") //0 nail gun 1 shotgun 2 super balls 3 wave 4 missiles 5 grenades 6 spores 7 drones 8 foam 9 harpoon 10 mine 11 laser
|
||||
// b.giveGuns("wave") //0 nail gun 1 shotgun 2 super balls 3 wave 4 missiles 5 grenades 6 spores 7 drones 8 foam 9 harpoon 10 mine 11 laser
|
||||
// tech.laserColor = "#fff"
|
||||
// tech.laserColorAlpha = "rgba(255, 255, 255, 0.5)"
|
||||
|
||||
// b.guns[8].ammo = 100000000
|
||||
// requestAnimationFrame(() => { tech.giveTech("optical amplifier") });
|
||||
// requestAnimationFrame(() => { tech.giveTech("stimulated emission") });
|
||||
// tech.giveTech("1st ionization energy")
|
||||
// for (let i = 0; i < 1; ++i) tech.giveTech("tokamak")
|
||||
// for (let i = 0; i < 1; ++i) tech.giveTech("inertial confinement")
|
||||
// for (let i = 0; i < 1; ++i) tech.giveTech("stellarator")
|
||||
// for (let i = 0; i < 1; ++i) tech.giveTech("mass-energy equivalence")
|
||||
// requestAnimationFrame(() => { for (let i = 0; i < 10; i++) b.orbitBot(m.pos, false) });
|
||||
// requestAnimationFrame(() => { for (let i = 0; i < 1; i++) tech.giveTech("1st ionization energy") });
|
||||
// for (let i = 0; i < 1; i++) tech.giveTech("tungsten carbide")
|
||||
// for (let i = 0; i < 1; ++i) tech.giveTech("booby trap")
|
||||
// for (let i = 0; i < 1; ++i) tech.giveTech("obsolescence")
|
||||
// for (let i = 0; i < 1; ++i) tech.giveTech("arsenal")
|
||||
// requestAnimationFrame(() => { for (let i = 0; i < 3; i++) tech.giveTech("mechatronics") });
|
||||
// requestAnimationFrame(() => { for (let i = 0; i < 1; i++) tech.giveTech("paradigm shift") });
|
||||
// for (let i = 0; i < 2; i++) tech.giveTech("nail-bot")
|
||||
// m.lastKillCycle = m.cycle
|
||||
// for (let i = 0; i < 1; ++i) tech.giveTech("compression engine")
|
||||
// for (let i = 0; i < 1; ++i) tech.giveTech("cross-disciplinary")
|
||||
// for (let i = 0; i < 3; i++) powerUps.directSpawn(450, -50, "tech");
|
||||
// for (let i = 0; i < 1; i++) powerUps.directSpawn(-50, -70, "difficulty", false);
|
||||
// spawn.mapRect(575, -700, 25, 425); //block mob line of site on testing
|
||||
// level.testing();
|
||||
|
||||
// for (let i = 0; i < 1; ++i) spawn.snakeBoss(1400, -500)
|
||||
// for (let i = 0; i < 2; i++) powerUps.directSpawn(800, -100, "coupling");
|
||||
// for (let i = 0; i < 20; i++) powerUps.directSpawn(0, 0, "coupling");
|
||||
// Matter.Body.setPosition(player, { x: -200, y: -3330 });
|
||||
// for (let i = 0; i < 4; ++i) spawn.sucker(1300, -500 + 100 * Math.random())
|
||||
// spawn.hopper(1900, -500)
|
||||
@@ -112,7 +111,10 @@ const level = {
|
||||
if (localSettings.isAllowed) localStorage.setItem("localSettings", JSON.stringify(localSettings)); //update local storage
|
||||
}
|
||||
}
|
||||
if (!simulation.isTraining) level.levelAnnounce();
|
||||
if (!simulation.isTraining) {
|
||||
document.title = "n-gon: " + level.levelAnnounce();
|
||||
simulation.makeTextLog(`<span class='color-var'>level</span>.onLevel <span class='color-symbol'>=</span> "<span class='color-text'>${level.levels[level.onLevel]}</span>"`);
|
||||
}
|
||||
simulation.setupCamera(player.position);
|
||||
simulation.setZoom();
|
||||
level.addToWorld(); //add bodies to game engine
|
||||
@@ -204,6 +206,19 @@ const level = {
|
||||
// if (h > healPerOrb) powerUps.spawnDelay("heal", h);
|
||||
// simulation.makeTextLog(`${(Math.ceil(tech.interestRate * 100)).toFixed(0)}<span class='color-symbol'>%</span> <span class='color-m'>interest</span> on <span class='color-h'>health</span> <span class='color-symbol'>=</span> ${h > 20 ? h + powerUps.orb.heal(1) : powerUps.orb.heal(h)}`)
|
||||
}
|
||||
if (tech.ejectOld > 0) {
|
||||
let index = null //find oldest tech that you have
|
||||
for (let i = 0; i < tech.tech.length; i++) {
|
||||
if (tech.tech[i].count > 0) index = i
|
||||
}
|
||||
if (index) { //eject it
|
||||
const effect = Math.pow(1.1, tech.tech[index].count)
|
||||
simulation.makeTextLog(`<strong>${(effect).toFixed(2)}x</strong> <strong class='color-d'>damage</strong> <em>//from obsolescence</em>`, 360)
|
||||
tech.damage *= effect
|
||||
tech.ejectOld *= effect
|
||||
powerUps.ejectTech(index)
|
||||
}
|
||||
}
|
||||
},
|
||||
trainingText(say) {
|
||||
simulation.lastLogTime = 0; //clear previous messages
|
||||
@@ -241,8 +256,8 @@ const level = {
|
||||
} else if (simulation.difficultyMode > 1) {
|
||||
scale = 2
|
||||
}
|
||||
m.dmgScale = Math.pow(0.85, level.levelsCleared * scale)
|
||||
simulation.dmgScale = Math.max(0.1, 0.23 * level.levelsCleared * scale) //damage done by mobs scales with total levels
|
||||
m.dmgScale = Math.pow(0.87, level.levelsCleared * scale)
|
||||
simulation.dmgScale = Math.max(0.1, 0.22 * level.levelsCleared * scale) //damage done by mobs scales with total levels
|
||||
|
||||
//
|
||||
simulation.healScale = 1 / (1 + simulation.difficulty * 0.043) //a higher denominator makes for lower heals // m.health += heal * simulation.healScale;
|
||||
@@ -268,10 +283,9 @@ const level = {
|
||||
levelAnnounce() {
|
||||
const cheating = simulation.isCheating ? "(testing)" : ""
|
||||
if (level.levelsCleared === 0) {
|
||||
document.title = `n-gon: initial ${cheating}`;
|
||||
return `initial ${cheating}`;
|
||||
} else {
|
||||
document.title = `n-gon: ${level.levelsCleared} ${level.levels[level.onLevel]} ${cheating}`
|
||||
simulation.makeTextLog(`<span class='color-var'>level</span>.onLevel <span class='color-symbol'>=</span> "<span class='color-text'>${level.levels[level.onLevel]}</span>"`);
|
||||
return `${level.levelsCleared} ${level.levels[level.onLevel]} ${cheating}`
|
||||
}
|
||||
},
|
||||
announceMobTypes() {
|
||||
@@ -624,13 +638,12 @@ const level = {
|
||||
let text = `
|
||||
<div class="choose-grid-module" id = "choose-training" style = "font-size: 1em; padding:10px;color:#333;">
|
||||
<h2 style="text-align: center;letter-spacing: 5px;">training</h2>
|
||||
Begin the <strong>guided tutorial</strong> that shows you how to use your <strong class='color-f'>field</strong> and <strong class='color-g'>gun</strong>.
|
||||
Begin the <strong>guided tutorial</strong> that shows you how to use your ${powerUps.field.gun()} and ${powerUps.orb.gun()}.
|
||||
</div>
|
||||
<div class="choose-grid-module" id = "choose-unPause" style = "font-size: 1em; padding:10px;color:#333;">
|
||||
<h2 style="text-align: center; letter-spacing: 7px;">play</h2>
|
||||
Begin the <strong>standard game</strong> where you progress through <strong>13</strong> random levels and beat the final boss.
|
||||
</div>`
|
||||
//use you use your <strong class='color-g'>gun</strong>, <strong class='color-f'>field</strong>, and <strong class='color-m'>tech</strong>
|
||||
document.getElementById("choose-grid").innerHTML = text
|
||||
//show level info
|
||||
document.getElementById("choose-grid").style.opacity = "1"
|
||||
@@ -4089,9 +4102,10 @@ const level = {
|
||||
} else {
|
||||
isSpawnedBoss = true
|
||||
isDoorsLocked = true
|
||||
for (let i = 0; i < 9; ++i) powerUps.spawn(-1800 + 550 * Math.random(), -1700, "ammo")
|
||||
for (let i = 0; i < 3; ++i) powerUps.spawn(-1800 + 550 * Math.random(), -1700, "heal");
|
||||
const scale = Math.pow(simulation.difficulty, 0.7) //hard around 30, why around 54
|
||||
for (let i = 0; i < 12; ++i) powerUps.spawn(-1800 + 550 * Math.random(), -1800, "ammo")
|
||||
for (let i = 0; i < 5; ++i) powerUps.spawn(-1800 + 550 * Math.random(), -1700, "heal");
|
||||
for (let i = 0; i < 1; ++i) powerUps.spawn(-1800 + 550 * Math.random(), -1750, "research");
|
||||
const scale = Math.pow(simulation.difficulty, 0.7)
|
||||
if (mobs.mobDeaths < level.levelsCleared && !simulation.isCheating) {
|
||||
for (let i = 0; i < 250; i++) spawn.starter(-2700 + 2400 * Math.random(), -1300 - 500 * Math.random())
|
||||
} else {
|
||||
@@ -4112,7 +4126,6 @@ const level = {
|
||||
}
|
||||
}
|
||||
}
|
||||
// spawn.secondaryBossChance(-2300, -800)
|
||||
}
|
||||
} else {
|
||||
doorIn.isClosing = false
|
||||
@@ -31938,7 +31951,7 @@ const level = {
|
||||
}
|
||||
if (tech.isPiezo) g.energy += 20.48;
|
||||
if (tech.isCouplingNoHit && g.coupling > 0) {
|
||||
g.couplingChange(-5)
|
||||
g.couplingChange(-3)
|
||||
|
||||
const unit = Vector.rotate({ x: 1, y: 0 }, 6.28 * Math.random())
|
||||
let where = Vector.add(g.pos, Vector.mult(unit, 17))
|
||||
@@ -34513,27 +34526,27 @@ const level = {
|
||||
const buttonDoor = level.button(400, 0)
|
||||
|
||||
let instruction = 0
|
||||
level.trainingText(`use your <strong class='color-f'>field</strong> to pick up the gun power up`)
|
||||
level.trainingText(`use your <strong class='color-f'>field</strong> to pick up ${powerUps.orb.gun()}`)
|
||||
|
||||
level.custom = () => {
|
||||
if (instruction === 0 && simulation.isChoosing) {
|
||||
instruction++
|
||||
level.trainingText(`<s>use your <strong class='color-f'>field</strong> to pick up the gun power up</s>
|
||||
level.trainingText(`<s>use your <strong class='color-f'>field</strong> to pick up ${powerUps.orb.gun()}</s>
|
||||
<br>choose a <strong class='color-g'>gun</strong>`)
|
||||
} else if (instruction === 1 && !simulation.isChoosing) {
|
||||
instruction++
|
||||
level.trainingText(`<s>use your <strong class='color-f'>field</strong> to pick up the gun power up
|
||||
level.trainingText(`<s>use your <strong class='color-f'>field</strong> to pick up ${powerUps.orb.gun()}
|
||||
<br>choose a <strong class='color-g'>gun</strong></s>
|
||||
<br>use the <strong>left mouse</strong> button to shoot the <strong>mobs</strong>`)
|
||||
} else if (instruction === 2 && mob.length === 0) {
|
||||
instruction++
|
||||
level.trainingText(`<s>use your <strong class='color-f'>field</strong> to pick up the gun power up
|
||||
level.trainingText(`<s>use your <strong class='color-f'>field</strong> to pick up ${powerUps.orb.gun()}
|
||||
<br>choose a <strong class='color-g'>gun</strong>
|
||||
<br>use the <strong>left mouse</strong> button to shoot the <strong>mobs</strong></s>
|
||||
<br>drop a <strong class='color-block'>block</strong> on the red button to open the door`)
|
||||
} else if (instruction === 3 && !door.isClosing) {
|
||||
instruction++
|
||||
level.trainingText(`<s>use your <strong class='color-f'>field</strong> to pick up the gun power up
|
||||
level.trainingText(`<s>use your <strong class='color-f'>field</strong> to pick up ${powerUps.orb.gun()}
|
||||
<br>choose a <strong class='color-g'>gun</strong>
|
||||
<br>use the <strong>left mouse</strong> button to shoot the <strong>mobs</strong>
|
||||
<br>put a <strong class='color-block'>block</strong> on the red button to open the door</s>`)
|
||||
|
||||
24
js/player.js
24
js/player.js
@@ -699,7 +699,7 @@ const m = {
|
||||
tech.isDeathAvoidedThisLevel = true
|
||||
powerUps.research.changeRerolls(-1)
|
||||
simulation.makeTextLog(`<span class='color-var'>m</span>.<span class='color-r'>research</span><span class='color-symbol'>--</span><br>${powerUps.research.count}`)
|
||||
for (let i = 0; i < 16; i++) powerUps.spawn(m.pos.x + 100 * (Math.random() - 0.5), m.pos.y + 100 * (Math.random() - 0.5), "heal", false);
|
||||
for (let i = 0; i < 22; i++) powerUps.spawn(m.pos.x + 100 * (Math.random() - 0.5), m.pos.y + 100 * (Math.random() - 0.5), "heal", false);
|
||||
m.energy = m.maxEnergy + 0.1
|
||||
if (m.immuneCycle < m.cycle + 300) m.immuneCycle = m.cycle + 300 //disable this.immuneCycle bonus seconds
|
||||
simulation.wipe = function () { //set wipe to have trails
|
||||
@@ -2156,7 +2156,6 @@ const m = {
|
||||
m.fieldBlockCD = 10;
|
||||
m.fieldDamage = 1
|
||||
m.fieldHarmReduction = 1;
|
||||
m.lastHit = 0
|
||||
m.isSneakAttack = false
|
||||
m.duplicateChance = 0
|
||||
m.grabPowerUpRange2 = 200000;
|
||||
@@ -2890,7 +2889,7 @@ const m = {
|
||||
couplingDescription(couple = m.coupling) {
|
||||
switch (m.fieldMode) {
|
||||
case 0: //field emitter
|
||||
return `<strong>all</strong> other <strong class='color-f'>field</strong> effects`
|
||||
return `<strong>all</strong> effects`
|
||||
case 1: //standing wave
|
||||
// return `<span style = 'font-size:95%;'><strong>deflecting</strong> condenses +${couple.toFixed(1)} <strong class='color-s'>ice IX</strong></span>`
|
||||
return `+${(couple * 5).toFixed(0)} maximum <strong class='color-f'>energy</strong>`
|
||||
@@ -3091,7 +3090,7 @@ const m = {
|
||||
},
|
||||
{
|
||||
name: "perfect diamagnetism",
|
||||
description: "<strong>deflecting</strong> does not drain <strong class='color-f'>energy</strong><br><strong>shield</strong> maintains <strong>functionality</strong> while inactive<br><strong>5</strong> <strong class='color-f'>energy</strong> per second",
|
||||
description: `<strong>deflecting</strong> does not drain <strong class='color-f'>energy</strong><br><strong>shield</strong> maintains <strong>functionality</strong> while inactive<br><strong>5</strong> <strong class='color-f'>energy</strong> per second`,
|
||||
effect: () => {
|
||||
m.fieldMeterColor = "#48f" //"#0c5"
|
||||
m.eyeFillColor = m.fieldMeterColor
|
||||
@@ -3326,7 +3325,7 @@ const m = {
|
||||
{
|
||||
name: "negative mass",
|
||||
//<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 <strong style='letter-spacing: 7px;'>gravity</strong><br><strong>0.4x</strong> <strong class='color-defense'>damage taken</strong><br><strong>6</strong> <strong class='color-f'>energy</strong> per second",
|
||||
description: `use <strong class='color-f'>energy</strong> to nullify <strong style='letter-spacing: 7px;'>gravity</strong><br><strong>0.4x</strong> <strong class='color-defense'>damage taken</strong><br><strong>6</strong> <strong class='color-f'>energy</strong> per second`,
|
||||
fieldDrawRadius: 0,
|
||||
effect: () => {
|
||||
m.fieldFire = true;
|
||||
@@ -3572,7 +3571,7 @@ const m = {
|
||||
bullet[bullet.length - 1].force.y += 0.005 + push.y * (Math.random() - 0.5)
|
||||
// b.missile({ x: m.pos.x, y: m.pos.y - 40 }, -Math.PI / 2 + 0.5 * (Math.random() - 0.5), 0, 1)
|
||||
} else if (simulation.molecularMode === 2) {
|
||||
m.energy -= 0.045;
|
||||
m.energy -= 0.044;
|
||||
b.iceIX(1)
|
||||
} else if (simulation.molecularMode === 3) {
|
||||
if (tech.isDroneRadioactive) {
|
||||
@@ -4091,7 +4090,7 @@ const m = {
|
||||
},
|
||||
{
|
||||
name: "time dilation",
|
||||
description: "use <strong class='color-f'>energy</strong> to <strong style='letter-spacing: 2px;'>stop time</strong><br><strong>1.2x</strong> movement and <strong><em>fire rate</em></strong><br><strong>12</strong> <strong class='color-f'>energy</strong> per second",
|
||||
description: `use <strong class='color-f'>energy</strong> to <strong style='letter-spacing: 2px;'>stop time</strong><br><strong>1.2x</strong> movement and <strong><em>fire rate</em></strong><br><strong>12</strong> <strong class='color-f'>energy</strong> per second`,
|
||||
set() {
|
||||
// m.fieldMeterColor = "#0fc"
|
||||
// m.fieldMeterColor = "#ff0"
|
||||
@@ -4290,7 +4289,7 @@ const m = {
|
||||
},
|
||||
{
|
||||
name: "metamaterial cloaking",
|
||||
description: "<strong>0.3x</strong> <strong class='color-defense'>damage taken</strong> while <strong class='color-cloaked'>cloaked</strong><br>after <strong class='color-cloaked'>decloaking</strong> <strong>4.5x</strong> <strong class='color-d'>damage</strong> for <strong>2</strong> s<br><strong>6</strong> <strong class='color-f'>energy</strong> per second",
|
||||
description: `<strong>0.3x</strong> <strong class='color-defense'>damage taken</strong> while <strong class='color-cloaked'>cloaked</strong><br>after <strong class='color-cloaked'>decloaking</strong> <strong>4.5x</strong> <strong class='color-d'>damage</strong> for <strong>2</strong> s<br><strong>6</strong> <strong class='color-f'>energy</strong> per second`,
|
||||
effect: () => {
|
||||
m.fieldFire = true;
|
||||
m.fieldMeterColor = "#333";
|
||||
@@ -4451,10 +4450,7 @@ const m = {
|
||||
},
|
||||
{
|
||||
name: "pilot wave",
|
||||
//<br><strong class='color-block'>blocks</strong> can't <strong>collide</strong> with <strong>intangible</strong> mobs
|
||||
//field <strong>radius</strong> decreases out of <strong>line of sight</strong>
|
||||
//<strong>unlock</strong> <strong class='color-m'>tech</strong> from other <strong class='color-f'>fields</strong>
|
||||
description: "use <strong class='color-f'>energy</strong> to guide <strong class='color-block'>blocks</strong><br><strong class='color-m'>tech</strong>, <strong class='color-f'>fields</strong>, and <strong class='color-g'>guns</strong> have <strong>+3</strong> <strong class='color-choice'><span>ch</span><span>oi</span><span>ces</span></strong><br><strong>10</strong> <strong class='color-f'>energy</strong> per second",
|
||||
description: `use <strong class='color-f'>energy</strong> to guide <strong class='color-block'>blocks</strong><br><div class="circle-grid tech"></div>, <div class="circle-grid gun"></div>, and <div class="circle-grid field"></div> have <strong>+3</strong> <strong class='color-choice'><span>ch</span><span>oi</span><span>ces</span></strong><br><strong>10</strong> <strong class='color-f'>energy</strong> per second`,
|
||||
effect: () => {
|
||||
m.fieldMeterColor = "#333"
|
||||
m.eyeFillColor = m.fieldMeterColor
|
||||
@@ -5231,13 +5227,13 @@ const m = {
|
||||
},
|
||||
{
|
||||
name: "grappling hook",
|
||||
description: `use <strong class='color-f'>energy</strong> to fire a hook that <strong>pulls</strong> you<br><strong>0.6x</strong> <strong class='color-defense'>damage taken</strong><br><strong>9</strong> <strong class='color-f'>energy</strong> per second`,
|
||||
description: `use <strong class='color-f'>energy</strong> to fire a hook that <strong>pulls</strong> you<br><strong>0.5x</strong> <strong class='color-defense'>damage taken</strong><br><strong>9</strong> <strong class='color-f'>energy</strong> per second`,
|
||||
effect: () => {
|
||||
m.fieldFire = true;
|
||||
// m.holdingMassScale = 0.01; //can hold heavier blocks with lower cost to jumping
|
||||
// m.fieldMeterColor = "#789"//"#456"
|
||||
m.eyeFillColor = m.fieldMeterColor
|
||||
m.fieldHarmReduction = 0.6; //40% reduction
|
||||
m.fieldHarmReduction = 0.5; //40% reduction
|
||||
m.grabPowerUpRange2 = 300000 //m.grabPowerUpRange2 = 200000;
|
||||
|
||||
m.hold = function () {
|
||||
|
||||
@@ -34,48 +34,10 @@ const powerUps = {
|
||||
healGiveMaxEnergy: false, //for tech 1st ionization energy
|
||||
orb: {
|
||||
research(num = 1) {
|
||||
switch (num) {
|
||||
case 1:
|
||||
return `<div class="research-circle"></div> `
|
||||
case 2:
|
||||
return `<span style="position:relative;">
|
||||
<div class="research-circle" style="position:absolute; top:1.5px; left:0;"></div>
|
||||
<div class="research-circle" style="position:absolute; top:1.5px; left:7px;"></div>
|
||||
</span> `
|
||||
case 3:
|
||||
return `<span style="position:relative;">
|
||||
<div class="research-circle" style="position:absolute; top:1.5px; left:0;"></div>
|
||||
<div class="research-circle" style="position:absolute; top:1.5px; left:8px;"></div>
|
||||
<div class="research-circle" style="position:absolute; top:1.5px; left:16px;"></div>
|
||||
</span>   `
|
||||
case 4:
|
||||
return `<span style="position:relative;">
|
||||
<div class="research-circle" style="position:absolute; top:1.5px; left:0;"></div>
|
||||
<div class="research-circle" style="position:absolute; top:1.5px; left:8px;"></div>
|
||||
<div class="research-circle" style="position:absolute; top:1.5px; left:16px;"></div>
|
||||
<div class="research-circle" style="position:absolute; top:1.5px; left:24px;"></div>
|
||||
</span> `
|
||||
case 5:
|
||||
return `<span style="position:relative;">
|
||||
<div class="research-circle" style="position:absolute; top:1.5px; left:0;"></div>
|
||||
<div class="research-circle" style="position:absolute; top:1.5px; left:8px;"></div>
|
||||
<div class="research-circle" style="position:absolute; top:1.5px; left:16px;"></div>
|
||||
<div class="research-circle" style="position:absolute; top:1.5px; left:24px;"></div>
|
||||
<div class="research-circle" style="position:absolute; top:1.5px; left:32px;"></div>
|
||||
</span> `
|
||||
case 6:
|
||||
return `<span style="position:relative;">
|
||||
<div class="research-circle" style="position:absolute; top:1.5px; left:0;"></div>
|
||||
<div class="research-circle" style="position:absolute; top:1.5px; left:8px;"></div>
|
||||
<div class="research-circle" style="position:absolute; top:1.5px; left:16px;"></div>
|
||||
<div class="research-circle" style="position:absolute; top:1.5px; left:24px;"></div>
|
||||
<div class="research-circle" style="position:absolute; top:1.5px; left:32px;"></div>
|
||||
<div class="research-circle" style="position:absolute; top:1.5px; left:40px;"></div>
|
||||
</span> `
|
||||
}
|
||||
if (num === 1) return `<div class="research-circle"></div> `
|
||||
let text = '<span style="position:relative;">'
|
||||
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 * 0.6}em;"></div>`
|
||||
}
|
||||
text += '</span> '
|
||||
for (let i = 0; i < num; i++) {
|
||||
@@ -90,7 +52,7 @@ const powerUps = {
|
||||
}
|
||||
let text = '<span style="position:relative;">'
|
||||
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 * 0.6}em;"></div>`
|
||||
}
|
||||
text += '</span> '
|
||||
for (let i = 0; i < num; i++) {
|
||||
@@ -100,37 +62,43 @@ const powerUps = {
|
||||
},
|
||||
heal(num = 1) {
|
||||
if (powerUps.healGiveMaxEnergy) {
|
||||
switch (num) {
|
||||
case 1:
|
||||
return `<div class="heal-circle-energy"></div>`
|
||||
}
|
||||
if (num === 1) return `<div class="heal-circle-energy"></div>`
|
||||
|
||||
let text = '<span style="position:relative;">'
|
||||
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 * 0.6}em;"></div>`
|
||||
}
|
||||
text += '</span> '
|
||||
for (let i = 0; i < num; i++) {
|
||||
text += ' '
|
||||
}
|
||||
for (let i = 0; i < num; i++) text += ' '
|
||||
return text
|
||||
} else {
|
||||
switch (num) {
|
||||
case 1:
|
||||
return `<div class="heal-circle"></div>`
|
||||
}
|
||||
if (num === 1) return `<div class="heal-circle"></div>`
|
||||
|
||||
let text = '<span style="position:relative;">'
|
||||
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 * 0.6}em;"></div>`
|
||||
}
|
||||
text += '</span> '
|
||||
for (let i = 0; i < num; i++) {
|
||||
text += ' '
|
||||
}
|
||||
for (let i = 0; i < num; i++) text += ' '
|
||||
return text
|
||||
}
|
||||
},
|
||||
tech(num = 1) {
|
||||
return `<div class="tech-circle"></div>`
|
||||
return `<div class="circle-grid tech" style="width: 1.32em; height: 1.32em;margin-bottom: -0.3em;"></div>`
|
||||
},
|
||||
field(num = 1) {
|
||||
return `<div class="circle-grid field"></div>`
|
||||
},
|
||||
gun(num = 1) {
|
||||
return `<div class="circle-grid gun"></div>`
|
||||
},
|
||||
gunTech(num = 1) {
|
||||
return `<div class="circle-grid tech" style="position:relative; top:-0.05em; left:0.55em;opacity:0.8;margin-left:-0.55em;"></div>
|
||||
<div class="circle-grid gun" style="position:relative; top:-0.05em; left:-0.55em; opacity:0.65;margin-right:-0.55em;"></div>`
|
||||
},
|
||||
fieldTech(num = 1) {
|
||||
return `<div class="circle-grid tech" style="position:relative; top:-0.05em; left:0.55em;opacity:0.8;margin-left:-0.55em;"></div>
|
||||
<div class="circle-grid field" style="position:relative; top:-0.05em; left:-0.55em;opacity:0.65;margin-right:-0.55em;"></div>`
|
||||
},
|
||||
coupling(num = 1) {
|
||||
switch (num) {
|
||||
@@ -139,7 +107,7 @@ const powerUps = {
|
||||
}
|
||||
let text = '<span style="position:relative;">'
|
||||
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 * 0.5}em;"></div>`
|
||||
}
|
||||
text += '</span> '
|
||||
for (let i = 0; i < num; i++) {
|
||||
@@ -421,11 +389,11 @@ const powerUps = {
|
||||
</datalist>
|
||||
</div>
|
||||
<div class="right-column">
|
||||
<div class="row" id="constraint-1"><strong>0.85x</strong> <strong class='color-d'>damage</strong> done per level<br><strong>1.23x</strong> <strong class='color-defense'>damage taken</strong> per level</div>
|
||||
<div class="row" id="constraint-2"><strong>-5</strong> initial <strong>power ups</strong><br><strong>faster</strong> and <strong>more</strong> mobs per level</div>
|
||||
<div class="row" id="constraint-3"><strong>0.85x</strong> <strong class='color-d'>damage</strong> done per level<br><strong>1.23x</strong> <strong class='color-defense'>damage taken</strong> per level</div>
|
||||
<div class="row" id="constraint-4"><strong>+1</strong> boss per level<br><strong>-1</strong> <strong class='color-m'>tech</strong> per boss</div>
|
||||
<div class="row" id="constraint-5"><strong>0.85x</strong> <strong class='color-d'>damage</strong> done per level<br><strong>1.23x</strong> <strong class='color-defense'>damage taken</strong> per level</div>
|
||||
<div class="row" id="constraint-1"><strong>0.87x</strong> <strong class='color-d'>damage</strong> done per level<br><strong>1.22x</strong> <strong class='color-defense'>damage taken</strong> per level</div>
|
||||
<div class="row" id="constraint-2"><strong>-5</strong> initial <strong>power ups</strong><br><strong>faster</strong> mobs and <strong>more</strong> mobs</div>
|
||||
<div class="row" id="constraint-3"><strong>0.87x</strong> <strong class='color-d'>damage</strong> done per level<br><strong>1.22x</strong> <strong class='color-defense'>damage taken</strong> per level</div>
|
||||
<div class="row" id="constraint-4"><strong>+1</strong> boss per level<br><strong>-1</strong> ${powerUps.orb.tech()} per boss</div>
|
||||
<div class="row" id="constraint-5"><strong>0.87x</strong> <strong class='color-d'>damage</strong> done per level<br><strong>1.22x</strong> <strong class='color-defense'>damage taken</strong> per level</div>
|
||||
<div class="row" id="constraint-6"><strong>3x</strong> chance for <strong>shielded</strong> mobs<br><strong>-3</strong> initial power ups</div>
|
||||
</div>
|
||||
<div class="far-right-column">
|
||||
@@ -1602,6 +1570,7 @@ const powerUps = {
|
||||
// remove a random tech from the list of tech you have
|
||||
tech.removeCount += tech.tech[choose].count
|
||||
tech.tech[choose].remove();
|
||||
tech.totalCount -= tech.tech[choose].count
|
||||
tech.tech[choose].count = 0;
|
||||
tech.tech[choose].isLost = true;
|
||||
simulation.updateTechHUD();
|
||||
@@ -1619,6 +1588,7 @@ const powerUps = {
|
||||
}
|
||||
// remove a random tech from the list of tech you have
|
||||
tech.tech[choose].remove();
|
||||
tech.totalCount -= tech.tech[choose].count
|
||||
tech.removeCount += tech.tech[choose].count
|
||||
tech.tech[choose].count = 0;
|
||||
tech.tech[choose].isLost = true;
|
||||
|
||||
@@ -830,6 +830,7 @@ const simulation = {
|
||||
simulation.wipe = function () { //set wipe to normal
|
||||
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
||||
}
|
||||
m.lastHit = 0
|
||||
m.hole.isOn = false
|
||||
simulation.paused = false;
|
||||
engine.timing.timeScale = 1;
|
||||
|
||||
24
js/spawn.js
24
js/spawn.js
@@ -5530,7 +5530,7 @@ const spawn = {
|
||||
me.torqueMagnitude = 0.00024 * me.inertia * (Math.random() > 0.5 ? -1 : 1);
|
||||
me.delay = 70 + 70 * simulation.CDScale;
|
||||
me.cd = 0;
|
||||
me.swordRadius = 0;
|
||||
me.swordRadius = 50;
|
||||
me.swordVertex = 1
|
||||
me.swordRadiusMax = 1100 + 20 * simulation.difficulty;
|
||||
me.swordRadiusGrowRate = me.swordRadiusMax * (0.005 + 0.0003 * simulation.difficulty)
|
||||
@@ -5564,15 +5564,16 @@ const spawn = {
|
||||
Matter.Query.ray(body, this.position, this.playerPosRandomY()).length === 0
|
||||
) {
|
||||
//find vertex farthest away from player
|
||||
let dist = 0
|
||||
for (let i = 0, len = this.vertices.length; i < len; i++) {
|
||||
const D = Vector.magnitudeSquared(Vector.sub({ x: this.vertices[i].x, y: this.vertices[i].y }, m.pos))
|
||||
if (D > dist) {
|
||||
dist = D
|
||||
this.swordVertex = i
|
||||
}
|
||||
}
|
||||
this.laserAngle = this.swordVertex / 5 * 2 * Math.PI + 0.6283
|
||||
// let dist = 0
|
||||
// for (let i = 0, len = this.vertices.length; i < len; i++) {
|
||||
// const D = Vector.magnitudeSquared(Vector.sub({ x: this.vertices[i].x, y: this.vertices[i].y }, m.pos))
|
||||
// if (D > dist) {
|
||||
// dist = D
|
||||
// this.swordVertex = i
|
||||
// }
|
||||
// }
|
||||
// this.laserAngle = this.swordVertex / 5 * 2 * Math.PI + 0.6283
|
||||
|
||||
this.sword = this.swordGrow
|
||||
Matter.Body.setVelocity(this, { x: 0, y: 0 });
|
||||
Matter.Body.setAngularVelocity(this, 0)
|
||||
@@ -5581,6 +5582,7 @@ const spawn = {
|
||||
this.isInvulnerable = true
|
||||
this.frictionAir = 1
|
||||
}
|
||||
this.laserSword(this.vertices[this.swordVertex], this.angle + this.laserAngle); //always see the tip of the sword
|
||||
}
|
||||
me.sword = me.swordWaiting //base function that changes during different aspects of the sword swing
|
||||
me.swordGrow = function () {
|
||||
@@ -5606,7 +5608,7 @@ const spawn = {
|
||||
this.spinCount++
|
||||
if (this.spinCount > 80) {
|
||||
this.sword = this.swordWaiting
|
||||
this.swordRadius = 0
|
||||
this.swordRadius = 50
|
||||
this.accelMag = 0.001 * simulation.accelScale;
|
||||
this.cd = simulation.cycle + this.delay;
|
||||
this.damageReduction = this.startingDamageReduction
|
||||
|
||||
499
js/tech.js
499
js/tech.js
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user