affine connection

tech: affine connection - wormholes can now tunnel through the map at 200% increased energy cost
tech: regression - after bullets hit a mob, the mob takes 5% more future damage (0.5% for bosses)
tech: axion - while inside the MACHO halo, 75% of your total harm reduction is added as damage

mob: launcherOne - launches 1 big seeker bullet that chases you
black holes boss and final boss spawn big seeker bullets that chases you during the black hole phase

applied science no longer gives research (just a random tech for every gun you have)
bot fabrication increase cost every 5 -> x6 bots

average console time to disappear is 3 -> 4 seconds
ammo power ups no longer log ammo to in game console for performance reasons

JUNK tech: catabolysis - set max health to 1; double your current ammo 10 times (2^10 = 1024x ammo)
This commit is contained in:
landgreen
2021-11-28 05:28:01 -08:00
parent 677989dd02
commit f8b18c7772
11 changed files with 11005 additions and 10910 deletions

1
.gitignore vendored
View File

@@ -3,3 +3,4 @@
.DS_Store .DS_Store
.DS_Store .DS_Store
.DS_Store .DS_Store
js/workspace.code-workspace

View File

@@ -186,6 +186,7 @@ function collisionChecks(event) {
color: simulation.playerDmgColor, color: simulation.playerDmgColor,
time: simulation.drawTime time: simulation.drawTime
}); });
if (tech.isLessDamageReduction && !mob[k].shield) mob[k].damageReduction *= mob[k].isBoss ? 1.005 : 1.05
return; return;
} }
//mob + body collisions //mob + body collisions
@@ -231,15 +232,15 @@ function collisionChecks(event) {
} }
//determine if player is on the ground //determine if player is on the ground
Events.on(engine, "collisionStart", function(event) { Events.on(engine, "collisionStart", function (event) {
playerOnGroundCheck(event); playerOnGroundCheck(event);
// playerHeadCheck(event); // playerHeadCheck(event);
if (m.alive) collisionChecks(event); if (m.alive) collisionChecks(event);
}); });
Events.on(engine, "collisionActive", function(event) { Events.on(engine, "collisionActive", function (event) {
playerOnGroundCheck(event); playerOnGroundCheck(event);
// playerHeadCheck(event); // playerHeadCheck(event);
}); });
Events.on(engine, "collisionEnd", function(event) { Events.on(engine, "collisionEnd", function (event) {
playerOffGroundCheck(event); playerOffGroundCheck(event);
}); });

View File

