ionization energy

mod: ionization energy - heal power ups give you 4% max energy
  requires mass-energy equivalence

mod: discrete optimization - 50% damage and 50% slow fire rotates
  requires cloaking field
This commit is contained in:
landgreen
2020-09-26 05:34:38 -07:00
parent 2c34a7d89d
commit 5728008397
8 changed files with 228 additions and 79 deletions

View File

@@ -92,7 +92,7 @@ const b = {
}, },
fireCD: 1, fireCD: 1,
setFireCD() { setFireCD() {
b.fireCD = mod.fireRate * mod.slowFire * mod.rerollHaste / mod.fastTime b.fireCD = mod.fireRate * mod.slowFire * mod.rerollHaste * mod.aimDamage / mod.fastTime
}, },
fireAttributes(dir, rotate = true) { fireAttributes(dir, rotate = true) {
if (rotate) { if (rotate) {
@@ -439,7 +439,7 @@ const b = {
//move until you are touching the wall //move until you are touching the wall
Matter.Body.setPosition(this, Vector.add(this.position, Vector.mult(collide[i].normal, 2))) Matter.Body.setPosition(this, Vector.add(this.position, Vector.mult(collide[i].normal, 2)))
} }
break
} }
} }
} else { } else {
@@ -694,7 +694,7 @@ const b = {
// const FRICTION = mod.isFastDrones ? 0.008 : 0.0005 // const FRICTION = mod.isFastDrones ? 0.008 : 0.0005
const dir = mech.angle + 0.4 * (Math.random() - 0.5); const dir = mech.angle + 0.4 * (Math.random() - 0.5);
const RADIUS = (4.5 + 3 * Math.random()) const RADIUS = (4.5 + 3 * Math.random())
bullet[me] = Bodies.polygon(mech.pos.x + 30 * Math.cos(mech.angle), mech.pos.y + 30 * Math.sin(mech.angle), 8, RADIUS, { bullet[me] = Bodies.polygon(mech.pos.x + 30 * Math.cos(mech.angle) + Math.random(), mech.pos.y + 30 * Math.sin(mech.angle) + Math.random(), 8, RADIUS, {
angle: dir, angle: dir,
inertia: Infinity, inertia: Infinity,
friction: 0.05, friction: 0.05,
@@ -762,19 +762,17 @@ const b = {
(powerUp[i].name !== "field" || !mod.isDeterminism) (powerUp[i].name !== "field" || !mod.isDeterminism)
) { ) {
//pick up nearby power ups //pick up nearby power ups
if (Vector.magnitudeSquared(Vector.sub(this.position, powerUp[i].position)) < 60000 && if (Vector.magnitudeSquared(Vector.sub(this.position, powerUp[i].position)) < 60000 && !game.isChoosing) {
!game.isChoosing) {
powerUps.onPickUp(this.position); powerUps.onPickUp(this.position);
powerUp[i].effect(); powerUp[i].effect();
Matter.World.remove(engine.world, powerUp[i]); Matter.World.remove(engine.world, powerUp[i]);
powerUp.splice(i, 1); powerUp.splice(i, 1);
if (mod.isDroneGrab) { if (mod.isDroneGrab) {
this.isImproved = true; this.isImproved = true;
const SCALE = 3.5 const SCALE = 3
Matter.Body.scale(this, SCALE, SCALE); Matter.Body.scale(this, SCALE, SCALE);
this.lookFrequency = 30; this.lookFrequency = 30;
this.endCycle += 2000 this.endCycle += 2500
// this.dmg *= 1.25;
this.frictionAir = 0 this.frictionAir = 0
} }
break; break;
@@ -1640,8 +1638,8 @@ const b = {
name: "shotgun", name: "shotgun",
description: "fire a <strong>burst</strong> of short range <strong> bullets</strong> <br><em>crouch to reduce recoil</em>", description: "fire a <strong>burst</strong> of short range <strong> bullets</strong> <br><em>crouch to reduce recoil</em>",
ammo: 0, ammo: 0,
ammoPack: 7, ammoPack: 6,
defaultAmmoPack: 7, defaultAmmoPack: 6,
have: false, have: false,
fire() { fire() {
let knock, spread let knock, spread
@@ -1658,7 +1656,7 @@ const b = {
} }
if (mod.isShotgunRecoil) { if (mod.isShotgunRecoil) {
mech.fireCDcycle -= 15 mech.fireCDcycle -= 0.66 * (45 * b.fireCD)
player.force.x -= 2 * knock * Math.cos(mech.angle) player.force.x -= 2 * knock * Math.cos(mech.angle)
player.force.y -= 2 * knock * Math.sin(mech.angle) //reduce knock back in vertical direction to stop super jumps player.force.y -= 2 * knock * Math.sin(mech.angle) //reduce knock back in vertical direction to stop super jumps
} else { } else {
@@ -1679,10 +1677,10 @@ const b = {
x: speed * Math.cos(dir), x: speed * Math.cos(dir),
y: speed * Math.sin(dir) y: speed * Math.sin(dir)
} }
b.nail(pos, velocity, 1) b.nail(pos, velocity, 1.2)
} }
} else { } else {
const side = 21 const side = 22
for (let i = 0; i < 17; i++) { for (let i = 0; i < 17; i++) {
const me = bullet.length; const me = bullet.length;
const dir = mech.angle + (Math.random() - 0.5) * spread const dir = mech.angle + (Math.random() - 0.5) * spread

View File

@@ -172,8 +172,8 @@ function collisionChecks(event) {
y: mob[k].velocity.y - 8 * Math.sin(angle) y: mob[k].velocity.y - 8 * Math.sin(angle)
}); });
if (mod.isAnnihilation && !mob[k].shield && !mob[k].isShielded && mech.energy > 0.33) { if (mod.isAnnihilation && !mob[k].shield && !mob[k].isShielded && mech.energy > 0.34 * mech.maxEnergy) {
mech.energy -= 0.33 mech.energy -= 0.33 * mech.maxEnergy
mech.immuneCycle = 0; //player doesn't go immune to collision damage mech.immuneCycle = 0; //player doesn't go immune to collision damage
mob[k].death(); mob[k].death();
game.drawList.push({ game.drawList.push({
@@ -200,8 +200,7 @@ function collisionChecks(event) {
//mob + bullet collisions //mob + bullet collisions
if (obj.classType === "bullet" && obj.speed > obj.minDmgSpeed) { if (obj.classType === "bullet" && obj.speed > obj.minDmgSpeed) {
let dmg = b.dmgScale * (obj.dmg + 0.15 * obj.mass * Vector.magnitude(Vector.sub(mob[k].velocity, obj.velocity))) let dmg = b.dmgScale * (obj.dmg + 0.15 * obj.mass * Vector.magnitude(Vector.sub(mob[k].velocity, obj.velocity)))
// console.log(mob[k].seePlayer.recall) if (mod.isCrit && mob[k].isStunned) dmg *= 4
if (mod.isCrit && mob[k].isStunned) dmg *= 5
mob[k].foundPlayer(); mob[k].foundPlayer();
mob[k].damage(dmg); mob[k].damage(dmg);
obj.onDmg(mob[k]); //some bullets do actions when they hits things, like despawn //forces don't seem to work here obj.onDmg(mob[k]); //some bullets do actions when they hits things, like despawn //forces don't seem to work here

View File

@@ -367,6 +367,7 @@ const game = {
game.boldActiveGunHUD(); game.boldActiveGunHUD();
// mech.drop(); // mech.drop();
}, },
isPauseKeyReady: true,
keyPress() { //runs on key down event keyPress() { //runs on key down event
//full screen toggle //full screen toggle
// if (keys[13]) { // if (keys[13]) {
@@ -411,7 +412,13 @@ const game = {
} else if (keys[81]) { //q swap to previous active gun } else if (keys[81]) { //q swap to previous active gun
game.previousGun(); game.previousGun();
} }
if (keys[80] && !game.isChoosing) { //p for pause if (keys[80] && !game.isChoosing && game.isPauseKeyReady) { //p for pause
game.isPauseKeyReady = false
setTimeout(function () {
game.isPauseKeyReady = true
}, 300);
if (game.paused) { if (game.paused) {
build.unPauseGrid() build.unPauseGrid()
game.paused = false; game.paused = false;
@@ -945,7 +952,17 @@ const game = {
ctx.fillText(`(${game.mouseInGame.x.toFixed(1)}, ${game.mouseInGame.y.toFixed(1)})`, game.mouse.x, game.mouse.y - 20); ctx.fillText(`(${game.mouseInGame.x.toFixed(1)}, ${game.mouseInGame.y.toFixed(1)})`, game.mouse.x, game.mouse.y - 20);
}, },
draw: { draw: {
powerUp() { powerUp() { //is set by Bayesian mod
// ctx.globalAlpha = 0.4 * Math.sin(mech.cycle * 0.15) + 0.6;
// for (let i = 0, len = powerUp.length; i < len; ++i) {
// ctx.beginPath();
// ctx.arc(powerUp[i].position.x, powerUp[i].position.y, powerUp[i].size, 0, 2 * Math.PI);
// ctx.fillStyle = powerUp[i].color;
// ctx.fill();
// }
// ctx.globalAlpha = 1;
},
powerUpNormal() { //back up in case power up draw gets changed
ctx.globalAlpha = 0.4 * Math.sin(mech.cycle * 0.15) + 0.6; ctx.globalAlpha = 0.4 * Math.sin(mech.cycle * 0.15) + 0.6;
for (let i = 0, len = powerUp.length; i < len; ++i) { for (let i = 0, len = powerUp.length; i < len; ++i) {
ctx.beginPath(); ctx.beginPath();

View File

@@ -17,7 +17,7 @@ const level = {
// mech.isCloak = true; // mech.isCloak = true;
// mech.setField("metamaterial cloaking") // mech.setField("metamaterial cloaking")
// b.giveGuns("laser") // b.giveGuns("laser")
// mod.giveMod("phase decoherence"); // mod.giveMod("Bayesian statistics");
level.intro(); //starting level level.intro(); //starting level
// level.testing(); //not in rotation // level.testing(); //not in rotation
@@ -837,16 +837,19 @@ const level = {
) )
} else if (game.difficultyMode > 1 && localSettings.levelsClearedLastGame > 10) { //great run on a hard or why } else if (game.difficultyMode > 1 && localSettings.levelsClearedLastGame > 10) { //great run on a hard or why
say.push( say.push(
"I think I'm getting closer to to the end, but what will I find there?", "What do I do after I escape?",
"I'm almost ready to stop these simulations and actually escape.",
"I think I'm getting closer to something, but what?", "I think I'm getting closer to something, but what?",
"I'm getting stronger.", "I'm getting stronger.",
"What happens after I escape?", "What happens after I escape?",
"I found a good combination of technology last time."
) )
} else { //resolve } else { //resolve
say.push( say.push(
"I'll try some different mods this time.", "I'll try some different mods this time.",
"I've got to escape.", "I've got to escape.",
"I'll find a way out.", "I'll find a way out.",
"I keep forgetting that these are just simulated escapes."
) )
} }
game.makeTextLog(say[Math.floor(say.length * Math.random())], 1000) game.makeTextLog(say[Math.floor(say.length * Math.random())], 1000)
@@ -1930,7 +1933,7 @@ const level = {
spawn.mapRect(-1500, 0, 2750, 100); spawn.mapRect(-1500, 0, 2750, 100);
spawn.mapRect(175, -270, 125, 300); spawn.mapRect(175, -270, 125, 300);
spawn.mapRect(-1900, -600, 1775, 100); spawn.mapRect(-1900, -600, 1775, 100);
spawn.mapRect(-1900, -600, 100, 1300); spawn.mapRect(-1900, -550, 100, 1250);
//house //house
spawn.mapRect(-175, -550, 50, 400); spawn.mapRect(-175, -550, 50, 400);
spawn.mapRect(-175, -10, 350, 50); spawn.mapRect(-175, -10, 350, 50);

View File

@@ -82,18 +82,19 @@ const mod = {
}, },
damageFromMods() { damageFromMods() {
let dmg = mech.fieldDamage let dmg = mech.fieldDamage
// if (mod.aimDamage>1)
if (mod.isEnergyNoAmmo) dmg *= 1.4 if (mod.isEnergyNoAmmo) dmg *= 1.4
if (mod.isDamageForGuns) dmg *= 1 + 0.07 * b.inventory.length if (mod.isDamageForGuns) dmg *= 1 + 0.07 * b.inventory.length
if (mod.isLowHealthDmg) dmg *= 1 + 0.6 * Math.max(0, 1 - mech.health) if (mod.isLowHealthDmg) dmg *= 1 + 0.6 * Math.max(0, 1 - mech.health)
if (mod.isHarmDamage && mech.lastHarmCycle + 600 > mech.cycle) dmg *= 2; if (mod.isHarmDamage && mech.lastHarmCycle + 600 > mech.cycle) dmg *= 2;
if (mod.isEnergyLoss) dmg *= 1.37; if (mod.isEnergyLoss) dmg *= 1.43;
if (mod.isAcidDmg && mech.health > 1) dmg *= 1.4; if (mod.isAcidDmg && mech.health > 1) dmg *= 1.4;
if (mod.restDamage > 1 && player.speed < 1) dmg *= mod.restDamage if (mod.restDamage > 1 && player.speed < 1) dmg *= mod.restDamage
if (mod.isEnergyDamage) dmg *= 1 + mech.energy / 5.5; if (mod.isEnergyDamage) dmg *= 1 + mech.energy / 5.5;
if (mod.isDamageFromBulletCount) dmg *= 1 + bullet.length * 0.0038 if (mod.isDamageFromBulletCount) dmg *= 1 + bullet.length * 0.0038
if (mod.isRerollDamage) dmg *= 1 + 0.05 * powerUps.reroll.rerolls if (mod.isRerollDamage) dmg *= 1 + 0.05 * powerUps.reroll.rerolls
if (mod.isOneGun && b.inventory.length < 2) dmg *= 1.25 if (mod.isOneGun && b.inventory.length < 2) dmg *= 1.25
return dmg * mod.slowFire return dmg * mod.slowFire * mod.aimDamage
}, },
totalBots() { totalBots() {
return mod.foamBotCount + mod.nailBotCount + mod.laserBotCount + mod.boomBotCount + mod.plasmaBotCount return mod.foamBotCount + mod.nailBotCount + mod.laserBotCount + mod.boomBotCount + mod.plasmaBotCount
@@ -147,7 +148,7 @@ const mod = {
}, },
{ {
name: "acute stress response", name: "acute stress response",
description: "increase <strong class='color-d'>damage</strong> by <strong>37%</strong><br>if a mob <strong>dies</strong> drain stored <strong class='color-f'>energy</strong> by <strong>25%</strong>", description: "increase <strong class='color-d'>damage</strong> by <strong>43%</strong><br>if a mob <strong>dies</strong> drain stored <strong class='color-f'>energy</strong> by <strong>25%</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -259,7 +260,7 @@ const mod = {
}, },
{ {
name: "Ψ(t) collapse", name: "Ψ(t) collapse",
description: "<strong>40%</strong> decreased <strong>delay</strong> after firing<br>if you have no <strong class='color-r'>rerolls</strong>", description: "<strong>50%</strong> decreased <strong>delay</strong> after firing<br>if you have no <strong class='color-r'>rerolls</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -268,7 +269,7 @@ const mod = {
requires: "no rerolls", requires: "no rerolls",
effect() { effect() {
mod.isRerollHaste = true; mod.isRerollHaste = true;
mod.rerollHaste = 0.6; mod.rerollHaste = 0.5;
b.setFireCD(); b.setFireCD();
}, },
remove() { remove() {
@@ -798,7 +799,7 @@ const mod = {
}, },
{ {
name: "liquid cooling", name: "liquid cooling",
description: `<strong class='color-s'>freeze</strong> all mobs for <strong>5</strong> seconds<br>after receiving <strong class='color-harm'>harm</strong>`, description: `<strong class='color-s'>freeze</strong> all mobs for <strong>4</strong> seconds<br>after receiving <strong class='color-harm'>harm</strong>`,
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -892,6 +893,51 @@ const mod = {
} }
}, },
{
name: "1st ionization energy",
description: "each <strong class='color-h'>heal</strong> <strong>power up</strong> you collect<br>increases your <strong>maximum</strong> <strong class='color-f'>energy</strong> by <strong>4%<strong>",
maxCount: 1,
count: 0,
allowed() {
return mod.isEnergyHealth
},
requires: "mass-energy equivalence",
effect() {
mod.healGiveMaxEnergy = true; //mod.healMaxEnergyBonus given from heal power up
powerUps.heal.color = "#0ae"
for (let i = 0; i < powerUp.length; i++) { //find active heal power ups and adjust color live
if (powerUp[i].name === "heal") powerUp[i].color = powerUps.heal.color
}
},
remove() {
mod.healGiveMaxEnergy = false;
mod.healMaxEnergyBonus = 0
powerUps.heal.color = "#0eb"
for (let i = 0; i < powerUp.length; i++) { //find active heal power ups and adjust color live
if (powerUp[i].name === "heal") powerUp[i].color = powerUps.heal.color
}
}
},
{
name: "overcharge",
description: "increase your <strong>maximum</strong> <strong class='color-f'>energy</strong> by <strong>50%</strong>",
maxCount: 9,
count: 0,
allowed() {
return true
},
requires: "",
effect() {
// mech.maxEnergy += 0.5
// mech.energy += 0.5
mod.bonusEnergy += 0.5
mech.setMaxEnergy()
},
remove() {
mod.bonusEnergy = 0;
mech.setMaxEnergy()
}
},
{ {
name: "energy conservation", name: "energy conservation",
description: "<strong>10%</strong> of <strong class='color-d'>damage</strong> done recovered as <strong class='color-f'>energy</strong>", description: "<strong>10%</strong> of <strong class='color-d'>damage</strong> done recovered as <strong class='color-f'>energy</strong>",
@@ -908,23 +954,6 @@ const mod = {
mod.energySiphon = 0; mod.energySiphon = 0;
} }
}, },
{
name: "overcharge",
description: "increase your <strong>maximum</strong> <strong class='color-f'>energy</strong> by <strong>50%</strong>",
maxCount: 9,
count: 0,
allowed() {
return true
},
requires: "",
effect() {
mech.maxEnergy += 0.5
mech.energy += 0.5
},
remove() {
mech.maxEnergy = 1;
}
},
{ {
name: "waste energy recovery", name: "waste energy recovery",
description: "if a mob has <strong>died</strong> in the last <strong>5 seconds</strong><br>regen <strong>6%</strong> of max <strong class='color-f'>energy</strong> every second", description: "if a mob has <strong>died</strong> in the last <strong>5 seconds</strong><br>regen <strong>6%</strong> of max <strong class='color-f'>energy</strong> every second",
@@ -943,7 +972,7 @@ const mod = {
}, },
{ {
name: "scrap recycling", name: "scrap recycling",
description: "if a mob has <strong>died</strong> in the last <strong>5 seconds</strong><br><strong class='color-h'>heal</strong> up to <strong>1%</strong> of max health every second", description: "if a mob has <strong>died</strong> in the last <strong>5 seconds</strong><br><strong class='color-h'>heal</strong> <strong>1%</strong> of max health every second",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -1095,9 +1124,48 @@ const mod = {
requires: "", requires: "",
effect: () => { effect: () => {
mod.isBayesian = true mod.isBayesian = true
//change power up draw
game.draw.powerUp = function () {
for (let i = 0, len = powerUp.length; i < len; ++i) {
ctx.globalAlpha = 0.4 * Math.sin(mech.cycle * 0.15) + 0.6;
for (let i = 0, len = powerUp.length; i < len; ++i) {
ctx.beginPath();
ctx.arc(powerUp[i].position.x, powerUp[i].position.y, powerUp[i].size, 0, 2 * Math.PI);
ctx.fillStyle = powerUp[i].color;
ctx.fill();
}
ctx.globalAlpha = 1;
if (powerUp[i].isBayesian && Math.random() < 0.1) {
//draw electricity
const mag = 5 + powerUp[i].size / 5
let unit = Vector.rotate({
x: mag,
y: mag
}, 2 * Math.PI * Math.random())
let path = {
x: powerUp[i].position.x + unit.x,
y: powerUp[i].position.y + unit.y
}
ctx.beginPath();
ctx.moveTo(path.x, path.y);
for (let i = 0; i < 6; i++) {
unit = Vector.rotate(unit, 3 * (Math.random() - 0.5))
path = Vector.add(path, unit)
ctx.lineTo(path.x, path.y);
}
ctx.lineWidth = 0.5 + 2 * Math.random();
ctx.strokeStyle = "#000"
ctx.stroke();
}
}
// ctx.globalAlpha = 1;
}
}, },
remove() { remove() {
mod.isBayesian = false mod.isBayesian = false
game.draw.powerUp = game.draw.powerUpNormal
} }
}, },
{ {
@@ -1234,9 +1302,9 @@ const mod = {
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
return mod.isCrouchAmmo return mod.isCrouchAmmo && !mod.isEnergyHealth
}, },
requires: "desublimated ammunition", requires: "desublimated ammunition<br>not mass-energy equivalence",
effect() { effect() {
mod.isTurret = true mod.isTurret = true
}, },
@@ -1513,7 +1581,7 @@ const mod = {
}, },
{ {
name: "shotgun spin-statistics", name: "shotgun spin-statistics",
description: "<strong>immune</strong> to <strong class='color-harm'>harm</strong> while firing the <strong>shotgun</strong><br>receive <strong>33%</strong> less <strong>shotgun</strong> <strong class='color-g'>ammo</strong>", description: "<strong>immune</strong> to <strong class='color-harm'>harm</strong> while firing the <strong>shotgun</strong><br><strong class='color-g'>ammo</strong> costs are <strong>doubled</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -1522,9 +1590,19 @@ const mod = {
requires: "shotgun", requires: "shotgun",
effect() { effect() {
mod.isShotgunImmune = true; mod.isShotgunImmune = true;
//cut current ammo by 1/2
for (i = 0, len = b.guns.length; i < len; i++) { //find which gun for (i = 0, len = b.guns.length; i < len; i++) { //find which gun
if (b.guns[i].name === "shotgun") { if (b.guns[i].name === "shotgun") {
b.guns[i].ammoPack = b.guns[i].defaultAmmoPack * 0.66 b.guns[i].ammo = Math.ceil(b.guns[i].ammo * 0.5);
break;
}
}
game.updateGunHUD();
for (i = 0, len = b.guns.length; i < len; i++) { //find which gun
if (b.guns[i].name === "shotgun") {
b.guns[i].ammoPack = b.guns[i].defaultAmmoPack * 0.5
break; break;
} }
} }
@@ -1556,7 +1634,7 @@ const mod = {
} }
}, },
{ {
name: "automatic shotgun", name: "Newton's 3rd law",
description: "the <strong>shotgun</strong> fires <strong>66%</strong> faster<br><strong>recoil</strong> is greatly increased", description: "the <strong>shotgun</strong> fires <strong>66%</strong> faster<br><strong>recoil</strong> is greatly increased",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
@@ -1613,7 +1691,7 @@ const mod = {
}, },
requires: "super balls", requires: "super balls",
effect() { effect() {
mod.bulletSize += 0.22 mod.bulletSize += 0.2
}, },
remove() { remove() {
mod.bulletSize = 1; mod.bulletSize = 1;
@@ -1621,7 +1699,7 @@ const mod = {
}, },
{ {
name: "flechettes cartridges", name: "flechettes cartridges",
description: "<strong>flechettes</strong> release <strong>three</strong> needles in each shot<br><strong class='color-g'>ammo</strong> cost are increases by <strong>3x</strong>", description: "<strong>flechettes</strong> release <strong>three</strong> needles in each shot<br><strong class='color-g'>ammo</strong> costs are <strong>tripled</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -2279,7 +2357,7 @@ const mod = {
}, },
{ {
name: "fracture analysis", name: "fracture analysis",
description: "bullet impacts do <strong>500%</strong> <strong class='color-d'>damage</strong><br>to <strong>stunned</strong> mobs", description: "bullet impacts do <strong>400%</strong> <strong class='color-d'>damage</strong><br>to <strong>stunned</strong> mobs",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -2385,7 +2463,7 @@ const mod = {
}, },
{ {
name: "annihilation", name: "annihilation",
description: "after <strong>touching</strong> mobs, they are <strong>annihilated</strong><br>drains <strong>33%</strong> of base <strong class='color-f'>energy</strong>", description: "after <strong>touching</strong> mobs, they are <strong>annihilated</strong><br>drains <strong>33%</strong> of maximum <strong class='color-f'>energy</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -2401,7 +2479,7 @@ const mod = {
}, },
{ {
name: "negative temperature", name: "negative temperature",
description: "<strong>negative mass field</strong> uses <strong class='color-f'>energy</strong><br>to <strong class='color-s'>freeze</strong> mobs caught in it's effect", description: "<strong>negative mass field</strong> uses <strong class='color-f'>energy</strong><br>to <strong class='color-s'>freeze</strong> each mob caught in it's effect",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -2531,8 +2609,8 @@ const mod = {
} }
}, },
{ {
name: "flashbang", name: "dazzler",
description: "<strong class='color-cloaked'>decloaking</strong> <strong>stuns</strong> nearby mobs<br>drains <strong>25%</strong> of your stored <strong class='color-f'>energy</strong>", description: "<strong class='color-cloaked'>decloaking</strong> <strong>stuns</strong> nearby mobs<br>drains <strong>30%</strong> of your stored <strong class='color-f'>energy</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
@@ -2546,6 +2624,24 @@ const mod = {
mod.isCloakStun = false; mod.isCloakStun = false;
} }
}, },
{
name: "discrete optimization",
description: "increase <strong class='color-d'>damage</strong> by <strong>50%</strong><br><strong>50%</strong> increased <strong>delay</strong> after firing",
maxCount: 1,
count: 0,
allowed() {
return mech.fieldUpgrades[mech.fieldMode].name === "metamaterial cloaking"
},
requires: "metamaterial cloaking",
effect() {
mod.aimDamage = 1.5
b.setFireCD();
},
remove() {
mod.aimDamage = 1
b.setFireCD();
}
},
{ {
name: "Bose Einstein condensate", name: "Bose Einstein condensate",
description: "<strong>mobs</strong> in superposition with the <strong>pilot wave</strong><br>are <strong class='color-s'>frozen</strong> for <strong>2</strong> seconds", description: "<strong>mobs</strong> in superposition with the <strong>pilot wave</strong><br>are <strong class='color-s'>frozen</strong> for <strong>2</strong> seconds",
@@ -2784,5 +2880,9 @@ const mod = {
armorFromPowerUps: null, armorFromPowerUps: null,
bonusHealth: null, bonusHealth: null,
isIntangible: null, isIntangible: null,
isCloakStun: null isCloakStun: null,
bonusEnergy: null,
healGiveMaxEnergy: null,
healMaxEnergyBonus: null,
aimDamage: null
} }

View File

@@ -475,6 +475,7 @@ const mech = {
if (mech.health > mech.maxHealth) mech.health = mech.maxHealth; if (mech.health > mech.maxHealth) mech.health = mech.maxHealth;
mech.displayHealth(); mech.displayHealth();
}, },
defaultFPSCycle: 0, //tracks when to return to normal fps defaultFPSCycle: 0, //tracks when to return to normal fps
immuneCycle: 0, //used in engine immuneCycle: 0, //used in engine
harmReduction() { harmReduction() {
@@ -584,7 +585,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], 300) mobs.statusSlow(mob[i], 240)
} }
} }
} else { } else {
@@ -755,6 +756,12 @@ const mech = {
mech.calculateFieldThreshold(); //run calculateFieldThreshold after setting fieldArc, used for powerUp grab and mobPush with lookingAt(mob) mech.calculateFieldThreshold(); //run calculateFieldThreshold after setting fieldArc, used for powerUp grab and mobPush with lookingAt(mob)
mech.isBodiesAsleep = true; mech.isBodiesAsleep = true;
mech.wakeCheck(); mech.wakeCheck();
mech.setMaxEnergy();
},
setMaxEnergy() {
mech.maxEnergy = 1 + mod.bonusEnergy + mod.healMaxEnergyBonus
if (mech.energy > mech.maxEnergy) mech.energy = mech.maxEnergy;
mech.displayHealth();
}, },
fieldMeterColor: "#0cf", fieldMeterColor: "#0cf",
drawFieldMeter(bgColor = "rgba(0, 0, 0, 0.4)", range = 60) { drawFieldMeter(bgColor = "rgba(0, 0, 0, 0.4)", range = 60) {
@@ -1485,7 +1492,7 @@ const mech = {
}); });
} }
if (mod.isFreezeMobs) { if (mod.isFreezeMobs) {
const ICE_DRAIN = 0.0003 const ICE_DRAIN = 0.0005
for (let i = 0, len = mob.length; i < len; i++) { for (let i = 0, len = mob.length; i < len; i++) {
if (mob[i].distanceToPlayer() + mob[i].radius < this.fieldDrawRadius && !mob[i].shield && !mob[i].isShielded) { if (mob[i].distanceToPlayer() + mob[i].radius < this.fieldDrawRadius && !mob[i].shield && !mob[i].isShielded) {
if (mech.energy > ICE_DRAIN * 2) { if (mech.energy > ICE_DRAIN * 2) {
@@ -1815,14 +1822,14 @@ const mech = {
if (mod.isCloakStun) { //stun nearby mobs after exiting cloak if (mod.isCloakStun) { //stun nearby mobs after exiting cloak
let isMobsAround = false let isMobsAround = false
const stunRange = mech.fieldDrawRadius * 1.15 const stunRange = mech.fieldDrawRadius * 1.15
const drain = 0.25 * mech.energy const drain = 0.3 * mech.energy
for (let i = 0, len = mob.length; i < len; ++i) { for (let i = 0, len = mob.length; i < len; ++i) {
if ( if (
Vector.magnitude(Vector.sub(mob[i].position, mech.pos)) < stunRange && Vector.magnitude(Vector.sub(mob[i].position, mech.pos)) < stunRange &&
Matter.Query.ray(map, mob[i].position, mech.pos).length === 0 Matter.Query.ray(map, mob[i].position, mech.pos).length === 0
) { ) {
isMobsAround = true isMobsAround = true
mobs.statusStun(mob[i], drain * 500) mobs.statusStun(mob[i], 30 + drain * 300)
} }
} }
if (isMobsAround && mech.energy > drain) { if (isMobsAround && mech.energy > drain) {
@@ -1831,8 +1838,8 @@ const mech = {
x: mech.pos.x, x: mech.pos.x,
y: mech.pos.y, y: mech.pos.y,
radius: stunRange, radius: stunRange,
color: "hsla(0,50%,100%,0.5)", color: "hsla(0,50%,100%,0.6)",
time: 3 time: 4
}); });
// ctx.beginPath(); // ctx.beginPath();
// ctx.arc(mech.pos.x, mech.pos.y, 800, 0, 2 * Math.PI); // ctx.arc(mech.pos.x, mech.pos.y, 800, 0, 2 * Math.PI);
@@ -1879,9 +1886,9 @@ const mech = {
for (let i = 0; i < inPlayer.length; i++) { for (let i = 0; i < inPlayer.length; i++) {
if (mech.energy > 0) { if (mech.energy > 0) {
if (inPlayer[i].shield) { //shields drain player energy if (inPlayer[i].shield) { //shields drain player energy
mech.energy -= 0.02; mech.energy -= 0.014;
} else { } else {
mech.energy -= 0.007; mech.energy -= 0.004;
} }
} }
} }

View File

@@ -132,6 +132,10 @@ const powerUps = {
mech.addHealth(heal); mech.addHealth(heal);
} }
} }
if (mod.healGiveMaxEnergy) {
mod.healMaxEnergyBonus += 0.04
mech.setMaxEnergy();
}
}, },
spawn() { //used to spawn a heal with a specific size / heal amount, not normally used spawn() { //used to spawn a heal with a specific size / heal amount, not normally used
@@ -507,7 +511,7 @@ const powerUps = {
//bonus power ups for clearing runs in the last game //bonus power ups for clearing runs in the last game
if (level.levelsCleared === 0 && !game.isCheating) { if (level.levelsCleared === 0 && !game.isCheating) {
for (let i = 0; i < localSettings.levelsClearedLastGame / 5 - 1; i++) { for (let i = 0; i < localSettings.levelsClearedLastGame / 4 - 1; i++) {
powerUps.spawn(mech.pos.x, mech.pos.y, "mod", false); //spawn a mod for every 5 levels cleared in last game powerUps.spawn(mech.pos.x, mech.pos.y, "mod", false); //spawn a mod for every 5 levels cleared in last game
} }
localSettings.levelsClearedLastGame = 0 //after getting bonus power ups reset run history localSettings.levelsClearedLastGame = 0 //after getting bonus power ups reset run history
@@ -573,7 +577,10 @@ const powerUps = {
!(mod.isEnergyNoAmmo && target === 'ammo') !(mod.isEnergyNoAmmo && target === 'ammo')
) { ) {
powerUps.directSpawn(x, y, target, moving, mode, size) powerUps.directSpawn(x, y, target, moving, mode, size)
if (mod.isBayesian && Math.random() < 0.17) powerUps.directSpawn(x, y, target, moving, mode) if (mod.isBayesian && Math.random() < 0.17) {
powerUps.directSpawn(x, y, target, moving, mode)
powerUp[powerUp.length - 1].isBayesian = true
}
} }
}, },
}; };

View File

@@ -1,17 +1,40 @@
mod: ionization energy - heal power ups give you 4% max energy
requires mass-energy equivalence
mod: discrete optimization - 50% damage and 50% slow fire rotates
requires cloaking field
************** TODO - n-gon ************** ************** TODO - n-gon **************
exiting cloak gives +100 bonus damage for 2 seconds getting stuck above a mob can immobilize player
+100 dmg while decloaked just allow player to jump on mobs again?
damage mitigation while cloaked occurs with Pauli exclusion, and time dilation field immunity - mod time-like world line
add a knock to player mob collisions even while player is immune to damage
keep the knock very small
Mod to buff mass-energy-equivalence (maybe take no damage some % and do that dmb to a mob)
bug - mine spawned one new mine every second
after sticking to the top right corner of a wall
notes: had only gun mine, mod mine reclamation, field plasma,
add a flag to some bullets to indicate that mobs can't learn the player position from bullet damage in bullet-mob collisions
if isNotRevealPlayerLocation flag is true have the mob still know player location if nearby player
on hide if bullet age is above 4 seconds?
spores
mines
conditions to reveal player from damage?
1. bullet spawned from player
2. bullet is less than 4 seconds old
3. damage is nearby player or in line of sight of player
add some more computer / AI stuff to the level lore text add some more computer / AI stuff to the level lore text
mod - mines stun targets nearby when they explode mod - mines stun targets nearby when they explode
cloaking field mods cloaking field mods
much longer delay in firing, but a very large bonus
larger vision larger vision
return to stealth faster return to stealth faster
+damage to nearby mobs +damage to nearby mobs
@@ -23,11 +46,6 @@ mod - negative mass field intangibility
mod - do something for 2 seconds after firing mod - do something for 2 seconds after firing
if (mech.fireCDcycle + 120) if (mech.fireCDcycle + 120)
getting stuck above a mob can immobilize player
occurs with Pauli exclusion, and time dilation field immunity - mod time-like world line
add a knock to player mob collisions even while player is immune to damage
keep the knock very small
Health mod idea: health can go above max health. At the end of each level, the amount of health above max is halved. Health mod idea: health can go above max health. At the end of each level, the amount of health above max is halved.
general idea: shrink mech.baseHealth in a mod or field general idea: shrink mech.baseHealth in a mod or field