inductive coupling
your build url can now be copied in the pause screen mod: inductive coupling - 4 max health per power up, but limited to 44 max health per level (replaces crystalized armor) mod: transceiver chip - use all the power ups left over at the end of a level mod: catabolism - does a flat 5 damage to your health for 3 ammo (was 2% of max health for 1 ammo)
This commit is contained in:
30
js/bullet.js
30
js/bullet.js
@@ -22,9 +22,11 @@ const b = {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (mod.isAmmoFromHealth) {
|
if (mod.isAmmoFromHealth) {
|
||||||
if (mech.health > 2 * mod.isAmmoFromHealth * mech.maxHealth) {
|
if (mech.health > 0.05) {
|
||||||
mech.damage(mod.isAmmoFromHealth * mech.maxHealth / mech.harmReduction());
|
mech.damage(0.05 / mech.harmReduction()); // /mech.harmReduction() undoes damage increase from difficulty
|
||||||
if (!(mod.isRewindAvoidDeath && mech.energy > 0.66)) powerUps.spawn(mech.pos.x, mech.pos.y, "ammo"); //don't give ammo if CPT triggered
|
if (!(mod.isRewindAvoidDeath && mech.energy > 0.66)) { //don't give ammo if CPT triggered
|
||||||
|
for (let i = 0; i < 3; i++) powerUps.spawn(mech.pos.x, mech.pos.y, "ammo");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
game.replaceTextLog = true;
|
game.replaceTextLog = true;
|
||||||
game.makeTextLog("not enough health for catabolism to produce ammo", 120);
|
game.makeTextLog("not enough health for catabolism to produce ammo", 120);
|
||||||
@@ -35,9 +37,7 @@ const b = {
|
|||||||
}
|
}
|
||||||
mech.fireCDcycle = mech.cycle + 30; //fire cooldown
|
mech.fireCDcycle = mech.cycle + 30; //fire cooldown
|
||||||
}
|
}
|
||||||
if (mech.holdingTarget) {
|
if (mech.holdingTarget) mech.drop();
|
||||||
mech.drop();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
removeAllGuns() {
|
removeAllGuns() {
|
||||||
@@ -307,7 +307,7 @@ const b = {
|
|||||||
const me = bullet.length;
|
const me = bullet.length;
|
||||||
bullet[me] = Bodies.circle(where.x, where.y, 15, b.fireAttributes(angle, false));
|
bullet[me] = Bodies.circle(where.x, where.y, 15, b.fireAttributes(angle, false));
|
||||||
Matter.Body.setDensity(bullet[me], 0.0005);
|
Matter.Body.setDensity(bullet[me], 0.0005);
|
||||||
bullet[me].explodeRad = 275;
|
bullet[me].explodeRad = 300;
|
||||||
bullet[me].onEnd = function() {
|
bullet[me].onEnd = function() {
|
||||||
b.explosion(this.position, this.explodeRad); //makes bullet do explosive damage at end
|
b.explosion(this.position, this.explodeRad); //makes bullet do explosive damage at end
|
||||||
if (mod.fragments) b.targetedNail(this.position, mod.fragments * 5)
|
if (mod.fragments) b.targetedNail(this.position, mod.fragments * 5)
|
||||||
@@ -316,7 +316,7 @@ const b = {
|
|||||||
bullet[me].beforeDmg = function() {
|
bullet[me].beforeDmg = function() {
|
||||||
this.endCycle = 0; //bullet ends cycle after doing damage //this also triggers explosion
|
this.endCycle = 0; //bullet ends cycle after doing damage //this also triggers explosion
|
||||||
};
|
};
|
||||||
speed = mech.crouch ? 43 : 32
|
speed = mech.crouch ? 46 : 32
|
||||||
Matter.Body.setVelocity(bullet[me], {
|
Matter.Body.setVelocity(bullet[me], {
|
||||||
x: mech.Vx / 2 + speed * Math.cos(angle),
|
x: mech.Vx / 2 + speed * Math.cos(angle),
|
||||||
y: mech.Vy / 2 + speed * Math.sin(angle)
|
y: mech.Vy / 2 + speed * Math.sin(angle)
|
||||||
@@ -681,19 +681,21 @@ const b = {
|
|||||||
lastAngle: 0,
|
lastAngle: 0,
|
||||||
wasExtruderOn: false,
|
wasExtruderOn: false,
|
||||||
isExtruderOn: false,
|
isExtruderOn: false,
|
||||||
|
didExtruderDrain: false,
|
||||||
|
canExtruderFire: true,
|
||||||
extruder() {
|
extruder() {
|
||||||
const DRAIN = 0.0007 + mech.fieldRegen
|
const DRAIN = 0.0007 + mech.fieldRegen
|
||||||
if (mech.energy > DRAIN) {
|
if (mech.energy > DRAIN && b.canExtruderFire) {
|
||||||
mech.energy -= DRAIN
|
mech.energy -= DRAIN
|
||||||
if (mech.energy < 0) {
|
if (mech.energy < 0) {
|
||||||
mech.fieldCDcycle = mech.cycle + 120;
|
mech.fieldCDcycle = mech.cycle + 120;
|
||||||
mech.energy = 0;
|
mech.energy = 0;
|
||||||
}
|
}
|
||||||
mech.isExtruderOn = true
|
b.isExtruderOn = true
|
||||||
const SPEED = 10
|
const SPEED = 10
|
||||||
const me = bullet.length;
|
const me = bullet.length;
|
||||||
const where = Vector.add(mech.pos, player.velocity)
|
const where = Vector.add(mech.pos, player.velocity)
|
||||||
bullet[me] = Bodies.polygon(where.x + 20 * Math.cos(mech.angle), where.y + 20 * Math.sin(mech.angle), 3, 0.01, {
|
bullet[me] = Bodies.polygon(where.x + 20 * Math.cos(mech.angle), where.y + 20 * Math.sin(mech.angle), 4, 0.01, {
|
||||||
cycle: -0.5,
|
cycle: -0.5,
|
||||||
isWave: true,
|
isWave: true,
|
||||||
endCycle: game.cycle + 10 + 40 * mod.isPlasmaRange,
|
endCycle: game.cycle + 10 + 40 * mod.isPlasmaRange,
|
||||||
@@ -755,7 +757,9 @@ const b = {
|
|||||||
const transverse = Vector.normalise(Vector.perp(bullet[me].velocity))
|
const transverse = Vector.normalise(Vector.perp(bullet[me].velocity))
|
||||||
if (180 - Math.abs(Math.abs(b.lastAngle - mech.angle) - 180) > 0.3) bullet[me].isBranch = true; //don't draw stroke for this bullet
|
if (180 - Math.abs(Math.abs(b.lastAngle - mech.angle) - 180) > 0.3) bullet[me].isBranch = true; //don't draw stroke for this bullet
|
||||||
b.lastAngle = mech.angle //track last angle for the above angle difference calculation
|
b.lastAngle = mech.angle //track last angle for the above angle difference calculation
|
||||||
if (!mech.wasExtruderOn) bullet[me].isBranch = true;
|
if (!b.wasExtruderOn) bullet[me].isBranch = true;
|
||||||
|
} else {
|
||||||
|
b.canExtruderFire = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
plasma() {
|
plasma() {
|
||||||
@@ -1336,7 +1340,7 @@ const b = {
|
|||||||
const THRUST = 0.004
|
const THRUST = 0.004
|
||||||
const dir = mech.angle + spread * (Math.random() - 0.5);
|
const dir = mech.angle + spread * (Math.random() - 0.5);
|
||||||
const RADIUS = 18
|
const RADIUS = 18
|
||||||
bullet[me] = Bodies.polygon(mech.pos.x + 30 * Math.cos(mech.angle), mech.pos.y + 30 * Math.sin(mech.angle), 4, RADIUS, {
|
bullet[me] = Bodies.polygon(mech.pos.x + 30 * Math.cos(mech.angle), mech.pos.y + 30 * Math.sin(mech.angle), 3, RADIUS, {
|
||||||
angle: dir - Math.PI,
|
angle: dir - Math.PI,
|
||||||
inertia: Infinity,
|
inertia: Infinity,
|
||||||
friction: 0,
|
friction: 0,
|
||||||
|
|||||||
28
js/game.js
28
js/game.js
@@ -595,6 +595,9 @@ const game = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mod.isEndLevelPowerUp) {
|
||||||
|
for (let i = 0; i < powerUp.length; i++) powerUp[i].effect();
|
||||||
|
}
|
||||||
powerUps.totalPowerUps = powerUp.length
|
powerUps.totalPowerUps = powerUp.length
|
||||||
|
|
||||||
let holdTarget; //if player is holding something this remembers it before it gets deleted
|
let holdTarget; //if player is holding something this remembers it before it gets deleted
|
||||||
@@ -752,8 +755,31 @@ const game = {
|
|||||||
//check for double crouch
|
//check for double crouch
|
||||||
//crouch playerHead.position.y - player.position.y = 9.7 //positive
|
//crouch playerHead.position.y - player.position.y = 9.7 //positive
|
||||||
//standing playerHead.position.y - player.position.y = -30 //negative
|
//standing playerHead.position.y - player.position.y = -30 //negative
|
||||||
|
// mech.undoCrouch()
|
||||||
if (!mech.crouch && ((playerHead.position.y - player.position.y) > 0)) {
|
if (!mech.crouch && ((playerHead.position.y - player.position.y) > 0)) {
|
||||||
// mech.undoCrouch()
|
Matter.Body.translate(playerHead, {
|
||||||
|
x: 0,
|
||||||
|
y: 40
|
||||||
|
});
|
||||||
|
if ((playerHead.position.y - player.position.y) > 0) {
|
||||||
|
Matter.Body.translate(playerHead, {
|
||||||
|
x: 0,
|
||||||
|
y: 40
|
||||||
|
});
|
||||||
|
if ((playerHead.position.y - player.position.y) > 0) {
|
||||||
|
Matter.Body.translate(playerHead, {
|
||||||
|
x: 0,
|
||||||
|
y: 40
|
||||||
|
});
|
||||||
|
if ((playerHead.position.y - player.position.y) > 0) {
|
||||||
|
Matter.Body.translate(playerHead, {
|
||||||
|
x: 0,
|
||||||
|
y: 40
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (mech.crouch && ((playerHead.position.y - player.position.y) > 10)) {
|
||||||
Matter.Body.translate(playerHead, {
|
Matter.Body.translate(playerHead, {
|
||||||
x: 0,
|
x: 0,
|
||||||
y: 40
|
y: 40
|
||||||
|
|||||||
118
js/index.js
118
js/index.js
@@ -196,6 +196,12 @@ const build = {
|
|||||||
<br>damage difficulty scale: ${(b.dmgScale*100).toFixed(2) }%
|
<br>damage difficulty scale: ${(b.dmgScale*100).toFixed(2) }%
|
||||||
<br>harm difficulty scale: ${(game.dmgScale*100).toFixed(0)}%
|
<br>harm difficulty scale: ${(game.dmgScale*100).toFixed(0)}%
|
||||||
<br>heal difficulty scale: ${(game.healScale*100).toFixed(1)}%
|
<br>heal difficulty scale: ${(game.healScale*100).toFixed(1)}%
|
||||||
|
<br><svg class="SVG-button" onclick="build.shareURL(false)" width="110" height="25" style="padding:2px; margin: 10px;">
|
||||||
|
<g stroke='none' fill='#333' stroke-width="2" font-size="17px" font-family="Ariel, sans-serif">
|
||||||
|
<text x="5" y="18">copy build url</text>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
|
||||||
</div>`;
|
</div>`;
|
||||||
let countGuns = 0
|
let countGuns = 0
|
||||||
let countMods = 0
|
let countMods = 0
|
||||||
@@ -217,15 +223,15 @@ const build = {
|
|||||||
if (mod.mods[i].isFieldMod) {
|
if (mod.mods[i].isFieldMod) {
|
||||||
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 field" style="position:absolute; top:0; left:10px;opacity:1;"></div>
|
<div class="circle-grid mod" style="position:absolute; top:0; left:0;opacity:0.8;"></div>
|
||||||
<div class="circle-grid mod" style="position:absolute; top:0; left:0;opacity:0.75;"></div>
|
<div class="circle-grid field" style="position:absolute; top:0; left:10px;opacity:0.65;"></div>
|
||||||
</span>
|
</span>
|
||||||
${mod.mods[i].name} ${isCount}</div>${mod.mods[i].description}</div></div>`
|
${mod.mods[i].name} ${isCount}</div>${mod.mods[i].description}</div></div>`
|
||||||
} else if (mod.mods[i].isGunMod) {
|
} else if (mod.mods[i].isGunMod) {
|
||||||
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 gun" style="position:absolute; top:0; left:10px; opacity:0.75;"></div>
|
<div class="circle-grid mod" style="position:absolute; top:0; left:0;opacity:0.8;"></div>
|
||||||
<div class="circle-grid mod" style="position:absolute; top:0; left:0;opacity:0.75;"></div>
|
<div class="circle-grid gun" style="position:absolute; top:0; left:10px; opacity:0.65;"></div>
|
||||||
</span>
|
</span>
|
||||||
${mod.mods[i].name} ${isCount}</div>${mod.mods[i].description}</div></div>`
|
${mod.mods[i].name} ${isCount}</div>${mod.mods[i].description}</div></div>`
|
||||||
} else {
|
} else {
|
||||||
@@ -299,15 +305,19 @@ const build = {
|
|||||||
if (mod.mods[i].isFieldMod) {
|
if (mod.mods[i].isFieldMod) {
|
||||||
modID.innerHTML = ` <div class="grid-title">
|
modID.innerHTML = ` <div class="grid-title">
|
||||||
<span style="position:relative;">
|
<span style="position:relative;">
|
||||||
<div class="circle-grid field" style="position:absolute; top:0; left:10px;opacity:1;"></div>
|
<div class="circle-grid mod" style="position:absolute; top:0; left:0;opacity:0.8;"></div>
|
||||||
<div class="circle-grid mod" style="position:absolute; top:0; left:0;opacity:0.75;"></div>
|
<div class="circle-grid field" style="position:absolute; top:0; left:10px;opacity:0.65;"></div>
|
||||||
</span>
|
</span>
|
||||||
${mod.mods[i].name} ${isCount}</div>${mod.mods[i].description}</div>`
|
${mod.mods[i].name} ${isCount}</div>${mod.mods[i].description}</div>`
|
||||||
|
|
||||||
|
// <div class="circle-grid gun" style="position:absolute; top:-3px; left:-3px; opacity:1; height: 33px; width:33px;"></div>
|
||||||
|
// <div class="circle-grid mod" style="position:absolute; top:5px; left:5px;opacity:1;height: 20px; width:20px;border: #fff solid 2px;"></div>
|
||||||
|
// border: #fff solid 0px;
|
||||||
} else if (mod.mods[i].isGunMod) {
|
} else if (mod.mods[i].isGunMod) {
|
||||||
modID.innerHTML = ` <div class="grid-title">
|
modID.innerHTML = ` <div class="grid-title">
|
||||||
<span style="position:relative;">
|
<span style="position:relative;">
|
||||||
<div class="circle-grid gun" style="position:absolute; top:0; left:10px; opacity:0.75;"></div>
|
<div class="circle-grid mod" style="position:absolute; top:0; left:0;opacity:0.8;"></div>
|
||||||
<div class="circle-grid mod" style="position:absolute; top:0; left:0;opacity:0.75;"></div>
|
<div class="circle-grid gun" style="position:absolute; top:0; left:10px; opacity:0.65;"></div>
|
||||||
</span>
|
</span>
|
||||||
${mod.mods[i].name} ${isCount}</div>${mod.mods[i].description}</div>`
|
${mod.mods[i].name} ${isCount}</div>${mod.mods[i].description}</div>`
|
||||||
} else {
|
} else {
|
||||||
@@ -319,7 +329,7 @@ const build = {
|
|||||||
modID.setAttribute("onClick", `javascript: build.choosePowerUp(this,${i},'mod')`);
|
modID.setAttribute("onClick", `javascript: build.choosePowerUp(this,${i},'mod')`);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
modID.innerHTML = `<div class="grid-title"><div class="circle-grid grey"></div> ${mod.mods[i].name}</div><span style="color:#666;">requires: ${mod.mods[i].requires}</span></div>`
|
modID.innerHTML = `<div class="grid-title"> ${mod.mods[i].name}</div><span style="color:#666;">requires: ${mod.mods[i].requires}</span></div>`
|
||||||
if (!modID.classList.contains("build-grid-disabled")) {
|
if (!modID.classList.contains("build-grid-disabled")) {
|
||||||
modID.classList.add("build-grid-disabled");
|
modID.classList.add("build-grid-disabled");
|
||||||
modID.onclick = null
|
modID.onclick = null
|
||||||
@@ -343,7 +353,7 @@ const build = {
|
|||||||
<text x="5" y="18">reset</text>
|
<text x="5" y="18">reset</text>
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
<svg class="SVG-button" onclick="build.shareURL()" width="52" height="25">
|
<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">
|
<g stroke='none' fill='#333' stroke-width="2" font-size="17px" font-family="Ariel, sans-serif">
|
||||||
<text x="5" y="18">share</text>
|
<text x="5" y="18">share</text>
|
||||||
</g>
|
</g>
|
||||||
@@ -371,12 +381,13 @@ const build = {
|
|||||||
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="build-grid-module" onclick="build.choosePowerUp(this,${i},'gun')"><div class="grid-title"><div class="circle-grid gun"></div> ${b.guns[i].name}</div> ${b.guns[i].description}</div>`
|
text += `<div id = "gun-${i}" class="build-grid-module" onclick="build.choosePowerUp(this,${i},'gun')"><div class="grid-title"><div class="circle-grid gun"></div> ${b.guns[i].name}</div> ${b.guns[i].description}</div>`
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let i = 0, len = mod.mods.length; i < len; i++) {
|
for (let i = 0, len = mod.mods.length; i < len; i++) {
|
||||||
if (!mod.mods[i].isCustomHide) {
|
if (!mod.mods[i].isCustomHide) {
|
||||||
if (!mod.mods[i].allowed()) { // || mod.mods[i].name === "+1 cardinality") { //|| mod.mods[i].name === "leveraged investment"
|
if (!mod.mods[i].allowed()) { // || mod.mods[i].name === "+1 cardinality") { //|| mod.mods[i].name === "leveraged investment"
|
||||||
text += `<div id="mod-${i}" class="build-grid-module build-grid-disabled"><div class="grid-title"><div class="circle-grid grey"></div> ${mod.mods[i].name}</div><span style="color:#666;">requires: ${mod.mods[i].requires}</span></div>`
|
text += `<div id="mod-${i}" class="build-grid-module build-grid-disabled"><div class="grid-title">${mod.mods[i].name}</div><span style="color:#666;">requires: ${mod.mods[i].requires}</span></div>`
|
||||||
} else if (mod.mods[i].count > 1) {
|
// } else if (mod.mods[i].count > 1) {
|
||||||
text += `<div id="mod-${i}" class="build-grid-module" onclick="build.choosePowerUp(this,${i},'mod')"><div class="grid-title"><div class="circle-grid mod"></div> ${mod.mods[i].name} (${mod.mods[i].count}x)</div> ${mod.mods[i].description}</div>`
|
// text += `<div id="mod-${i}" class="build-grid-module" onclick="build.choosePowerUp(this,${i},'mod')"><div class="grid-title"><div class="circle-grid mod"></div> ${mod.mods[i].name} (${mod.mods[i].count}x)</div> ${mod.mods[i].description}</div>`
|
||||||
} else {
|
} else {
|
||||||
text += `<div id="mod-${i}" class="build-grid-module" onclick="build.choosePowerUp(this,${i},'mod')"><div class="grid-title"><div class="circle-grid mod"></div> ${mod.mods[i].name}</div> ${mod.mods[i].description}</div>`
|
text += `<div id="mod-${i}" class="build-grid-module" onclick="build.choosePowerUp(this,${i},'mod')"><div class="grid-title"><div class="circle-grid mod"></div> ${mod.mods[i].name}</div> ${mod.mods[i].description}</div>`
|
||||||
}
|
}
|
||||||
@@ -409,7 +420,7 @@ const build = {
|
|||||||
document.getElementById("field-0").classList.add("build-field-selected");
|
document.getElementById("field-0").classList.add("build-field-selected");
|
||||||
document.getElementById("build-grid").style.display = "grid"
|
document.getElementById("build-grid").style.display = "grid"
|
||||||
},
|
},
|
||||||
shareURL() {
|
shareURL(isCustom = false) {
|
||||||
let url = "https://landgreen.github.io/sidescroller/index.html?"
|
let url = "https://landgreen.github.io/sidescroller/index.html?"
|
||||||
let count = 0;
|
let count = 0;
|
||||||
|
|
||||||
@@ -429,11 +440,16 @@ const build = {
|
|||||||
}
|
}
|
||||||
url += `&field=${encodeURIComponent(mech.fieldUpgrades[mech.fieldMode].name.trim())}`
|
url += `&field=${encodeURIComponent(mech.fieldUpgrades[mech.fieldMode].name.trim())}`
|
||||||
url += `&difficulty=${game.difficultyMode}`
|
url += `&difficulty=${game.difficultyMode}`
|
||||||
url += `&level=${Math.abs(Number(document.getElementById("starting-level").value))}`
|
if (isCustom) {
|
||||||
url += `&noPower=${Number(document.getElementById("no-power-ups").checked)}`
|
url += `&level=${Math.abs(Number(document.getElementById("starting-level").value))}`
|
||||||
|
url += `&noPower=${Number(document.getElementById("no-power-ups").checked)}`
|
||||||
|
alert('n-gon build URL copied to clipboard.\nPaste into browser address bar.')
|
||||||
|
} else {
|
||||||
|
game.makeTextLog("n-gon build URL copied to clipboard.<br>Paste into browser address bar.", 300)
|
||||||
|
}
|
||||||
|
console.log('n-gon build URL copied to clipboard.\nPaste into browser address bar.')
|
||||||
console.log(url)
|
console.log(url)
|
||||||
game.copyToClipBoard(url)
|
game.copyToClipBoard(url)
|
||||||
alert('n-gon build URL copied to clipboard.\nPaste into browser address bar.')
|
|
||||||
},
|
},
|
||||||
startBuildRun() {
|
startBuildRun() {
|
||||||
build.isCustomSelection = false;
|
build.isCustomSelection = false;
|
||||||
@@ -497,40 +513,40 @@ document.getElementById("build-button").addEventListener("click", () => { //setu
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
openCustomBuildMenu();
|
openCustomBuildMenu();
|
||||||
if (!game.firstRun) { //if player has already died once load that previous build
|
// if (!game.firstRun) { //if player has already died once load that previous build
|
||||||
build.choosePowerUp(document.getElementById(`field-${field}`), field, 'field')
|
// build.choosePowerUp(document.getElementById(`field-${field}`), field, 'field')
|
||||||
for (let i = 0; i < inventory.length; i++) {
|
// for (let i = 0; i < inventory.length; i++) {
|
||||||
build.choosePowerUp(document.getElementById(`gun-${inventory[i]}`), inventory[i], 'gun')
|
// build.choosePowerUp(document.getElementById(`gun-${inventory[i]}`), inventory[i], 'gun')
|
||||||
}
|
// }
|
||||||
for (let i = 0; i < modList.length; i++) {
|
// for (let i = 0; i < modList.length; i++) {
|
||||||
for (let j = 0; j < modList[i]; j++) {
|
// for (let j = 0; j < modList[i]; j++) {
|
||||||
build.choosePowerUp(document.getElementById(`mod-${i}`), i, 'mod', true)
|
// build.choosePowerUp(document.getElementById(`mod-${i}`), i, 'mod', true)
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
//update mod text //disable not allowed mods
|
// //update mod text //disable not allowed mods
|
||||||
for (let i = 0, len = mod.mods.length; i < len; i++) {
|
// for (let i = 0, len = mod.mods.length; i < len; i++) {
|
||||||
const modID = document.getElementById("mod-" + i)
|
// const modID = document.getElementById("mod-" + i)
|
||||||
if (!mod.mods[i].isCustomHide) {
|
// if (!mod.mods[i].isCustomHide) {
|
||||||
if (mod.mods[i].allowed() || mod.mods[i].count > 0) {
|
// if (mod.mods[i].allowed() || mod.mods[i].count > 0) {
|
||||||
if (mod.mods[i].count > 1) {
|
// if (mod.mods[i].count > 1) {
|
||||||
modID.innerHTML = `<div class="grid-title"><div class="circle-grid mod"></div> ${mod.mods[i].name} (${mod.mods[i].count}x)</div>${mod.mods[i].description}</div>`
|
// modID.innerHTML = `<div class="grid-title"><div class="circle-grid mod"></div> ${mod.mods[i].name} (${mod.mods[i].count}x)</div>${mod.mods[i].description}</div>`
|
||||||
} else {
|
// } else {
|
||||||
modID.innerHTML = `<div class="grid-title"><div class="circle-grid mod"></div> ${mod.mods[i].name}</div>${mod.mods[i].description}</div>`
|
// modID.innerHTML = `<div class="grid-title"><div class="circle-grid mod"></div> ${mod.mods[i].name}</div>${mod.mods[i].description}</div>`
|
||||||
}
|
// }
|
||||||
if (modID.classList.contains("build-grid-disabled")) {
|
// if (modID.classList.contains("build-grid-disabled")) {
|
||||||
modID.classList.remove("build-grid-disabled");
|
// modID.classList.remove("build-grid-disabled");
|
||||||
modID.setAttribute("onClick", `javascript: build.choosePowerUp(this,${i},'mod')`);
|
// modID.setAttribute("onClick", `javascript: build.choosePowerUp(this,${i},'mod')`);
|
||||||
}
|
// }
|
||||||
} else {
|
// } else {
|
||||||
modID.innerHTML = `<div class="grid-title"><div class="circle-grid grey"></div> ${mod.mods[i].name}</div><span style="color:#666;">requires: ${mod.mods[i].requires}</span></div>`
|
// modID.innerHTML = `<div class="grid-title">${mod.mods[i].name}</div><span style="color:#666;">requires: ${mod.mods[i].requires}</span></div>`
|
||||||
if (!modID.classList.contains("build-grid-disabled")) {
|
// if (!modID.classList.contains("build-grid-disabled")) {
|
||||||
modID.classList.add("build-grid-disabled");
|
// modID.classList.add("build-grid-disabled");
|
||||||
modID.onclick = null
|
// modID.onclick = null
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
});
|
});
|
||||||
|
|
||||||
// ************************************************************************************************
|
// ************************************************************************************************
|
||||||
|
|||||||
@@ -19,7 +19,8 @@ const level = {
|
|||||||
// mech.setField("plasma torch")
|
// mech.setField("plasma torch")
|
||||||
// b.giveGuns("wave beam")
|
// b.giveGuns("wave beam")
|
||||||
// mod.giveMod("micro-extruder")
|
// mod.giveMod("micro-extruder")
|
||||||
// for (let i = 0; i < 15; i++) mod.giveMod("supply chain")
|
// mod.giveMod("piezoelectricity")
|
||||||
|
// for (let i = 0; i < 15; i++) mod.giveMod("plasma jet")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -59,14 +60,16 @@ const level = {
|
|||||||
b.respawnBots();
|
b.respawnBots();
|
||||||
mech.resetHistory();
|
mech.resetHistory();
|
||||||
if (mod.isArmorFromPowerUps) {
|
if (mod.isArmorFromPowerUps) {
|
||||||
mod.armorFromPowerUps += 0.05 * powerUps.totalPowerUps
|
const gain = Math.min(0.04 * powerUps.totalPowerUps, 0.44)
|
||||||
|
mod.armorFromPowerUps += gain
|
||||||
mech.setMaxHealth();
|
mech.setMaxHealth();
|
||||||
if (powerUps.totalPowerUps) game.makeTextLog("<span style='font-size:115%;'> max health increased by " + (0.05 * powerUps.totalPowerUps * 100).toFixed(0) + "%</span>", 300)
|
if (powerUps.totalPowerUps) game.makeTextLog("<span style='font-size:115%;'> max health increased by " + (gain * 100).toFixed(0) + "%</span>", 300)
|
||||||
}
|
}
|
||||||
if (mod.isHealLowHealth) {
|
if (mod.isHealLowHealth) {
|
||||||
const len = Math.floor((mech.maxHealth - mech.health) / 0.5)
|
const len = Math.floor((mech.maxHealth - mech.health) / 0.5)
|
||||||
for (let i = 0; i < len; i++) {
|
for (let i = 0; i < len; i++) {
|
||||||
powerUps.spawn(mech.pos.x + 60 * (Math.random() - 0.5), mech.pos.y + 60 * (Math.random() - 0.5), "heal", false);
|
powerUps.spawn(mech.pos.x + 60 * (Math.random() - 0.5), mech.pos.y + 60 * (Math.random() - 0.5), "heal", false);
|
||||||
|
// powerUps.heal.spawn(mech.pos.x + 60 * (Math.random() - 0.5), mech.pos.y + 60 * (Math.random() - 0.5), 50);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (mod.isPerpetualReroll) powerUps.spawn(mech.pos.x + 60 * (Math.random() - 0.5), mech.pos.y + 60 * (Math.random() - 0.5), "reroll", false);
|
if (mod.isPerpetualReroll) powerUps.spawn(mech.pos.x + 60 * (Math.random() - 0.5), mech.pos.y + 60 * (Math.random() - 0.5), "reroll", false);
|
||||||
|
|||||||
59
js/mods.js
59
js/mods.js
@@ -110,8 +110,8 @@ const mod = {
|
|||||||
if (mod.isDamageFromBulletCount) dmg *= 1 + bullet.length * 0.0038
|
if (mod.isDamageFromBulletCount) dmg *= 1 + bullet.length * 0.0038
|
||||||
if (mod.isRerollDamage) dmg *= 1 + 0.04 * powerUps.reroll.rerolls
|
if (mod.isRerollDamage) dmg *= 1 + 0.04 * powerUps.reroll.rerolls
|
||||||
if (mod.isOneGun && b.inventory.length < 2) dmg *= 1.25
|
if (mod.isOneGun && b.inventory.length < 2) dmg *= 1.25
|
||||||
if (mod.isNoFireDamage && mech.cycle > mech.fireCDcycle + 120) dmg *= 1.5
|
if (mod.isNoFireDamage && mech.cycle > mech.fireCDcycle + 120) dmg *= 1.66
|
||||||
if (mod.isSpeedDamage) dmg *= 1 + Math.min(0.33, player.speed * 0.011)
|
if (mod.isSpeedDamage) dmg *= 1 + Math.min(0.4, player.speed * 0.013)
|
||||||
if (mod.isBotDamage) dmg *= 1 + 0.02 * mod.totalBots()
|
if (mod.isBotDamage) dmg *= 1 + 0.02 * mod.totalBots()
|
||||||
return dmg * mod.slowFire * mod.aimDamage
|
return dmg * mod.slowFire * mod.aimDamage
|
||||||
},
|
},
|
||||||
@@ -485,7 +485,7 @@ const mod = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "reaction inhibitor",
|
name: "reaction inhibitor",
|
||||||
description: "mobs spawn with <strong>12%</strong> less <strong>health</strong>",
|
description: "mobs spawn with <strong>11%</strong> less <strong>health</strong>",
|
||||||
maxCount: 3,
|
maxCount: 3,
|
||||||
count: 0,
|
count: 0,
|
||||||
allowed() {
|
allowed() {
|
||||||
@@ -493,7 +493,7 @@ const mod = {
|
|||||||
},
|
},
|
||||||
requires: "any mob death mod",
|
requires: "any mob death mod",
|
||||||
effect: () => {
|
effect: () => {
|
||||||
mod.mobSpawnWithHealth *= 0.88
|
mod.mobSpawnWithHealth *= 0.89
|
||||||
|
|
||||||
//set all mobs at full health to 0.85
|
//set all mobs at full health to 0.85
|
||||||
for (let i = 0; i < mob.length; i++) {
|
for (let i = 0; i < mob.length; i++) {
|
||||||
@@ -973,7 +973,7 @@ const mod = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "anticorrelation",
|
name: "anticorrelation",
|
||||||
description: "increase <strong class='color-d'>damage</strong> by <strong>50%</strong><br>after not using your <strong class='color-g'>gun</strong> or <strong class='color-f'>field</strong> for <strong>2</strong> seconds",
|
description: "increase <strong class='color-d'>damage</strong> by <strong>66%</strong><br>after not using your <strong class='color-g'>gun</strong> or <strong class='color-f'>field</strong> for <strong>2</strong> seconds",
|
||||||
maxCount: 1,
|
maxCount: 1,
|
||||||
count: 0,
|
count: 0,
|
||||||
allowed() {
|
allowed() {
|
||||||
@@ -989,7 +989,7 @@ const mod = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "non-Newtonian armor",
|
name: "non-Newtonian armor",
|
||||||
description: "for <strong>10 seconds</strong> after receiving <strong class='color-harm'>harm</strong><br>reduce <strong class='color-harm'>harm</strong> by <strong>50%</strong>",
|
description: "for <strong>10 seconds</strong> after receiving <strong class='color-harm'>harm</strong><br>reduce <strong class='color-harm'>harm</strong> by <strong>66%</strong>",
|
||||||
maxCount: 1,
|
maxCount: 1,
|
||||||
count: 0,
|
count: 0,
|
||||||
allowed() {
|
allowed() {
|
||||||
@@ -1021,7 +1021,7 @@ const mod = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "liquid cooling",
|
name: "liquid cooling",
|
||||||
description: `<strong class='color-s'>freeze</strong> all mobs for <strong>4</strong> seconds<br>after receiving <strong class='color-harm'>harm</strong>`,
|
description: `<strong class='color-s'>freeze</strong> all mobs for <strong>5</strong> seconds<br>after receiving <strong class='color-harm'>harm</strong>`,
|
||||||
maxCount: 1,
|
maxCount: 1,
|
||||||
count: 0,
|
count: 0,
|
||||||
allowed() {
|
allowed() {
|
||||||
@@ -1118,7 +1118,7 @@ const mod = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "piezoelectricity",
|
name: "piezoelectricity",
|
||||||
description: "<strong>colliding</strong> with mobs overfills <strong class='color-f'>energy</strong> by <strong>200</strong><br>reduce <strong class='color-harm'>harm</strong> by <strong>15%</strong>",
|
description: "<strong>colliding</strong> with mobs gives you <strong>400</strong> <strong class='color-f'>energy</strong><br>reduce <strong class='color-harm'>harm</strong> by <strong>15%</strong>",
|
||||||
maxCount: 1,
|
maxCount: 1,
|
||||||
count: 0,
|
count: 0,
|
||||||
allowed() {
|
allowed() {
|
||||||
@@ -1127,7 +1127,7 @@ const mod = {
|
|||||||
requires: "not mass-energy equivalence",
|
requires: "not mass-energy equivalence",
|
||||||
effect() {
|
effect() {
|
||||||
mod.isPiezo = true;
|
mod.isPiezo = true;
|
||||||
mech.energy += 2;
|
mech.energy += 4;
|
||||||
},
|
},
|
||||||
remove() {
|
remove() {
|
||||||
mod.isPiezo = false;
|
mod.isPiezo = false;
|
||||||
@@ -1135,7 +1135,7 @@ const mod = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "ground state",
|
name: "ground state",
|
||||||
description: "reduce <strong class='color-harm'>harm</strong> by <strong>60%</strong><br>you <strong>no longer</strong> passively regenerate <strong class='color-f'>energy</strong>",
|
description: "reduce <strong class='color-harm'>harm</strong> by <strong>66%</strong><br>you <strong>no longer</strong> passively regenerate <strong class='color-f'>energy</strong>",
|
||||||
maxCount: 1,
|
maxCount: 1,
|
||||||
count: 0,
|
count: 0,
|
||||||
allowed() {
|
allowed() {
|
||||||
@@ -1159,7 +1159,7 @@ const mod = {
|
|||||||
allowed() {
|
allowed() {
|
||||||
return !mod.isEnergyLoss && !mod.isPiezo && !mod.isRewindAvoidDeath && !mod.isSpeedHarm && mech.fieldUpgrades[mech.fieldMode].name !== "negative mass field"
|
return !mod.isEnergyLoss && !mod.isPiezo && !mod.isRewindAvoidDeath && !mod.isSpeedHarm && mech.fieldUpgrades[mech.fieldMode].name !== "negative mass field"
|
||||||
},
|
},
|
||||||
requires: "not exothermic process, piezoelectricity, CPT, 1st law, negative mass field",
|
requires: "not exothermic process, piezoelectricity, CPT, 1st law, negative mass",
|
||||||
effect: () => {
|
effect: () => {
|
||||||
mech.health = 0
|
mech.health = 0
|
||||||
// mech.displayHealth();
|
// mech.displayHealth();
|
||||||
@@ -1309,8 +1309,8 @@ const mod = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "crystallized armor",
|
name: "inductive coupling",
|
||||||
description: "increase <strong>maximum</strong> <strong class='color-h'>health</strong> by <strong>5</strong> for each<br>unused <strong>power up</strong> at the end of a <strong>level</strong>",
|
description: "for each unused <strong>power up</strong> at the end of a <strong>level</strong><br>add 4 <strong>max</strong> <strong class='color-h'>health</strong> <em>(up to 44 health per level)</em>",
|
||||||
maxCount: 1,
|
maxCount: 1,
|
||||||
count: 0,
|
count: 0,
|
||||||
allowed() {
|
allowed() {
|
||||||
@@ -1326,6 +1326,22 @@ const mod = {
|
|||||||
mech.setMaxHealth();
|
mech.setMaxHealth();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "transceiver chip",
|
||||||
|
description: "at the end of each <strong>level</strong><br>gain the full <strong>effect</strong> of unused <strong>power ups</strong>",
|
||||||
|
maxCount: 1,
|
||||||
|
count: 0,
|
||||||
|
allowed() {
|
||||||
|
return mod.isArmorFromPowerUps
|
||||||
|
},
|
||||||
|
requires: "crystallized armor",
|
||||||
|
effect() {
|
||||||
|
mod.isEndLevelPowerUp = true;
|
||||||
|
},
|
||||||
|
remove() {
|
||||||
|
mod.isEndLevelPowerUp = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "negentropy",
|
name: "negentropy",
|
||||||
description: `at the start of each <strong>level</strong><br>spawn a <strong class='color-h'>heal</strong> for every <strong>50</strong> missing health`,
|
description: `at the start of each <strong>level</strong><br>spawn a <strong class='color-h'>heal</strong> for every <strong>50</strong> missing health`,
|
||||||
@@ -1649,7 +1665,7 @@ const mod = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "catabolism",
|
name: "catabolism",
|
||||||
description: "gain <strong class='color-g'>ammo</strong> when you <strong>fire</strong> while <strong>out</strong> of <strong class='color-g'>ammo</strong><br>drains <strong>2%</strong> of <strong>max health</strong>",
|
description: "when you <strong>fire</strong> while <strong>out</strong> of <strong class='color-g'>ammo</strong><br>gain <strong>3</strong> <strong class='color-g'>ammo</strong>, but lose <strong>5</strong> <strong>health</strong>",
|
||||||
maxCount: 1,
|
maxCount: 1,
|
||||||
count: 0,
|
count: 0,
|
||||||
allowed() {
|
allowed() {
|
||||||
@@ -1657,10 +1673,10 @@ const mod = {
|
|||||||
},
|
},
|
||||||
requires: "not mass-energy equivalence<br>not exciton-lattice",
|
requires: "not mass-energy equivalence<br>not exciton-lattice",
|
||||||
effect: () => {
|
effect: () => {
|
||||||
mod.isAmmoFromHealth = 0.02;
|
mod.isAmmoFromHealth = true;
|
||||||
},
|
},
|
||||||
remove() {
|
remove() {
|
||||||
mod.isAmmoFromHealth = 0;
|
mod.isAmmoFromHealth = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -2733,7 +2749,7 @@ const mod = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "thermoelectric effect",
|
name: "thermoelectric effect",
|
||||||
description: "<strong>killing</strong> mobs with <strong>ice IX</strong> gives <strong>4</strong> <strong class='color-h'>health</strong><br>and overloads <strong class='color-f'>energy</strong> by <strong>100</strong>",
|
description: "<strong>killing</strong> mobs with <strong>ice IX</strong> gives <strong>4</strong> <strong class='color-h'>health</strong><br>and <strong>100</strong> <strong class='color-f'>energy</strong>",
|
||||||
isGunMod: true,
|
isGunMod: true,
|
||||||
maxCount: 9,
|
maxCount: 9,
|
||||||
count: 0,
|
count: 0,
|
||||||
@@ -2818,7 +2834,7 @@ const mod = {
|
|||||||
// },
|
// },
|
||||||
{
|
{
|
||||||
name: "half-wave rectifier",
|
name: "half-wave rectifier",
|
||||||
description: "charging the <strong>rail gun</strong> overfills your <strong class='color-f'>energy</strong><br><em>instead of draining it</em>",
|
description: "charging the <strong>rail gun</strong> gives you <strong class='color-f'>energy</strong><br><em>instead of draining it</em>",
|
||||||
isGunMod: true,
|
isGunMod: true,
|
||||||
maxCount: 1,
|
maxCount: 1,
|
||||||
count: 0,
|
count: 0,
|
||||||
@@ -3155,7 +3171,7 @@ const mod = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "pair production",
|
name: "pair production",
|
||||||
description: "<strong>power ups</strong> overfill your <strong class='color-f'>energy</strong> by <strong>300</strong>",
|
description: "picking up a <strong>power up</strong> gives you <strong>250</strong> <strong class='color-f'>energy</strong>",
|
||||||
isFieldMod: true,
|
isFieldMod: true,
|
||||||
maxCount: 1,
|
maxCount: 1,
|
||||||
count: 0,
|
count: 0,
|
||||||
@@ -3539,7 +3555,7 @@ const mod = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Penrose process",
|
name: "Penrose process",
|
||||||
description: "after a <strong>block</strong> falls into a <strong class='color-worm'>wormhole</strong><br>your <strong class='color-f'>energy</strong> overfills by <strong>50</strong>",
|
description: "after a <strong>block</strong> falls into a <strong class='color-worm'>wormhole</strong><br>you gain <strong>50</strong> <strong class='color-f'>energy</strong>",
|
||||||
isFieldMod: true,
|
isFieldMod: true,
|
||||||
maxCount: 1,
|
maxCount: 1,
|
||||||
count: 0,
|
count: 0,
|
||||||
@@ -3857,5 +3873,6 @@ const mod = {
|
|||||||
isLowEnergyDamage: null,
|
isLowEnergyDamage: null,
|
||||||
isRewindBot: null,
|
isRewindBot: null,
|
||||||
isRewindGrenade: null,
|
isRewindGrenade: null,
|
||||||
isExtruder: null
|
isExtruder: null,
|
||||||
|
isEndLevelPowerUp: null
|
||||||
}
|
}
|
||||||
40
js/player.js
40
js/player.js
@@ -353,31 +353,9 @@ const mech = {
|
|||||||
game.makeGunHUD(); //update gun HUD
|
game.makeGunHUD(); //update gun HUD
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function pixelWindows() {
|
|
||||||
|
|
||||||
//pixel graphics
|
|
||||||
let imgData = ctx.getImageData(0, 0, canvas.width, canvas.height); //copy current canvas pixel data
|
|
||||||
let data = imgData.data;
|
|
||||||
//change random pixels
|
|
||||||
//strange draw offset
|
|
||||||
// const off = canvas.height * canvas.width * 4 / 16
|
|
||||||
for (let i = 0; i < data.length; i += 4) {
|
|
||||||
index = i % canvas.width
|
|
||||||
data[index + 0] = data[index + 0]; // red
|
|
||||||
data[index + 1] = data[index + 1]; // red
|
|
||||||
data[index + 2] = data[index + 2]; // red
|
|
||||||
data[index + 3] = data[index + 3]; // red
|
|
||||||
}
|
|
||||||
ctx.putImageData(imgData, 0, 0); //draw new pixel data to canvas
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
game.wipe = function() { //set wipe to have trails
|
game.wipe = function() { //set wipe to have trails
|
||||||
ctx.fillStyle = "rgba(255,255,255,0)";
|
ctx.fillStyle = "rgba(255,255,255,0)";
|
||||||
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
||||||
// pixelWindows()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function randomizeEverything() {
|
function randomizeEverything() {
|
||||||
@@ -423,6 +401,7 @@ const mech = {
|
|||||||
mech.displayHealth();
|
mech.displayHealth();
|
||||||
document.getElementById("text-log").style.opacity = 0; //fade out any active text logs
|
document.getElementById("text-log").style.opacity = 0; //fade out any active text logs
|
||||||
document.getElementById("fade-out").style.opacity = 1; //slowly fades out
|
document.getElementById("fade-out").style.opacity = 1; //slowly fades out
|
||||||
|
// build.shareURL(false)
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
World.clear(engine.world);
|
World.clear(engine.world);
|
||||||
Engine.clear(engine);
|
Engine.clear(engine);
|
||||||
@@ -475,14 +454,14 @@ const mech = {
|
|||||||
harmReduction() {
|
harmReduction() {
|
||||||
let dmg = 1
|
let dmg = 1
|
||||||
dmg *= mech.fieldHarmReduction
|
dmg *= mech.fieldHarmReduction
|
||||||
if (mod.isSpeedHarm) dmg *= 1 - Math.min(player.speed * 0.018, 0.5)
|
if (mod.isSpeedHarm) dmg *= 1 - Math.min(player.speed * 0.0185, 0.55)
|
||||||
if (mod.isSlowFPS) dmg *= 0.85
|
if (mod.isSlowFPS) dmg *= 0.85
|
||||||
if (mod.isPiezo) dmg *= 0.85
|
if (mod.isPiezo) dmg *= 0.85
|
||||||
if (mod.isHarmReduce && mech.fieldUpgrades[mech.fieldMode].name === "negative mass field" && mech.isFieldActive) dmg *= 0.6
|
if (mod.isHarmReduce && mech.fieldUpgrades[mech.fieldMode].name === "negative mass field" && mech.isFieldActive) dmg *= 0.6
|
||||||
if (mod.isBotArmor) dmg *= 0.97 ** mod.totalBots()
|
if (mod.isBotArmor) dmg *= 0.97 ** mod.totalBots()
|
||||||
if (mod.isHarmArmor && mech.lastHarmCycle + 600 > mech.cycle) dmg *= 0.5;
|
if (mod.isHarmArmor && mech.lastHarmCycle + 600 > mech.cycle) dmg *= 0.33;
|
||||||
if (mod.isNoFireDefense && mech.cycle > mech.fireCDcycle + 120) dmg *= 0.6
|
if (mod.isNoFireDefense && mech.cycle > mech.fireCDcycle + 120) dmg *= 0.6
|
||||||
if (mod.energyRegen === 0) dmg *= 0.4 //0.22 + 0.78 * mech.energy //77% damage reduction at zero energy
|
if (mod.energyRegen === 0) dmg *= 0.33 //0.22 + 0.78 * mech.energy //77% damage reduction at zero energy
|
||||||
if (mod.isTurret && mech.crouch) dmg *= 0.5;
|
if (mod.isTurret && mech.crouch) dmg *= 0.5;
|
||||||
if (mod.isEntanglement && b.inventory[0] === b.activeGun) {
|
if (mod.isEntanglement && b.inventory[0] === b.activeGun) {
|
||||||
for (let i = 0, len = b.inventory.length; i < len; i++) dmg *= 0.87 // 1 - 0.15
|
for (let i = 0, len = b.inventory.length; i < len; i++) dmg *= 0.87 // 1 - 0.15
|
||||||
@@ -675,7 +654,7 @@ const mech = {
|
|||||||
mech.defaultFPSCycle = mech.cycle + 20 + Math.min(90, Math.floor(200 * dmg))
|
mech.defaultFPSCycle = mech.cycle + 20 + Math.min(90, Math.floor(200 * dmg))
|
||||||
if (mod.isHarmFreeze) { //freeze all mobs
|
if (mod.isHarmFreeze) { //freeze all mobs
|
||||||
for (let i = 0, len = mob.length; i < len; i++) {
|
for (let i = 0, len = mob.length; i < len; i++) {
|
||||||
mobs.statusSlow(mob[i], 240)
|
mobs.statusSlow(mob[i], 300)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -1641,7 +1620,7 @@ const mech = {
|
|||||||
effect() {
|
effect() {
|
||||||
mech.fieldMeterColor = "#f0f"
|
mech.fieldMeterColor = "#f0f"
|
||||||
mech.hold = function() {
|
mech.hold = function() {
|
||||||
mech.isExtruderOn = false
|
b.isExtruderOn = false
|
||||||
if (mech.isHolding) {
|
if (mech.isHolding) {
|
||||||
mech.drawHold(mech.holdingTarget);
|
mech.drawHold(mech.holdingTarget);
|
||||||
mech.holding();
|
mech.holding();
|
||||||
@@ -1663,9 +1642,10 @@ const mech = {
|
|||||||
|
|
||||||
if (mod.isExtruder) {
|
if (mod.isExtruder) {
|
||||||
if (input.field) {
|
if (input.field) {
|
||||||
mech.wasExtruderOn = true
|
b.wasExtruderOn = true
|
||||||
} else {
|
} else {
|
||||||
mech.wasExtruderOn = false
|
b.wasExtruderOn = false
|
||||||
|
b.canExtruderFire = true
|
||||||
}
|
}
|
||||||
ctx.lineWidth = 5;
|
ctx.lineWidth = 5;
|
||||||
ctx.strokeStyle = "#f07"
|
ctx.strokeStyle = "#f07"
|
||||||
@@ -1680,7 +1660,7 @@ const mech = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (mech.wasExtruderOn && mech.isExtruderOn) ctx.lineTo(mech.pos.x + 15 * Math.cos(mech.angle), mech.pos.y + 15 * Math.sin(mech.angle))
|
if (b.wasExtruderOn && b.isExtruderOn) ctx.lineTo(mech.pos.x + 15 * Math.cos(mech.angle), mech.pos.y + 15 * Math.sin(mech.angle))
|
||||||
ctx.stroke();
|
ctx.stroke();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -170,8 +170,12 @@ const powerUps = {
|
|||||||
mech.setMaxEnergy();
|
mech.setMaxEnergy();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
spawn() { //used to spawn a heal with a specific size / heal amount, not normally used
|
spawn(x, y, size) { //used to spawn a heal with a specific size / heal amount, not normally used
|
||||||
|
powerUps.directSpawn(x, y, "heal", false, null, size)
|
||||||
|
if (Math.random() < mod.duplicationChance()) {
|
||||||
|
powerUps.directSpawn(x, y, "heal", false, null, size)
|
||||||
|
powerUp[powerUp.length - 1].isBonus = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
ammo: {
|
ammo: {
|
||||||
@@ -318,15 +322,15 @@ const powerUps = {
|
|||||||
if (mod.mods[choose].isFieldMod) {
|
if (mod.mods[choose].isFieldMod) {
|
||||||
text += `<div class="choose-grid-module" onclick="powerUps.choose('mod',${choose})"><div class="grid-title">
|
text += `<div class="choose-grid-module" onclick="powerUps.choose('mod',${choose})"><div class="grid-title">
|
||||||
<span style="position:relative;">
|
<span style="position:relative;">
|
||||||
<div class="circle-grid field" style="position:absolute; top:0; left:10px;opacity:1;"></div>
|
<div class="circle-grid mod" style="position:absolute; top:0; left:0;opacity:0.8;"></div>
|
||||||
<div class="circle-grid mod" style="position:absolute; top:0; left:0;opacity:0.75;"></div>
|
<div class="circle-grid field" style="position:absolute; top:0; left:10px;opacity:0.65;"></div>
|
||||||
</span>
|
</span>
|
||||||
${mod.mods[choose].name} ${isCount}</div>${mod.mods[choose].description}</div></div>`
|
${mod.mods[choose].name} ${isCount}</div>${mod.mods[choose].description}</div></div>`
|
||||||
} else if (mod.mods[choose].isGunMod) {
|
} else if (mod.mods[choose].isGunMod) {
|
||||||
text += `<div class="choose-grid-module" onclick="powerUps.choose('mod',${choose})"><div class="grid-title">
|
text += `<div class="choose-grid-module" onclick="powerUps.choose('mod',${choose})"><div class="grid-title">
|
||||||
<span style="position:relative;">
|
<span style="position:relative;">
|
||||||
<div class="circle-grid gun" style="position:absolute; top:0; left:10px; opacity:0.75;"></div>
|
<div class="circle-grid mod" style="position:absolute; top:0; left:0;opacity:0.8;"></div>
|
||||||
<div class="circle-grid mod" style="position:absolute; top:0; left:0;opacity:0.75;"></div>
|
<div class="circle-grid gun" style="position:absolute; top:0; left:10px; opacity:0.65;"></div>
|
||||||
</span>
|
</span>
|
||||||
${mod.mods[choose].name} ${isCount}</div>${mod.mods[choose].description}</div></div>`
|
${mod.mods[choose].name} ${isCount}</div>${mod.mods[choose].description}</div></div>`
|
||||||
} else {
|
} else {
|
||||||
@@ -455,7 +459,7 @@ const powerUps = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onPickUp(where) {
|
onPickUp(where) {
|
||||||
if (mod.isMassEnergy && mech.energy < mech.maxEnergy * 2.5) mech.energy += 3;
|
if (mod.isMassEnergy) mech.energy += 2.5;
|
||||||
if (mod.isMineDrop) b.mine({
|
if (mod.isMineDrop) b.mine({
|
||||||
x: where.x,
|
x: where.x,
|
||||||
y: where.y
|
y: where.y
|
||||||
@@ -656,7 +660,7 @@ const powerUps = {
|
|||||||
) {
|
) {
|
||||||
powerUps.directSpawn(x, y, target, moving, mode, size)
|
powerUps.directSpawn(x, y, target, moving, mode, size)
|
||||||
if (Math.random() < mod.duplicationChance()) {
|
if (Math.random() < mod.duplicationChance()) {
|
||||||
powerUps.directSpawn(x, y, target, moving, mode)
|
powerUps.directSpawn(x, y, target, moving, mode, size)
|
||||||
powerUp[powerUp.length - 1].isBonus = true
|
powerUp[powerUp.length - 1].isBonus = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -930,6 +930,7 @@ const spawn = {
|
|||||||
let targets = [] //track who is in the node boss, for shields
|
let targets = [] //track who is in the node boss, for shields
|
||||||
mobs.spawn(x, y, 6, radius, "#b386e8");
|
mobs.spawn(x, y, 6, radius, "#b386e8");
|
||||||
let me = mob[mob.length - 1];
|
let me = mob[mob.length - 1];
|
||||||
|
Matter.Body.setDensity(me, 0.002); //extra dense //normal is 0.001 //makes effective life much larger
|
||||||
me.isBoss = true;
|
me.isBoss = true;
|
||||||
targets.push(me.id) //add to shield protection
|
targets.push(me.id) //add to shield protection
|
||||||
me.friction = 0;
|
me.friction = 0;
|
||||||
@@ -991,6 +992,7 @@ const spawn = {
|
|||||||
|
|
||||||
for (let i = 0; i < nodes; ++i) {
|
for (let i = 0; i < nodes; ++i) {
|
||||||
spawn.stabber(x + sideLength * Math.sin(i * angle), y + sideLength * Math.cos(i * angle), radius, 12);
|
spawn.stabber(x + sideLength * Math.sin(i * angle), y + sideLength * Math.cos(i * angle), radius, 12);
|
||||||
|
Matter.Body.setDensity(mob[mob.length - 1], 0.002); //extra dense //normal is 0.001 //makes effective life much larger
|
||||||
targets.push(mob[mob.length - 1].id) //track who is in the node boss, for shields
|
targets.push(mob[mob.length - 1].id) //track who is in the node boss, for shields
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -585,15 +585,16 @@ em {
|
|||||||
|
|
||||||
.mod {
|
.mod {
|
||||||
/* background: rgb(116, 102, 238); */
|
/* background: rgb(116, 102, 238); */
|
||||||
background: hsl(253, 80%, 67%);
|
/* background: hsl(253, 57%, 52%); */
|
||||||
|
background: hsl(255, 100%, 71%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.grey {
|
/* .grey {
|
||||||
background: #afb6c2;
|
background: #afb6c2;
|
||||||
}
|
} */
|
||||||
|
|
||||||
.gun {
|
.gun {
|
||||||
background: rgb(10, 79, 198);
|
background: rgb(0, 80, 218);
|
||||||
}
|
}
|
||||||
|
|
||||||
.heal {
|
.heal {
|
||||||
|
|||||||
25
todo.txt
25
todo.txt
@@ -1,12 +1,17 @@
|
|||||||
******************************************************** NEXT PATCH ********************************************************
|
******************************************************** NEXT PATCH ********************************************************
|
||||||
|
|
||||||
|
your build url can now be copied in the pause screen
|
||||||
|
|
||||||
mods for guns and fields have an extra circle in selection menus
|
mod: inductive coupling - 4 max health per power up, but limited to 44 max health per level (replaces crystalized armor)
|
||||||
|
mod: transceiver chip - use all the power ups left over at the end of a level
|
||||||
|
mod: catabolism - does a flat 5 damage to your health for 3 ammo (was 2% of max health for 1 ammo)
|
||||||
|
|
||||||
******************************************************** BUGS ********************************************************
|
******************************************************** BUGS ********************************************************
|
||||||
|
|
||||||
entering custom, after dieing makes all mods look white (not disabled)
|
give worm hole pair production?
|
||||||
this goes away after clicking something so it seems to be only a graphical issue
|
|
||||||
|
2nd mod for crystalized armor
|
||||||
|
no cap for health power ups?
|
||||||
|
|
||||||
(not able to reproduce, might be fixed) possible bug with neutron rewind
|
(not able to reproduce, might be fixed) possible bug with neutron rewind
|
||||||
status doesn't apply correctly for spawned neutron bombs that are stuck to a shield
|
status doesn't apply correctly for spawned neutron bombs that are stuck to a shield
|
||||||
@@ -20,8 +25,9 @@ mod and mob are too similar
|
|||||||
(always) is there a way to check if the player is stuck inside the map or block
|
(always) is there a way to check if the player is stuck inside the map or block
|
||||||
trigger a short term non-collide if that occurs
|
trigger a short term non-collide if that occurs
|
||||||
|
|
||||||
(8+ reports before potential fix) bug - crouch and worm hole? -> crouch locked in
|
(12+ reports) bug - crouch and worm hole? -> crouch locked in
|
||||||
test this on a slower computer, doesn't occur on my computer
|
doesn't occur on my computer?
|
||||||
|
you can spoof it with mech.crouch = true in console
|
||||||
players have extra gravity
|
players have extra gravity
|
||||||
might be from the short jump code
|
might be from the short jump code
|
||||||
add in a check every 7 seconds to try and fix it
|
add in a check every 7 seconds to try and fix it
|
||||||
@@ -38,6 +44,15 @@ mod and mob are too similar
|
|||||||
|
|
||||||
******************************************************** TODO ********************************************************
|
******************************************************** TODO ********************************************************
|
||||||
|
|
||||||
|
make a reset hit box function as a way to fix crouch bug
|
||||||
|
|
||||||
|
mod that requires integrated armament
|
||||||
|
|
||||||
|
mod - reset level
|
||||||
|
you trade a mod for a chance at killing a new level boss and farming more ammo
|
||||||
|
resets health, ammo (but not mods, fields, guns, ... ?)
|
||||||
|
scramble level order? or same level
|
||||||
|
|
||||||
mechanic - Your energy regen is only active when field and gun have not been used for 5 seconds.
|
mechanic - Your energy regen is only active when field and gun have not been used for 5 seconds.
|
||||||
|
|
||||||
be able to open up custom mode in the normal game
|
be able to open up custom mode in the normal game
|
||||||
|
|||||||
Reference in New Issue
Block a user