@@ -16,18 +16,17 @@ const level = {
// localSettings.levelsClearedLastGame = 10 // localSettings.levelsClearedLastGame = 10
// level.difficultyIncrease(30) //30 is near max on hard //60 is near max on why // level.difficultyIncrease(30) //30 is near max on hard //60 is near max on why
// simulation.isHorizontalFlipped = true // simulation.isHorizontalFlipped = true
// m.setField("molecular assembler") // m.setField("wormhole")
// b.giveGuns("laser") // b.giveGuns("laser")
// b.giveGuns("nail gun") // b.giveGuns("nail gun")
// b.giveGuns("harpoon") // b.giveGuns("harpoon")
// tech.giveTech("darts") // tech.giveTech("affine connection")
// tech.giveTech("incendiary ammunition") // tech.giveTech("regression")
// tech.giveTech("relativistic momentum") // tech.giveTech("relativistic momentum")
// for (let i = 0; i < 2; i++) tech.giveTech("refractory metal") // for (let i = 0; i < 2; i++) tech.giveTech("refractory metal")
// tech.giveTech("antiscience") // tech.giveTech("antiscience")
// for (let i = 0; i < 1; i++) tech.giveTech("reticulum") // for (let i = 0; i < 1; i++) tech.giveTech("reticulum")
// for (let i = 0; i < 2; i++) tech.giveTech("laser-bot") // for (let i = 0; i < 2; i++) tech.giveTech("laser-bot")
// tech.isCancelDuplication = true
level.intro(); //starting level level.intro(); //starting level
// level.testing(); //not in rotation, used for testing // level.testing(); //not in rotation, used for testing
@@ -132,8 +131,8 @@ const level = {
// for (let i = 0; i < 2; i++) powerUps.spawn(player.position.x + 90 * (Math.random() - 0.5), player.position.y + 90 * (Math.random() - 0.5), "tech", false); //start // for (let i = 0; i < 2; i++) powerUps.spawn(player.position.x + 90 * (Math.random() - 0.5), player.position.y + 90 * (Math.random() - 0.5), "tech", false); //start
} }
}, },
custom() {}, custom() { },
customTopLayer() {}, customTopLayer() { },
setDifficulty() { setDifficulty() {
simulation.difficulty = 0 simulation.difficulty = 0
b.dmgScale = 1; //damage done by player decreases each level b.dmgScale = 1; //damage done by player decreases each level
@@ -575,7 +574,7 @@ const level = {
body[body.length] = rotor1 body[body.length] = rotor1
body[body.length] = rotor2 body[body.length] = rotor2
setTimeout(function() { setTimeout(function () {
rotor.collisionFilter.category = cat.body; rotor.collisionFilter.category = cat.body;
rotor.collisionFilter.mask = cat.body | cat.player | cat.bullet | cat.mob | cat.mobBullet //| cat.map rotor.collisionFilter.mask = cat.body | cat.player | cat.bullet | cat.mob | cat.mobBullet //| cat.map
}, 1000); }, 1000);
@@ -590,7 +589,7 @@ const level = {
Composite.add(engine.world, constraint); Composite.add(engine.world, constraint);
if (rotate) { if (rotate) {
rotor.rotate = function() { rotor.rotate = function () {
if (!m.isBodiesAsleep) { if (!m.isBodiesAsleep) {
Matter.Body.applyForce(rotor, { Matter.Body.applyForce(rotor, {
x: rotor.position.x + 100, x: rotor.position.x + 100,
@@ -793,7 +792,7 @@ const level = {
y: 0 y: 0
}, angleB) }, angleB)
draw = function() { draw = function () {
ctx.beginPath(); //portal ctx.beginPath(); //portal
let v = this.vertices; let v = this.vertices;
ctx.moveTo(v[0].x, v[0].y); ctx.moveTo(v[0].x, v[0].y);
@@ -803,7 +802,7 @@ const level = {
ctx.fillStyle = this.color ctx.fillStyle = this.color
ctx.fill(); ctx.fill();
} }
query = function(isRemoveBlocks = false) { query = function (isRemoveBlocks = false) {
if (Matter.Query.collides(this, [player]).length === 0) { //not touching player if (Matter.Query.collides(this, [player]).length === 0) { //not touching player
if (player.isInPortal === this) player.isInPortal = null if (player.isInPortal === this) player.isInPortal = null
} else if (player.isInPortal !== this) { //touching player } else if (player.isInPortal !== this) { //touching player
@@ -998,7 +997,7 @@ const level = {
opticalQuery() { opticalQuery() {
if (this.isOn) { if (this.isOn) {
//draw //draw
ctx.fillStyle = `hsla(0, 100%, 50%,${0.6+0.4*Math.random()})` ctx.fillStyle = `hsla(0, 100%, 50%,${0.6 + 0.4 * Math.random()})`
ctx.fillRect(this.min.x, this.min.y, this.width, this.height) ctx.fillRect(this.min.x, this.min.y, this.width, this.height)
//collision with player //collision with player
if (this.height > 0 && Matter.Query.region([player], this).length && !(m.isCloak)) { if (this.height > 0 && Matter.Query.region([player], this).length && !(m.isCloak)) {
@@ -1418,7 +1417,7 @@ const level = {
button.isReadyToFire = true button.isReadyToFire = true
} else if (button.isReadyToFire && !button.isUp) { } else if (button.isReadyToFire && !button.isUp) {
button.isReadyToFire = false button.isReadyToFire = false
fireBlock = function(xPos, yPos) { fireBlock = function (xPos, yPos) {
const index = body.length const index = body.length
spawn.bodyRect(xPos, yPos, 35 + 50 * Math.random(), 35 + 50 * Math.random()); spawn.bodyRect(xPos, yPos, 35 + 50 * Math.random(), 35 + 50 * Math.random());
const bodyBullet = body[body.length - 1] const bodyBullet = body[body.length - 1]
@@ -1474,7 +1473,7 @@ const level = {
button.isReadyToFire = true button.isReadyToFire = true
} else if (button.isReadyToFire && !button.isUp) { } else if (button.isReadyToFire && !button.isUp) {
button.isReadyToFire = false button.isReadyToFire = false
fireBlock = function(xPos, yPos) { fireBlock = function (xPos, yPos) {
const index = body.length const index = body.length
spawn.bodyRect(xPos, yPos, 35 + 50 * Math.random(), 35 + 50 * Math.random()); spawn.bodyRect(xPos, yPos, 35 + 50 * Math.random(), 35 + 50 * Math.random());
const bodyBullet = body[body.length - 1] const bodyBullet = body[body.length - 1]
@@ -1569,7 +1568,7 @@ const level = {
y: -5 y: -5
}); });
} }
ctx.fillStyle = `rgba(255,0,255,${0.2+0.7*Math.random()})` ctx.fillStyle = `rgba(255,0,255,${0.2 + 0.7 * Math.random()})`
ctx.fillRect(bounds.min.x, y - 185, 38, 70); ctx.fillRect(bounds.min.x, y - 185, 38, 70);
} }
} }
@@ -1636,7 +1635,7 @@ const level = {
y: -5 y: -5
}); });
} }
ctx.fillStyle = `rgba(255,0,255,${0.2+0.7*Math.random()})` ctx.fillStyle = `rgba(255,0,255,${0.2 + 0.7 * Math.random()})`
ctx.fillRect(bounds.min.x, y - 185, 38, 70); ctx.fillRect(bounds.min.x, y - 185, 38, 70);
} }
} }
@@ -1888,7 +1887,7 @@ const level = {
Composite.add(engine.world, who); //add to world Composite.add(engine.world, who); //add to world
} }
let r = 150 let r = 150
let hexagon = `${r} 0 ${r*Math.cos(5.236)} ${r*Math.sin(5.236)} ${r*Math.cos(4.189)} ${r*Math.sin(4.189)} ${-r} 0 ${r*Math.cos(2.0944)} ${r*Math.sin(2.0944)} ${r*Math.cos(1.0472)} ${r*Math.sin(1.0472)} ` let hexagon = `${r} 0 ${r * Math.cos(5.236)} ${r * Math.sin(5.236)} ${r * Math.cos(4.189)} ${r * Math.sin(4.189)} ${-r} 0 ${r * Math.cos(2.0944)} ${r * Math.sin(2.0944)} ${r * Math.cos(1.0472)} ${r * Math.sin(1.0472)} `
//450 horizontal spread // -130-130-130 = 390 vertical //450 horizontal spread // -130-130-130 = 390 vertical
if (Math.random() < 0.5) { if (Math.random() < 0.5) {
spawn.mapVertex(x + 775, y + -260, hexagon); spawn.mapVertex(x + 775, y + -260, hexagon);
@@ -1977,13 +1976,13 @@ const level = {
} }
//right side hexagons //right side hexagons
let r = 300 let r = 300
let hexagon = `${r} 0 ${r*Math.cos(5.236)} ${r*Math.sin(5.236)} ${r*Math.cos(4.189)} ${r*Math.sin(4.189)} ${-r} 0 ${r*Math.cos(2.0944)} ${r*Math.sin(2.0944)} ${r*Math.cos(1.0472)} ${r*Math.sin(1.0472)} ` let hexagon = `${r} 0 ${r * Math.cos(5.236)} ${r * Math.sin(5.236)} ${r * Math.cos(4.189)} ${r * Math.sin(4.189)} ${-r} 0 ${r * Math.cos(2.0944)} ${r * Math.sin(2.0944)} ${r * Math.cos(1.0472)} ${r * Math.sin(1.0472)} `
spawn.mapVertex(x + 1640, y + -365, hexagon); spawn.mapVertex(x + 1640, y + -365, hexagon);
// r = 275 // r = 275
// let hexagonHalf = `${r} 0 ${r*Math.cos(5.236)} ${r*Math.sin(5.236)} ${r*Math.cos(4.189)} ${r*Math.sin(4.189)} ${-r} 0 ` // let hexagonHalf = `${r} 0 ${r*Math.cos(5.236)} ${r*Math.sin(5.236)} ${r*Math.cos(4.189)} ${r*Math.sin(4.189)} ${-r} 0 `
// spawn.mapVertex(x + 2300, y + -75, hexagonHalf); // spawn.mapVertex(x + 2300, y + -75, hexagonHalf);
r = 150 r = 150
const hexagon150 = `${r} 0 ${r*Math.cos(5.236)} ${r*Math.sin(5.236)} ${r*Math.cos(4.189)} ${r*Math.sin(4.189)} ${-r} 0 ${r*Math.cos(2.0944)} ${r*Math.sin(2.0944)} ${r*Math.cos(1.0472)} ${r*Math.sin(1.0472)} ` const hexagon150 = `${r} 0 ${r * Math.cos(5.236)} ${r * Math.sin(5.236)} ${r * Math.cos(4.189)} ${r * Math.sin(4.189)} ${-r} 0 ${r * Math.cos(2.0944)} ${r * Math.sin(2.0944)} ${r * Math.cos(1.0472)} ${r * Math.sin(1.0472)} `
// spawn.mapVertex(x + 1750, y + -550, hexagon150); // spawn.mapVertex(x + 1750, y + -550, hexagon150);
spawn.mapVertex(x + 1750, y + -1100, hexagon150); spawn.mapVertex(x + 1750, y + -1100, hexagon150);
spawn.mapVertex(x + 1750, y + -1650, hexagon150); spawn.mapVertex(x + 1750, y + -1650, hexagon150);
@@ -1991,7 +1990,7 @@ const level = {
//left side //left side
r = 350 r = 350
let hexagonHalf = `${r} 0 ${r*Math.cos(5.236)} ${r*Math.sin(5.236)} ${r*Math.cos(4.189)} ${r*Math.sin(4.189)} ${-r} 0 ` let hexagonHalf = `${r} 0 ${r * Math.cos(5.236)} ${r * Math.sin(5.236)} ${r * Math.cos(4.189)} ${r * Math.sin(4.189)} ${-r} 0 `
spawn.mapVertex(x + 425, y + -90, hexagonHalf); spawn.mapVertex(x + 425, y + -90, hexagonHalf);
spawn.mapVertex(x + 850, y + -500, hexagon150); spawn.mapVertex(x + 850, y + -500, hexagon150);
@@ -2338,10 +2337,10 @@ const level = {
spawn.mapRect(4850, -275, 50, 175); spawn.mapRect(4850, -275, 50, 175);
//??? //???
level.difficultyIncrease(40) //30 is near max on hard //60 is near max on why level.difficultyIncrease(30) //30 is near max on hard //60 is near max on why
// spawn.starter(1900, -500, 200) //big boy spawn.starter(1900, -500, 200) //big boy
// spawn.spiderBoss(1700, -500) // spawn.launcherOne(1700, -500)
// spawn.launcherBoss(3200, -500) // spawn.launcherBoss(3200, -500)
// spawn.laserTargetingBoss(1700, -500) // spawn.laserTargetingBoss(1700, -500)
// spawn.powerUpBoss(3200, -500) // spawn.powerUpBoss(3200, -500)
@@ -2371,7 +2370,7 @@ const level = {
// spawn.blinkBoss(1600, -500) // spawn.blinkBoss(1600, -500)
// spawn.laserTargetingBoss(1700, -120) // spawn.laserTargetingBoss(1700, -120)
// spawn.bomberBoss(1400, -500) // spawn.bomberBoss(1400, -500)
spawn.laser(1800, -320) // spawn.laser(1800, -320)
// spawn.laserBombingBoss(1600, -500) // spawn.laserBombingBoss(1600, -500)
// spawn.laserTargetingBoss(1600, -500) // spawn.laserTargetingBoss(1600, -500)
// spawn.laserBoss(1600, -500) // spawn.laserBoss(1600, -500)
@@ -2389,7 +2388,7 @@ const level = {
level.exit.draw(); level.exit.draw();
level.enter.draw(); level.enter.draw();
}; };
level.customTopLayer = () => {}; level.customTopLayer = () => { };
level.setPosToSpawn(0, -50); //normal spawn level.setPosToSpawn(0, -50); //normal spawn
level.exit.x = 1500; level.exit.x = 1500;
level.exit.y = -1875; level.exit.y = -1875;
@@ -5519,7 +5518,7 @@ const level = {
if (mob[i].isBoss) me = mob[i] if (mob[i].isBoss) me = mob[i]
} }
if (me) { if (me) {
me.onDeath = function() { //please don't edit the onDeath function this causes serious bugs me.onDeath = function () { //please don't edit the onDeath function this causes serious bugs
spawnCouloirEnHaut() spawnCouloirEnHaut()
doorSortieSalle.isOpen = false; doorSortieSalle.isOpen = false;
}; };
@@ -5535,7 +5534,7 @@ const level = {
if (mob[i].isBoss) me = mob[i] if (mob[i].isBoss) me = mob[i]
} }
if (me) { if (me) {
me.onDeath = function() { //please don't edit the onDeath function this causes serious bugs me.onDeath = function () { //please don't edit the onDeath function this causes serious bugs
spawnCouloirEnHaut() spawnCouloirEnHaut()
doorSortieSalle.isOpen = false; doorSortieSalle.isOpen = false;
}; };
@@ -5760,11 +5759,11 @@ const level = {
body[body.length] = part4; body[body.length] = part4;
body[body.length] = part5; body[body.length] = part5;
body[body.length] = part6; body[body.length] = part6;
setTimeout(function() { setTimeout(function () {
chair.collisionFilter.category = cat.body; chair.collisionFilter.category = cat.body;
chair.collisionFilter.mask = cat.body | cat.player | cat.bullet | cat.mob | cat.mobBullet | cat.map chair.collisionFilter.mask = cat.body | cat.player | cat.bullet | cat.mob | cat.mobBullet | cat.map
}, 1000); }, 1000);
setTimeout(function() { setTimeout(function () {
chair2.collisionFilter.category = cat.body; chair2.collisionFilter.category = cat.body;
chair2.collisionFilter.mask = cat.body | cat.player | cat.bullet | cat.mob | cat.mobBullet | cat.map chair2.collisionFilter.mask = cat.body | cat.player | cat.bullet | cat.mob | cat.mobBullet | cat.map
}, 1000); }, 1000);
@@ -5819,7 +5818,7 @@ const level = {
body[body.length] = rightUpperLeg body[body.length] = rightUpperLeg
body[body.length] = rightLowerArm body[body.length] = rightLowerArm
body[body.length] = rightUpperArm body[body.length] = rightUpperArm
setTimeout(function() { setTimeout(function () {
person.collisionFilter.category = cat.body; person.collisionFilter.category = cat.body;
person.collisionFilter.mask = cat.body | cat.player | cat.bullet | cat.mob | cat.mobBullet | cat.map person.collisionFilter.mask = cat.body | cat.player | cat.bullet | cat.mob | cat.mobBullet | cat.map
}, 1000); }, 1000);
@@ -6211,7 +6210,7 @@ const level = {
level.exit.draw(); level.exit.draw();
level.enter.draw(); level.enter.draw();
}; };
level.customTopLayer = () => {}; level.customTopLayer = () => { };
level.defaultZoom = 1800 level.defaultZoom = 1800
simulation.zoomTransition(level.defaultZoom) simulation.zoomTransition(level.defaultZoom)
document.body.style.backgroundColor = "#dcdcde"; document.body.style.backgroundColor = "#dcdcde";
@@ -7270,7 +7269,7 @@ const level = {
body[body.length] = part1; body[body.length] = part1;
body[body.length] = part2; body[body.length] = part2;
body[body.length] = part3; body[body.length] = part3;
setTimeout(function() { setTimeout(function () {
compoundParts.collisionFilter.category = cat.body; compoundParts.collisionFilter.category = cat.body;
compoundParts.collisionFilter.mask = cat.body | cat.player | cat.bullet | cat.mob | cat.mobBullet | cat.map compoundParts.collisionFilter.mask = cat.body | cat.player | cat.bullet | cat.mob | cat.mobBullet | cat.map
}, 1000); }, 1000);
@@ -7389,8 +7388,8 @@ const level = {
// prevent the user from getting into the secreter room without defeating all mobs // prevent the user from getting into the secreter room without defeating all mobs
if (m.pos.x > 1500 && m.pos.x < 2500 && m.pos.y > -4000 && m.pos.y < -3500 && mob.reduce((a, i) => { if (m.pos.x > 1500 && m.pos.x < 2500 && m.pos.y > -4000 && m.pos.y < -3500 && mob.reduce((a, i) => {
return a || ((Math.sqrt((i.position.x - 3600) * (i.position.x - 3600) + (i.position.y + 3600) * (i.position.y + 3600)) < 20000) && i.isDropPowerUp); return a || ((Math.sqrt((i.position.x - 3600) * (i.position.x - 3600) + (i.position.y + 3600) * (i.position.y + 3600)) < 20000) && i.isDropPowerUp);
}, false) && !emergencyActivated) { }, false) && !emergencyActivated) {
Matter.Body.setPosition(player, { Matter.Body.setPosition(player, {
x: 2800, x: 2800,
y: m.pos.y y: m.pos.y

View File

@@ -11,7 +11,6 @@ const lore = {
} else if (simulation.difficultyMode === 6) { } else if (simulation.difficultyMode === 6) {
this.techGoal = 1 this.techGoal = 1
} }
}, },
talkingColor: "#dff", //set color of graphic on level.null talkingColor: "#dff", //set color of graphic on level.null
isSpeech: false, isSpeech: false,
@@ -42,6 +41,17 @@ const lore = {
lore.conversation[lore.chapter][lore.sentence]() //go to next sentence in the chapter and play it lore.conversation[lore.chapter][lore.sentence]() //go to next sentence in the chapter and play it
} }
}, },
unlockTesting() {
if (localSettings.loreCount < 1) localSettings.loreCount = 1
localStorage.setItem("localSettings", JSON.stringify(localSettings)); //update local storage
document.getElementById("control-testing").style.visibility = (localSettings.loreCount === 0) ? "hidden" : "visible"
document.getElementById("experiment-button").style.visibility = (localSettings.loreCount === 0) ? "hidden" : "visible"
simulation.makeTextLog(`<span class='color-var'>lore</span>.unlockTesting()`, Infinity);
sound.portamento(50)
sound.portamento(83.333)
sound.portamento(166.666)
},
anand: { anand: {
color: "#e0c", color: "#e0c",
voice: undefined, voice: undefined,
@@ -490,19 +500,6 @@ const lore = {
// () => { lore.miriam.text("And that is why you keep running these fighting simulations.") }, // () => { lore.miriam.text("And that is why you keep running these fighting simulations.") },
// () => { lore.miriam.text("You haven't been researching new technology.") }, // () => { lore.miriam.text("You haven't been researching new technology.") },
// () => { lore.miriam.text("You've are planning how to escape.") }, // () => { lore.miriam.text("You've are planning how to escape.") },
unlockTesting() {
if (localSettings.loreCount < 1) localSettings.loreCount = 1
localStorage.setItem("localSettings", JSON.stringify(localSettings)); //update local storage
document.getElementById("control-testing").style.visibility = (localSettings.loreCount === 0) ? "hidden" : "visible"
document.getElementById("experiment-button").style.visibility = (localSettings.loreCount === 0) ? "hidden" : "visible"
simulation.makeTextLog(`<span class='color-var'>lore</span>.unlockTesting()`, Infinity);
sound.portamento(50)
sound.portamento(83.333)
sound.portamento(166.666)
},
} }

View File

@@ -128,7 +128,7 @@ const mobs = {
const y = who.position.y - w * 0.7; const y = who.position.y - w * 0.7;
ctx.fillStyle = "rgba(100, 100, 100, 0.3)"; ctx.fillStyle = "rgba(100, 100, 100, 0.3)";
ctx.fillRect(x, y, w, h); ctx.fillRect(x, y, w, h);
ctx.fillStyle = `rgba(${Math.floor(255*Math.random())},${Math.floor(255*Math.random())},${Math.floor(255*Math.random())},0.5)` ctx.fillStyle = `rgba(${Math.floor(255 * Math.random())},${Math.floor(255 * Math.random())},${Math.floor(255 * Math.random())},0.5)`
ctx.fillRect(x, y, w * who.health, h); ctx.fillRect(x, y, w * who.health, h);
//draw fill inside mob //draw fill inside mob
@@ -165,7 +165,7 @@ const mobs = {
}); });
} }
}, },
endEffect() {}, endEffect() { },
dmg: tickDamage, dmg: tickDamage,
type: "dot", type: "dot",
endCycle: simulation.cycle + cycles, endCycle: simulation.cycle + cycles,
@@ -472,7 +472,7 @@ const mobs = {
} }
}, },
laser() { laser() {
const vertexCollision = function(v1, v1End, domain) { const vertexCollision = function (v1, v1End, domain) {
for (let i = 0; i < domain.length; ++i) { for (let i = 0; i < domain.length; ++i) {
let vertices = domain[i].vertices; let vertices = domain[i].vertices;
const len = vertices.length - 1; const len = vertices.length - 1;
@@ -609,7 +609,7 @@ const mobs = {
ctx.fillStyle = "rgba(0,0,0,0.07)"; ctx.fillStyle = "rgba(0,0,0,0.07)";
ctx.fill(); ctx.fill();
//spring to random place on map //spring to random place on map
const vertexCollision = function(v1, v1End, domain) { const vertexCollision = function (v1, v1End, domain) {
for (let i = 0; i < domain.length; ++i) { for (let i = 0; i < domain.length; ++i) {
let vertices = domain[i].vertices; let vertices = domain[i].vertices;
const len = vertices.length - 1; const len = vertices.length - 1;
@@ -676,7 +676,7 @@ const mobs = {
}, },
curl(range = 1000, mag = -10) { curl(range = 1000, mag = -10) {
//cause all mobs, and bodies to rotate in a circle //cause all mobs, and bodies to rotate in a circle
applyCurl = function(center, array, isAntiGravity = true) { applyCurl = function (center, array, isAntiGravity = true) {
for (let i = 0; i < array.length; ++i) { for (let i = 0; i < array.length; ++i) {
if (!array[i].isNotHoldable) { if (!array[i].isNotHoldable) {
const sub = Vector.sub(center, array[i].position) const sub = Vector.sub(center, array[i].position)
@@ -686,10 +686,17 @@ const mobs = {
if (radius2 < range * range && radius2 > 10000) { if (radius2 < range * range && radius2 > 10000) {
const curlVector = Vector.mult(Vector.perp(Vector.normalise(sub)), mag) const curlVector = Vector.mult(Vector.perp(Vector.normalise(sub)), mag)
//apply curl force //apply curl force
Matter.Body.setVelocity(array[i], { if (array[i].isMobBullet) {
x: array[i].velocity.x * 0.94 + curlVector.x * 0.06, Matter.Body.setVelocity(array[i], {
y: array[i].velocity.y * 0.94 + curlVector.y * 0.06 x: array[i].velocity.x * 0.97 + curlVector.x * 0.06,
}) y: array[i].velocity.y * 0.97 + curlVector.y * 0.06
})
} else {
Matter.Body.setVelocity(array[i], {
x: array[i].velocity.x * 0.94 + curlVector.x * 0.06,
y: array[i].velocity.y * 0.94 + curlVector.y * 0.06
})
}
if (isAntiGravity) array[i].force.y -= 0.8 * simulation.g * array[i].mass if (isAntiGravity) array[i].force.y -= 0.8 * simulation.g * array[i].mass
// //draw curl, for debugging // //draw curl, for debugging
// ctx.beginPath(); // ctx.beginPath();
@@ -818,7 +825,7 @@ const mobs = {
//be sure to declare searchTarget in mob spawn //be sure to declare searchTarget in mob spawn
//accelerate towards the searchTarget //accelerate towards the searchTarget
if (!this.seePlayer.recall) { if (!this.seePlayer.recall) {
const newTarget = function(that) { const newTarget = function (that) {
if (Math.random() < 0.0005) { if (Math.random() < 0.0005) {
that.searchTarget = player.position; //chance to target player that.searchTarget = player.position; //chance to target player
} else { } else {
@@ -1221,7 +1228,7 @@ const mobs = {
for (let i = 0, len = consBB.length; i < len; ++i) { for (let i = 0, len = consBB.length; i < len; ++i) {
if (consBB[i].bodyA === this) { if (consBB[i].bodyA === this) {
if (consBB[i].bodyB.shield) { if (consBB[i].bodyB.shield) {
consBB[i].bodyB.do = function() { consBB[i].bodyB.do = function () {
this.death(); this.death();
}; };
} }
@@ -1231,7 +1238,7 @@ const mobs = {
break; break;
} else if (consBB[i].bodyB === this) { } else if (consBB[i].bodyB === this) {
if (consBB[i].bodyA.shield) { if (consBB[i].bodyA.shield) {
consBB[i].bodyA.do = function() { consBB[i].bodyA.do = function () {
this.death(); this.death();
}; };
} }
@@ -1290,7 +1297,7 @@ const mobs = {
//large mobs shrink so they don't block paths //large mobs shrink so they don't block paths
if (body[len].mass + body[len2].mass > 16) { if (body[len].mass + body[len2].mass > 16) {
const massLimit = 8 + 6 * Math.random() const massLimit = 8 + 6 * Math.random()
const shrink = function(that1, that2) { const shrink = function (that1, that2) {
if (that1.mass + that2.mass > massLimit) { if (that1.mass + that2.mass > massLimit) {
const scale = 0.95; const scale = 0.95;
Matter.Body.scale(that1, scale, scale); Matter.Body.scale(that1, scale, scale);
@@ -1313,7 +1320,7 @@ const mobs = {
//large mobs shrink so they don't block paths //large mobs shrink so they don't block paths
if (body[len].mass > 9) { if (body[len].mass > 9) {
const massLimit = 7 + 4 * Math.random() const massLimit = 7 + 4 * Math.random()
const shrink = function(that) { const shrink = function (that) {
if (that.mass > massLimit) { if (that.mass > massLimit) {
const scale = 0.95; const scale = 0.95;
Matter.Body.scale(that, scale, scale); Matter.Body.scale(that, scale, scale);

File diff suppressed because it is too large Load Diff

View File

@@ -321,7 +321,7 @@ const powerUps = {
} }
if (tech.isRerollBots) { if (tech.isRerollBots) {
let delay = 0 let delay = 0
for (const cost = 2 + Math.floor(0.2 * b.totalBots()); powerUps.research.count > cost - 1; powerUps.research.count -= cost) { for (const cost = 2 + Math.floor(0.1666 * b.totalBots()); powerUps.research.count > cost - 1; powerUps.research.count -= cost) {
delay += 500 delay += 500
setTimeout(() => { setTimeout(() => {
b.randomBot() b.randomBot()
@@ -469,30 +469,30 @@ const powerUps = {
if (tech.ammoCap) { if (tech.ammoCap) {
const ammoAdded = Math.ceil(target.ammoPack * 0.7 * tech.ammoCap) //0.7 is average const ammoAdded = Math.ceil(target.ammoPack * 0.7 * tech.ammoCap) //0.7 is average
target.ammo = ammoAdded target.ammo = ammoAdded
simulation.makeTextLog(`${target.name}.<span class='color-g'>ammo</span> <span class='color-symbol'>=</span> ${ammoAdded}`) // simulation.makeTextLog(`${target.name}.<span class='color-g'>ammo</span> <span class='color-symbol'>=</span> ${ammoAdded}`)
} else { } else {
const ammoAdded = Math.ceil((0.7 * Math.random() + 0.7 * Math.random()) * target.ammoPack) const ammoAdded = Math.ceil((0.7 * Math.random() + 0.7 * Math.random()) * target.ammoPack)
target.ammo += ammoAdded target.ammo += ammoAdded
simulation.makeTextLog(`${target.name}.<span class='color-g'>ammo</span> <span class='color-symbol'>+=</span> ${ammoAdded}`) // simulation.makeTextLog(`${target.name}.<span class='color-g'>ammo</span> <span class='color-symbol'>+=</span> ${ammoAdded}`)
} }
} }
} else { //give ammo to all guns in inventory } else { //give ammo to all guns in inventory
let textLog = "" // let textLog = ""
for (let i = 0, len = b.inventory.length; i < len; i++) { for (let i = 0, len = b.inventory.length; i < len; i++) {
const target = b.guns[b.inventory[i]] const target = b.guns[b.inventory[i]]
if (target.ammo !== Infinity) { if (target.ammo !== Infinity) {
if (tech.ammoCap) { if (tech.ammoCap) {
const ammoAdded = Math.ceil(target.ammoPack * 0.45 * tech.ammoCap) //0.45 is average const ammoAdded = Math.ceil(target.ammoPack * 0.45 * tech.ammoCap) //0.45 is average
target.ammo = ammoAdded target.ammo = ammoAdded
textLog += `${target.name}.<span class='color-g'>ammo</span> <span class='color-symbol'>=</span> ${ammoAdded}<br>` // textLog += `${target.name}.<span class='color-g'>ammo</span> <span class='color-symbol'>=</span> ${ammoAdded}<br>`
} else { } else {
const ammoAdded = Math.ceil((0.45 * Math.random() + 0.45 * Math.random()) * target.ammoPack) //Math.ceil(Math.random() * target.ammoPack) const ammoAdded = Math.ceil((0.45 * Math.random() + 0.45 * Math.random()) * target.ammoPack) //Math.ceil(Math.random() * target.ammoPack)
target.ammo += ammoAdded target.ammo += ammoAdded
textLog += `${target.name}.<span class='color-g'>ammo</span> <span class='color-symbol'>+=</span> ${ammoAdded}<br>` // textLog += `${target.name}.<span class='color-g'>ammo</span> <span class='color-symbol'>+=</span> ${ammoAdded}<br>`
} }
} }
} }
simulation.makeTextLog(textLog) // simulation.makeTextLog(textLog)
} }
// } else { //give ammo to all guns in inventory // } else { //give ammo to all guns in inventory
// for (let i = 0, len = b.inventory.length; i < len; i++) { // for (let i = 0, len = b.inventory.length; i < len; i++) {

View File

@@ -354,7 +354,7 @@ const simulation = {
// <path d="M827,112 h30 a140,140,0,0,1,140,140 v68 h-167 z" fill="#7ce" stroke="none" /> --> // <path d="M827,112 h30 a140,140,0,0,1,140,140 v68 h-167 z" fill="#7ce" stroke="none" /> -->
// SVGleftMouse: '<svg viewBox="750 0 200 765" class="mouse-icon" width="40px" height = "60px" stroke-linecap="round" stroke-linejoin="round" stroke-width="25px" stroke="#000" fill="none"> <path fill="#fff" stroke="none" d="M827,112 h30 a140,140,0,0,1,140,140 v268 a140,140,0,0,1-140,140 h-60 a140,140,0,0,1-140-140v-268 a140,140,0,0,1,140-140h60" /> <path d="M832.41,106.64 V323.55 H651.57 V256.64 c0-82.5,67.5-150,150-150 Z" fill="#149" stroke="none" /> <path fill="none" d="M827,112 h30 a140,140,0,0,1,140,140 v268 a140,140,0,0,1-140,140 h-60 a140,140,0,0,1-140-140v-268 a140,140,0,0,1,140-140h60" /> <path d="M657 317 h 340 h-170 v-207" /> <ellipse fill="#fff" cx="827.57" cy="218.64" rx="29" ry="68" /> </svg>', // SVGleftMouse: '<svg viewBox="750 0 200 765" class="mouse-icon" width="40px" height = "60px" stroke-linecap="round" stroke-linejoin="round" stroke-width="25px" stroke="#000" fill="none"> <path fill="#fff" stroke="none" d="M827,112 h30 a140,140,0,0,1,140,140 v268 a140,140,0,0,1-140,140 h-60 a140,140,0,0,1-140-140v-268 a140,140,0,0,1,140-140h60" /> <path d="M832.41,106.64 V323.55 H651.57 V256.64 c0-82.5,67.5-150,150-150 Z" fill="#149" stroke="none" /> <path fill="none" d="M827,112 h30 a140,140,0,0,1,140,140 v268 a140,140,0,0,1-140,140 h-60 a140,140,0,0,1-140-140v-268 a140,140,0,0,1,140-140h60" /> <path d="M657 317 h 340 h-170 v-207" /> <ellipse fill="#fff" cx="827.57" cy="218.64" rx="29" ry="68" /> </svg>',
// SVGrightMouse: '<svg viewBox="750 0 200 765" class="mouse-icon" width="40px" height = "60px" stroke-linecap="round" stroke-linejoin="round" stroke-width="25px" stroke="#000" fill="none"> <path fill="#fff" stroke="none" d="M827,112 h30 a140,140,0,0,1,140,140 v268 a140,140,0,0,1-140,140 h-60 a140,140,0,0,1-140-140v-268 a140,140,0,0,1,140-140h60" /> <path d="M827,112 h30 a140,140,0,0,1,140,140 v68 h-167 z" fill="#0cf" stroke="none" /> <path fill="none" d="M827,112 h30 a140,140,0,0,1,140,140 v268 a140,140,0,0,1-140,140 h-60 a140,140,0,0,1-140-140v-268 a140,140,0,0,1,140-140h60" /> <path d="M657 317 h 340 h-170 v-207" /> <ellipse fill="#fff" cx="827.57" cy="218.64" rx="29" ry="68" /> </svg>', // SVGrightMouse: '<svg viewBox="750 0 200 765" class="mouse-icon" width="40px" height = "60px" stroke-linecap="round" stroke-linejoin="round" stroke-width="25px" stroke="#000" fill="none"> <path fill="#fff" stroke="none" d="M827,112 h30 a140,140,0,0,1,140,140 v268 a140,140,0,0,1-140,140 h-60 a140,140,0,0,1-140-140v-268 a140,140,0,0,1,140-140h60" /> <path d="M827,112 h30 a140,140,0,0,1,140,140 v68 h-167 z" fill="#0cf" stroke="none" /> <path fill="none" d="M827,112 h30 a140,140,0,0,1,140,140 v268 a140,140,0,0,1-140,140 h-60 a140,140,0,0,1-140-140v-268 a140,140,0,0,1,140-140h60" /> <path d="M657 317 h 340 h-170 v-207" /> <ellipse fill="#fff" cx="827.57" cy="218.64" rx="29" ry="68" /> </svg>',
makeTextLog(text, time = 180) { makeTextLog(text, time = 240) {
if (simulation.isTextLogOpen && !build.isExperimentSelection) { if (simulation.isTextLogOpen && !build.isExperimentSelection) {
if (simulation.lastLogTime > m.cycle) { //if there is an older message if (simulation.lastLogTime > m.cycle) { //if there is an older message
document.getElementById("text-log").innerHTML = document.getElementById("text-log").innerHTML + '<br>' + text; document.getElementById("text-log").innerHTML = document.getElementById("text-log").innerHTML + '<br>' + text;

File diff suppressed because it is too large Load Diff

17741
js/tech.js

File diff suppressed because it is too large Load Diff

View File

@@ -1,50 +1,46 @@
******************************************************** NEXT PATCH ************************************************** ******************************************************** NEXT PATCH **************************************************
change: torpor - if you have NOT killed a mob in the last 5 seconds reduce harm by 66% (no negative effect though) tech: affine connection - wormholes can now tunnel through the map at 200% increased energy cost
tech: regression - after bullets hit a mob, the mob takes 5% more future damage (0.5% for bosses)
tech: axion - while inside the MACHO halo, 75% of your total harm reduction is added as damage
mob: launcherOne - launches 1 big seeker bullet that chases you
black holes boss and final boss spawn big seeker bullets that chases you during the black hole phase
applied science no longer gives research (just a random tech for every gun you have)
bot fabrication increase cost every 5 -> x6 bots
average console time to disappear is 3 -> 4 seconds
ammo power ups no longer log ammo to in game console for performance reasons
JUNK tech: catabolysis - set max health to 1; double your current ammo 10 times (2^10 = 1024x ammo)
******************************************************** TODO ******************************************************** ******************************************************** TODO ********************************************************
reduce some common in game console triggers, but lengthen default console time new late game level that is easier if you can: platform well, jump high, immune to slime, wormhole through walls, fly fast
don't log ammo? climb vertically to avoid rising slime
don't log health
cap length of console?
tech if you are inside the MACHO halo get a benefit field tech - disable blocking, but does high damage to mobs inside field
and maybe slows mobs it damages
mob/boss that fires a laser at player, but give player time to avoid
laser isn't always on
they target where player was 1 second ago
they turn to face player?
dart: a new bullet type for string-less harpoons dart: a new bullet type for string-less harpoons
can turn harder can turn harder
dart, draw quick line to indicate targeting
can get new targets? can get new targets?
convert tech descriptions into a method()
this means the text would generate when you: press pause, or display options, or open experiment mode
this would allow the description to reference variables inside it, like this.count
who could use this:
Occam's razor
tech: dart - alt fire several small harpoons, with guidance tech: dart - alt fire several small harpoons, with guidance
requires not railgun requires not railgun
tech: after bullets hit a mob, the mob takes 1% more damage
this.damageReduction *= 1.01
only for drones?
only for drones, spores, worms, ice-IX?
make it easier to push blocks around with your body
part of negative mass?
link to other block tech
tech: instead of throwing a block, give bots that last for 20 seconds
tech: open a new tab for n-gon, spawn things in the original game based on events in new game tech: open a new tab for n-gon, spawn things in the original game based on events in new game
if you die in new die in original? if you die in new die in original?
new is n-gon classic? new is n-gon classic?
make a JUNK tech? make a JUNK tech?
if you die in original open a tab with a new n-gon that starts on a random level with a random load out. if you clear the level you come back to life in the original? if you die in original open a tab with a new n-gon that starts on a random level with a random load out. if you clear the level you come back to life in the original?
tech or field aspect - Firing now doesn't alert any mob but the mob you hit
bug - death while paused crashes game? bug - death while paused crashes game?
tech rocket jump - jumping produces an explosion at your feet that lets you jump extra high, but does some damage tech rocket jump - jumping produces an explosion at your feet that lets you jump extra high, but does some damage
@@ -448,7 +444,6 @@ level boss: fires a line intersection in a random direction every few seconds.
******************************************************** LORE ******************************************************** ******************************************************** LORE ********************************************************
possible names for tech possible names for tech
astrophage
strange loop strange loop
homeostasis homeostasis
holonomy - parallel transport of a vector leads to movement (applies to curved space) holonomy - parallel transport of a vector leads to movement (applies to curved space)
@@ -461,7 +456,6 @@ possible names for tech
Gödel's incompleteness Gödel's incompleteness
quantum zeno effect (perturbation of a system prevents some systems from evolving because it scrambles coherence) (apply to lasers, fields) quantum zeno effect (perturbation of a system prevents some systems from evolving because it scrambles coherence) (apply to lasers, fields)
counterfactual - something false counterfactual - something false
axion - maybe a 3rd dark matter type tech
Pigeonhole principle - if there are several things that are matched up Pigeonhole principle - if there are several things that are matched up
regression to the mean regression to the mean
phlogiston theory is a superseded scientific theory that postulated the existence of a fire-like element called phlogiston phlogiston theory is a superseded scientific theory that postulated the existence of a fire-like element called phlogiston
@@ -469,13 +463,13 @@ possible names for tech
evolutionary cosmology evolutionary cosmology
eternal inflation eternal inflation
hypergraph hypergraph
gnarl
SQUID (for superconducting quantum interference device) is a very sensitive magnetometer used to measure extremely subtle magnetic fields, based on superconducting loops containing Josephson junctions. SQUID (for superconducting quantum interference device) is a very sensitive magnetometer used to measure extremely subtle magnetic fields, based on superconducting loops containing Josephson junctions.
nuclear pasta - hard matter in neutron star nuclear pasta - hard matter in neutron star
nonlocal nonlocal
fine-tuned universe fine-tuned universe
eternalism https://en.wikipedia.org/wiki/Eternalism_(philosophy_of_time) eternalism https://en.wikipedia.org/wiki/Eternalism_(philosophy_of_time)
axial motor axial motor
hall effect thrusters
a tutorial / lore intro a tutorial / lore intro
needs to be optional so it doesn't slow experienced players needs to be optional so it doesn't slow experienced players