hammer + nail

pneumatic hammer (20 -> +18% size and damage effects)
  now applies to nails, slugs, needles, in addition to rivets
integrated armament 20->25% damage, also if you switch guns converts guntech to new gun
backward induction removed
symbiosis removes 1 -> 0.5 max health per mob kill
plasma jet - costs 1 -> 2 research, and goes a bit farther
Occam's razor gives 36 -> 40% damage per removed tech
This commit is contained in:
landgreen
2021-12-01 19:22:06 -08:00
parent f8b18c7772
commit 66025c14e2
9 changed files with 10187 additions and 10100 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@@ -157,6 +157,39 @@ const b = {
}
simulation.makeGunHUD();
b.setFireCD();
if (tech.isOneGun && b.inventory > 0) {
//count how many gun tech you have and remove them
let gunTechCount = 0 //2 bonus gun tech
for (let i = 0, len = tech.tech.length; i < len; i++) {
if (tech.tech[i].isGunTech && tech.tech[i].count > 0 && !tech.tech[i].isNonRefundable && !tech.tech[i].isRemoveGun) {
const remove = tech.removeTech(i)
// console.log(remove, tech.tech[i].count, tech.tech[i].name)
gunTechCount += remove
}
}
// console.log(gunTechCount)
//get a random gun tech for your gun
for (let i = 0; i < gunTechCount; i++) {
const gunTechPool = []
for (let j = 0, len = tech.tech.length; j < len; j++) {
if (tech.tech[j].isGunTech && tech.tech[j].allowed() && !tech.tech[i].isRemoveGun && !tech.tech[j].isJunk && !tech.tech[j].isBadRandomOption && tech.tech[j].count < tech.tech[j].maxCount) {
const regex = tech.tech[j].requires.search(b.guns[b.activeGun].name) //get string index of gun name
const not = tech.tech[j].requires.search(' not ') //get string index of ' not '
//look for the gun name in the requirements, but the gun name needs to show up before the word ' not '
if (regex !== -1 && (not === -1 || not > regex)) gunTechPool.push(j)
}
}
if (gunTechPool.length) {
const index = Math.floor(Math.random() * gunTechPool.length)
tech.giveTech(gunTechPool[index]) // choose from the gun pool
simulation.makeTextLog(`<span class='color-var'>tech</span>.giveTech("<span class='color-text'>${tech.tech[gunTechPool[index]].name}</span>")`)
} else {
tech.giveTech() //get normal tech if you can't find any gun tech
}
}
}
},
removeGun(gun, isRemoveSelection = false) {
for (let i = 0; i < b.guns.length; i++) {
@@ -1111,7 +1144,7 @@ const b = {
b.guns[gunIndex].do = function() {}
} else {
if (gunIndex) b.guns[gunIndex].do = function() {
if (!input.field) {
if (!input.field && input.down) {
const cycles = 80
const speed = input.down ? 35 : 20 //input.down ? 43 : 32
const g = input.down ? 0.137 : 0.135
@@ -1137,7 +1170,7 @@ const b = {
} else if (tech.isVacuumBomb) {
b.grenade = grenadeVacuum
if (gunIndex) b.guns[gunIndex].do = function() {
if (!input.field) {
if (!input.field && input.down) {
const cycles = Math.floor(input.down ? 50 : 30) //30
const speed = input.down ? 44 : 35
const v = { x: speed * Math.cos(m.angle), y: speed * Math.sin(m.angle) }
@@ -1154,7 +1187,7 @@ const b = {
} else {
b.grenade = grenadeDefault
if (gunIndex) b.guns[gunIndex].do = function() {
if (!input.field) {
if (!input.field && input.down) {
const cycles = Math.floor(input.down ? 120 : 80) //30
const speed = input.down ? 43 : 32
const v = { x: speed * Math.cos(m.angle), y: speed * Math.sin(m.angle) } //m.Vy / 2 + removed to make the path less jerky
@@ -1738,7 +1771,7 @@ const b = {
m.energy = 0;
}
b.isExtruderOn = true
const SPEED = 8 + 8 * tech.isPlasmaRange
const SPEED = 8 + 12 * tech.isPlasmaRange
const me = bullet.length;
const where = Vector.add(m.pos, player.velocity)
bullet[me] = Bodies.polygon(where.x + 20 * Math.cos(m.angle), where.y + 20 * Math.sin(m.angle), 4, 0.01, {
@@ -3253,8 +3286,9 @@ const b = {
}
},
nail(pos, velocity, dmg = 1) {
dmg *= tech.nailSize
const me = bullet.length;
bullet[me] = Bodies.rectangle(pos.x, pos.y, 25, 2, b.fireAttributes(Math.atan2(velocity.y, velocity.x)));
bullet[me] = Bodies.rectangle(pos.x, pos.y, 25 * tech.nailSize, 2 * tech.nailSize, b.fireAttributes(Math.atan2(velocity.y, velocity.x)));
Matter.Body.setVelocity(bullet[me], velocity);
Composite.add(engine.world, bullet[me]); //add bullet to world
bullet[me].endCycle = simulation.cycle + 60 + 18 * Math.random();
@@ -3269,7 +3303,7 @@ const b = {
},
needle(angle = m.angle) {
const me = bullet.length;
bullet[me] = Bodies.rectangle(m.pos.x + 40 * Math.cos(m.angle), m.pos.y + 40 * Math.sin(m.angle), 75, 0.75, b.fireAttributes(angle));
bullet[me] = Bodies.rectangle(m.pos.x + 40 * Math.cos(m.angle), m.pos.y + 40 * Math.sin(m.angle), 75 * tech.nailSize, 0.75 * tech.nailSize, b.fireAttributes(angle));
bullet[me].collisionFilter.mask = tech.isShieldPierce ? cat.body : cat.body | cat.mobShield
Matter.Body.setDensity(bullet[me], 0.00001); //0.001 is normal
bullet[me].endCycle = simulation.cycle + 100;
@@ -3289,12 +3323,12 @@ const b = {
}
if (!immune) {
if (tech.isNailCrit && !who.shield && Vector.dot(Vector.normalise(Vector.sub(who.position, this.position)), Vector.normalise(this.velocity)) > 0.94) {
b.explosion(this.position, 220 + 50 * Math.random()); //makes bullet do explosive damage at end
b.explosion(this.position, 220 * tech.nailSize + 50 * Math.random()); //makes bullet do explosive damage at end
}
this.immuneList.push(who.id) //remember that this needle has hit this mob once already
let dmg = b.dmgScale * 6
let dmg = b.dmgScale * 6 * tech.nailSize
if (tech.isNailRadiation) {
mobs.statusDoT(who, tech.isFastRadiation ? 6 : 2, tech.isSlowRadiation ? 360 : (tech.isFastRadiation ? 60 : 180)) // one tick every 30 cycles
mobs.statusDoT(who, (tech.isFastRadiation ? 6 : 2) * tech.nailSize, tech.isSlowRadiation ? 360 : (tech.isFastRadiation ? 60 : 180)) // one tick every 30 cycles
dmg *= 0.25
}
if (tech.isCrit && who.isStunned) dmg *= 4
@@ -4364,7 +4398,7 @@ const b = {
m.fireCDcycle = m.cycle + Math.floor((input.down ? 25 : 17) * b.fireCDscale); // cool down
const me = bullet.length;
const size = tech.rivetSize * 8
const size = tech.nailSize * 8
bullet[me] = Bodies.rectangle(m.pos.x + 35 * Math.cos(m.angle), m.pos.y + 35 * Math.sin(m.angle), 5 * size, size, b.fireAttributes(m.angle));
bullet[me].dmg = tech.isNailRadiation ? 0 : 2.75
Matter.Body.setDensity(bullet[me], 0.002);
@@ -4427,7 +4461,7 @@ const b = {
m.fireCDcycle = m.cycle + Math.floor(CD * b.fireCDscale); // cool down
const me = bullet.length;
const size = tech.rivetSize * 8
const size = tech.nailSize * 8
bullet[me] = Bodies.rectangle(m.pos.x + 35 * Math.cos(m.angle), m.pos.y + 35 * Math.sin(m.angle), 5 * size, size, b.fireAttributes(m.angle));
bullet[me].dmg = tech.isNailRadiation ? 0 : 2.75
Matter.Body.setDensity(bullet[me], 0.002);
@@ -4557,15 +4591,15 @@ const b = {
if (tech.isSlugShot) {
const me = bullet.length;
const dir = m.angle + 0.02 * (Math.random() - 0.5)
bullet[me] = Bodies.rectangle(m.pos.x + 35 * Math.cos(m.angle), m.pos.y + 35 * Math.sin(m.angle), 60, 27, b.fireAttributes(dir));
// const dir = m.angle + 0.02 * (Math.random() - 0.5)
bullet[me] = Bodies.rectangle(m.pos.x + 35 * Math.cos(m.angle), m.pos.y + 35 * Math.sin(m.angle), 60 * tech.nailSize, 27 * tech.nailSize, b.fireAttributes(m.angle));
Matter.Body.setDensity(bullet[me], 0.007 * (tech.isShotgunReversed ? 1.6 : 1));
Composite.add(engine.world, bullet[me]); //add bullet to world
const SPEED = (input.down ? 45 : 35) + Math.random() * 6
const SPEED = (input.down ? 50 : 37)
Matter.Body.setVelocity(bullet[me], {
x: SPEED * Math.cos(dir),
y: SPEED * Math.sin(dir)
x: SPEED * Math.cos(m.angle),
y: SPEED * Math.sin(m.angle)
});
if (tech.isIncendiary) {
bullet[me].endCycle = simulation.cycle + 60
@@ -4581,27 +4615,22 @@ const b = {
bullet[me].minDmgSpeed = 7
// bullet[me].restitution = 0.4
bullet[me].frictionAir = 0.006;
bullet[me].turnMag = 0.04 * Math.pow(tech.nailSize, 3.75)
bullet[me].do = function() {
this.force.y += this.mass * 0.0022
//rotates bullet to face current velocity?
if (this.speed > 6) {
const facing = {
x: Math.cos(this.angle),
y: Math.sin(this.angle)
}
const mag = 0.04
if (this.speed > 6) { //rotates bullet to face current velocity?
const facing = { x: Math.cos(this.angle), y: Math.sin(this.angle) }
if (Vector.cross(Vector.normalise(this.velocity), facing) < 0) {
this.torque += mag
this.torque += this.turnMag
} else {
this.torque -= mag
this.torque -= this.turnMag
}
}
};
if (tech.fragments) {
bullet[me].beforeDmg = function() {
if (this.speed > 4) {
b.targetedNail(this.position, tech.fragments * 7)
b.targetedNail(this.position, 7 * tech.fragments * tech.nailSize)
this.endCycle = 0 //triggers despawn
}
}
@@ -6507,47 +6536,47 @@ const b = {
// },
},
],
gunRewind: { //this gun is added with a tech
name: "CPT gun",
description: "use <strong class='color-f'>energy</strong> to <strong>rewind</strong> your <strong class='color-h'>health</strong>, <strong>velocity</strong>,<br> and <strong>position</strong> up to <strong>10</strong> seconds",
ammo: 0,
ammoPack: Infinity,
have: false,
isRewinding: false,
lastFireCycle: 0,
holdCount: 0,
activeGunIndex: null,
do() {},
fire() {
if (this.lastFireCycle === m.cycle - 1) { //button has been held down
this.rewindCount += 8;
const DRAIN = 0.01
let history = m.history[(m.cycle - this.rewindCount) % 600]
if (this.rewindCount > 599 || m.energy < DRAIN || history.activeGun !== this.activeGunIndex) {
this.rewindCount = 0;
m.resetHistory();
m.fireCDcycle = m.cycle + Math.floor(120 * b.fireCDscale); // cool down
} else {
m.energy -= DRAIN
if (m.immuneCycle < m.cycle + 30) m.immuneCycle = m.cycle + 30; //player is immune to damage for 5 cycles
Matter.Body.setPosition(player, history.position);
Matter.Body.setVelocity(player, { x: history.velocity.x, y: history.velocity.y });
if (m.health !== history.health) {
m.health = history.health
m.displayHealth();
}
m.yOff = history.yOff
if (m.yOff < 48) {
m.doCrouch()
} else {
m.undoCrouch()
}
}
} else { //button is held the first time
this.rewindCount = 0;
this.activeGunIndex = b.activeGun
}
this.lastFireCycle = m.cycle;
}
}
// gunRewind: { //this gun is added with a tech
// name: "CPT gun",
// description: "use <strong class='color-f'>energy</strong> to <strong>rewind</strong> your <strong class='color-h'>health</strong>, <strong>velocity</strong>,<br> and <strong>position</strong> up to <strong>10</strong> seconds",
// ammo: 0,
// ammoPack: Infinity,
// have: false,
// isRewinding: false,
// lastFireCycle: 0,
// holdCount: 0,
// activeGunIndex: null,
// do() {},
// fire() {
// if (this.lastFireCycle === m.cycle - 1) { //button has been held down
// this.rewindCount += 8;
// const DRAIN = 0.01
// let history = m.history[(m.cycle - this.rewindCount) % 600]
// if (this.rewindCount > 599 || m.energy < DRAIN || history.activeGun !== this.activeGunIndex) {
// this.rewindCount = 0;
// m.resetHistory();
// m.fireCDcycle = m.cycle + Math.floor(120 * b.fireCDscale); // cool down
// } else {
// m.energy -= DRAIN
// if (m.immuneCycle < m.cycle + 30) m.immuneCycle = m.cycle + 30; //player is immune to damage for 5 cycles
// Matter.Body.setPosition(player, history.position);
// Matter.Body.setVelocity(player, { x: history.velocity.x, y: history.velocity.y });
// if (m.health !== history.health) {
// m.health = history.health
// m.displayHealth();
// }
// m.yOff = history.yOff
// if (m.yOff < 48) {
// m.doCrouch()
// } else {
// m.undoCrouch()
// }
// }
// } else { //button is held the first time
// this.rewindCount = 0;
// this.activeGunIndex = b.activeGun
// }
// this.lastFireCycle = m.cycle;
// }
// }
};

View File

@@ -232,15 +232,15 @@ function collisionChecks(event) {
}
//determine if player is on the ground
Events.on(engine, "collisionStart", function (event) {
Events.on(engine, "collisionStart", function(event) {
playerOnGroundCheck(event);
// playerHeadCheck(event);
if (m.alive) collisionChecks(event);
});
Events.on(engine, "collisionActive", function (event) {
Events.on(engine, "collisionActive", function(event) {
playerOnGroundCheck(event);
// playerHeadCheck(event);
});
Events.on(engine, "collisionEnd", function (event) {
Events.on(engine, "collisionEnd", function(event) {
playerOffGroundCheck(event);
});

View File

@@ -17,10 +17,10 @@ const level = {
// level.difficultyIncrease(30) //30 is near max on hard //60 is near max on why
// simulation.isHorizontalFlipped = true
// m.setField("wormhole")
// b.giveGuns("laser")
// b.giveGuns("shotgun")
// b.giveGuns("nail gun")
// b.giveGuns("harpoon")
// tech.giveTech("affine connection")
// tech.giveTech("slug")
// tech.giveTech("regression")
// tech.giveTech("relativistic momentum")
// for (let i = 0; i < 2; i++) tech.giveTech("refractory metal")
@@ -58,7 +58,6 @@ const level = {
// for (let i = 0; i < 30; i++) powerUps.spawn(player.position.x + Math.random() * 50, player.position.y - Math.random() * 50, "tech", false);
// for (let i = 0; i < 3; i++) tech.giveTech("undefined")
// lore.techCount = 3
// simulation.isCheating = false //true;
// localSettings.loreCount = 3; //this sets what conversation is heard
// localStorage.setItem("localSettings", JSON.stringify(localSettings)); //update local storage
@@ -131,8 +130,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
}
},
custom() { },
customTopLayer() { },
custom() {},
customTopLayer() {},
setDifficulty() {
simulation.difficulty = 0
b.dmgScale = 1; //damage done by player decreases each level
@@ -574,7 +573,7 @@ const level = {
body[body.length] = rotor1
body[body.length] = rotor2
setTimeout(function () {
setTimeout(function() {
rotor.collisionFilter.category = cat.body;
rotor.collisionFilter.mask = cat.body | cat.player | cat.bullet | cat.mob | cat.mobBullet //| cat.map
}, 1000);
@@ -589,7 +588,7 @@ const level = {
Composite.add(engine.world, constraint);
if (rotate) {
rotor.rotate = function () {
rotor.rotate = function() {
if (!m.isBodiesAsleep) {
Matter.Body.applyForce(rotor, {
x: rotor.position.x + 100,
@@ -792,7 +791,7 @@ const level = {
y: 0
}, angleB)
draw = function () {
draw = function() {
ctx.beginPath(); //portal
let v = this.vertices;
ctx.moveTo(v[0].x, v[0].y);
@@ -802,7 +801,7 @@ const level = {
ctx.fillStyle = this.color
ctx.fill();
}
query = function (isRemoveBlocks = false) {
query = function(isRemoveBlocks = false) {
if (Matter.Query.collides(this, [player]).length === 0) { //not touching player
if (player.isInPortal === this) player.isInPortal = null
} else if (player.isInPortal !== this) { //touching player
@@ -1417,7 +1416,7 @@ const level = {
button.isReadyToFire = true
} else if (button.isReadyToFire && !button.isUp) {
button.isReadyToFire = false
fireBlock = function (xPos, yPos) {
fireBlock = function(xPos, yPos) {
const index = body.length
spawn.bodyRect(xPos, yPos, 35 + 50 * Math.random(), 35 + 50 * Math.random());
const bodyBullet = body[body.length - 1]
@@ -1473,7 +1472,7 @@ const level = {
button.isReadyToFire = true
} else if (button.isReadyToFire && !button.isUp) {
button.isReadyToFire = false
fireBlock = function (xPos, yPos) {
fireBlock = function(xPos, yPos) {
const index = body.length
spawn.bodyRect(xPos, yPos, 35 + 50 * Math.random(), 35 + 50 * Math.random());
const bodyBullet = body[body.length - 1]
@@ -2388,7 +2387,7 @@ const level = {
level.exit.draw();
level.enter.draw();
};
level.customTopLayer = () => { };
level.customTopLayer = () => {};
level.setPosToSpawn(0, -50); //normal spawn
level.exit.x = 1500;
level.exit.y = -1875;
@@ -5518,7 +5517,7 @@ const level = {
if (mob[i].isBoss) me = mob[i]
}
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()
doorSortieSalle.isOpen = false;
};
@@ -5534,7 +5533,7 @@ const level = {
if (mob[i].isBoss) me = mob[i]
}
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()
doorSortieSalle.isOpen = false;
};
@@ -5759,11 +5758,11 @@ const level = {
body[body.length] = part4;
body[body.length] = part5;
body[body.length] = part6;
setTimeout(function () {
setTimeout(function() {
chair.collisionFilter.category = cat.body;
chair.collisionFilter.mask = cat.body | cat.player | cat.bullet | cat.mob | cat.mobBullet | cat.map
}, 1000);
setTimeout(function () {
setTimeout(function() {
chair2.collisionFilter.category = cat.body;
chair2.collisionFilter.mask = cat.body | cat.player | cat.bullet | cat.mob | cat.mobBullet | cat.map
}, 1000);
@@ -5818,7 +5817,7 @@ const level = {
body[body.length] = rightUpperLeg
body[body.length] = rightLowerArm
body[body.length] = rightUpperArm
setTimeout(function () {
setTimeout(function() {
person.collisionFilter.category = cat.body;
person.collisionFilter.mask = cat.body | cat.player | cat.bullet | cat.mob | cat.mobBullet | cat.map
}, 1000);
@@ -6210,7 +6209,7 @@ const level = {
level.exit.draw();
level.enter.draw();
};
level.customTopLayer = () => { };
level.customTopLayer = () => {};
level.defaultZoom = 1800
simulation.zoomTransition(level.defaultZoom)
document.body.style.backgroundColor = "#dcdcde";
@@ -7269,7 +7268,7 @@ const level = {
body[body.length] = part1;
body[body.length] = part2;
body[body.length] = part3;
setTimeout(function () {
setTimeout(function() {
compoundParts.collisionFilter.category = cat.body;
compoundParts.collisionFilter.mask = cat.body | cat.player | cat.bullet | cat.mob | cat.mobBullet | cat.map
}, 1000);

View File

@@ -165,7 +165,7 @@ const mobs = {
});
}
},
endEffect() { },
endEffect() {},
dmg: tickDamage,
type: "dot",
endCycle: simulation.cycle + cycles,
@@ -472,7 +472,7 @@ const mobs = {
}
},
laser() {
const vertexCollision = function (v1, v1End, domain) {
const vertexCollision = function(v1, v1End, domain) {
for (let i = 0; i < domain.length; ++i) {
let vertices = domain[i].vertices;
const len = vertices.length - 1;
@@ -609,7 +609,7 @@ const mobs = {
ctx.fillStyle = "rgba(0,0,0,0.07)";
ctx.fill();
//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) {
let vertices = domain[i].vertices;
const len = vertices.length - 1;
@@ -676,7 +676,7 @@ const mobs = {
},
curl(range = 1000, mag = -10) {
//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) {
if (!array[i].isNotHoldable) {
const sub = Vector.sub(center, array[i].position)
@@ -825,7 +825,7 @@ const mobs = {
//be sure to declare searchTarget in mob spawn
//accelerate towards the searchTarget
if (!this.seePlayer.recall) {
const newTarget = function (that) {
const newTarget = function(that) {
if (Math.random() < 0.0005) {
that.searchTarget = player.position; //chance to target player
} else {
@@ -1149,7 +1149,7 @@ const mobs = {
powerUps.spawn(this.position.x, this.position.y, "tech", false)
// if (0.5 < Math.random()) powerUps.spawn(this.position.x, this.position.y, "tech", false)
} else {
const amount = 0.01
const amount = 0.005
if (tech.isEnergyHealth) {
if (m.maxEnergy > amount) {
tech.healMaxEnergyBonus -= amount
@@ -1228,7 +1228,7 @@ const mobs = {
for (let i = 0, len = consBB.length; i < len; ++i) {
if (consBB[i].bodyA === this) {
if (consBB[i].bodyB.shield) {
consBB[i].bodyB.do = function () {
consBB[i].bodyB.do = function() {
this.death();
};
}
@@ -1238,7 +1238,7 @@ const mobs = {
break;
} else if (consBB[i].bodyB === this) {
if (consBB[i].bodyA.shield) {
consBB[i].bodyA.do = function () {
consBB[i].bodyA.do = function() {
this.death();
};
}
@@ -1297,7 +1297,7 @@ const mobs = {
//large mobs shrink so they don't block paths
if (body[len].mass + body[len2].mass > 16) {
const massLimit = 8 + 6 * Math.random()
const shrink = function (that1, that2) {
const shrink = function(that1, that2) {
if (that1.mass + that2.mass > massLimit) {
const scale = 0.95;
Matter.Body.scale(that1, scale, scale);
@@ -1320,7 +1320,7 @@ const mobs = {
//large mobs shrink so they don't block paths
if (body[len].mass > 9) {
const massLimit = 7 + 4 * Math.random()
const shrink = function (that) {
const shrink = function(that) {
if (that.mass > massLimit) {
const scale = 0.95;
Matter.Body.scale(that, scale, scale);

View File

@@ -133,7 +133,7 @@ const m = {
transX: 0,
transY: 0,
history: [], //tracks the last second of player position
rewindCount: 0, //used with CPT gun
rewindCount: 0, //used with CPT
resetHistory() {
for (let i = 0; i < 600; i++) { //reset history
m.history[i] = {
@@ -183,7 +183,7 @@ const m = {
lastGroundedPositionY: 0,
// mouseZoom: 0,
lookSmoothing: 0.07, //1 is instant jerky, 0.001 is slow smooth zoom, 0.07 is standard
look() { }, //set to lookDefault()
look() {}, //set to lookDefault()
lookDefault() {
//always on mouse look
m.angle = Math.atan2(
@@ -405,7 +405,7 @@ const m = {
m.health = 1;
// m.addHealth(1)
simulation.wipe = function () { //set wipe to have trails
simulation.wipe = function() { //set wipe to have trails
ctx.fillStyle = "rgba(255,255,255,0)";
ctx.fillRect(0, 0, canvas.width, canvas.height);
}
@@ -415,8 +415,8 @@ const m = {
m.switchWorlds()
const swapPeriod = 1000
for (let i = 0, len = 5; i < len; i++) {
setTimeout(function () {
simulation.wipe = function () { //set wipe to have trails
setTimeout(function() {
simulation.wipe = function() { //set wipe to have trails
ctx.fillStyle = "rgba(255,255,255,0)";
ctx.fillRect(0, 0, canvas.width, canvas.height);
}
@@ -426,14 +426,14 @@ const m = {
simulation.isTextLogOpen = true;
simulation.makeTextLog(`simulation.amplitude <span class='color-symbol'>=</span> 0.${len - i - 1}`, swapPeriod);
simulation.isTextLogOpen = false;
simulation.wipe = function () { //set wipe to have trails
simulation.wipe = function() { //set wipe to have trails
ctx.fillStyle = `rgba(255,255,255,${(i + 1) * (i + 1) * 0.006})`;
ctx.fillRect(0, 0, canvas.width, canvas.height);
}
}, (i + 1) * swapPeriod);
}
setTimeout(function () {
simulation.wipe = function () { //set wipe to normal
setTimeout(function() {
simulation.wipe = function() { //set wipe to normal
ctx.clearRect(0, 0, canvas.width, canvas.height);
}
simulation.isTextLogOpen = true;
@@ -448,7 +448,7 @@ const m = {
document.getElementById("text-log").style.opacity = 0; //fade out any active text logs
document.getElementById("fade-out").style.opacity = 0.9; //slowly fade to 90% white on top of canvas
// build.shareURL(false)
setTimeout(function () {
setTimeout(function() {
Composite.clear(engine.world);
Engine.clear(engine);
simulation.splashReturn();
@@ -588,7 +588,7 @@ const m = {
if (m.immuneCycle < m.cycle + tech.collisionImmuneCycles) m.immuneCycle = m.cycle + tech.collisionImmuneCycles; //player is immune to damage for 30 cycles
let isDrawPlayer = true
const shortPause = function () {
const shortPause = function() {
if (m.defaultFPSCycle < m.cycle) { //back to default values
simulation.fpsCap = simulation.fpsCapDefault
simulation.fpsInterval = 1000 / simulation.fpsCap;
@@ -657,13 +657,13 @@ const m = {
for (let i = 0; i < 5; i++) powerUps.spawn(m.pos.x + 100 * (Math.random() - 0.5), m.pos.y + 100 * (Math.random() - 0.5), "heal", false);
m.energy = m.maxEnergy
if (m.immuneCycle < m.cycle + 300) m.immuneCycle = m.cycle + 300 //disable this.immuneCycle bonus seconds
simulation.wipe = function () { //set wipe to have trails
simulation.wipe = function() { //set wipe to have trails
ctx.fillStyle = "rgba(255,255,255,0.03)";
ctx.fillRect(0, 0, canvas.width, canvas.height);
}
setTimeout(function () {
setTimeout(function() {
tech.maxDuplicationEvent()
simulation.wipe = function () { //set wipe to normal
simulation.wipe = function() { //set wipe to normal
ctx.clearRect(0, 0, canvas.width, canvas.height);
}
}, 3000);
@@ -686,13 +686,13 @@ const m = {
<br>${powerUps.research.count}`)
for (let i = 0; i < 5; i++) powerUps.spawn(m.pos.x + 100 * (Math.random() - 0.5), m.pos.y + 100 * (Math.random() - 0.5), "heal", false);
if (m.immuneCycle < m.cycle + 300) m.immuneCycle = m.cycle + 300 //disable this.immuneCycle bonus seconds
simulation.wipe = function () { //set wipe to have trails
simulation.wipe = function() { //set wipe to have trails
ctx.fillStyle = "rgba(255,255,255,0.03)";
ctx.fillRect(0, 0, canvas.width, canvas.height);
}
setTimeout(function () {
setTimeout(function() {
tech.maxDuplicationEvent()
simulation.wipe = function () { //set wipe to normal
simulation.wipe = function() { //set wipe to normal
ctx.clearRect(0, 0, canvas.width, canvas.height);
}
}, 3000);
@@ -709,7 +709,7 @@ const m = {
}
if (dmg > 0.06 / m.holdingMassScale) m.drop(); //drop block if holding
const normalFPS = function () {
const normalFPS = function() {
if (m.defaultFPSCycle < m.cycle) { //back to default values
simulation.fpsCap = simulation.fpsCapDefault
simulation.fpsInterval = 1000 / simulation.fpsCap;
@@ -808,7 +808,7 @@ const m = {
m.knee.x = (l / d) * (m.foot.x - m.hip.x) - (h / d) * (m.foot.y - m.hip.y) + m.hip.x + offset;
m.knee.y = (l / d) * (m.foot.y - m.hip.y) + (h / d) * (m.foot.x - m.hip.x) + m.hip.y;
},
draw() { },
draw() {},
drawFlipFlop() {
ctx.fillStyle = m.fillColor;
m.walk_cycle += m.flipLegs * m.Vx;
@@ -981,7 +981,7 @@ const m = {
ctx.fillRect(xOff, yOff, range * m.energy, 10);
}
},
drawFieldMeterCloaking: function () {
drawFieldMeterCloaking: function() {
if (m.energy < m.maxEnergy) { // replaces m.drawFieldMeter() with custom code
m.regenEnergy();
const xOff = m.pos.x - m.radius * m.maxEnergy
@@ -997,11 +997,11 @@ const m = {
ctx.stroke();
}
},
regenEnergy: function () { //used in drawFieldMeter // rewritten by some tech
regenEnergy: function() { //used in drawFieldMeter // rewritten by some tech
if (m.immuneCycle < m.cycle) m.energy += m.fieldRegen;
if (m.energy < 0) m.energy = 0
},
regenEnergyDefault: function () {
regenEnergyDefault: function() {
if (m.immuneCycle < m.cycle) m.energy += m.fieldRegen;
if (m.energy < 0) m.energy = 0
},
@@ -1189,7 +1189,7 @@ const m = {
m.holdingTarget.friction = m.holdingTarget.frictionStatic = m.holdingTarget.frictionAir = 0.001
}
//check every second to see if player is away from thrown body, and make solid
const solid = function (that) {
const solid = function(that) {
const dx = that.position.x - player.position.x;
const dy = that.position.y - player.position.y;
if (that.speed < 3 && dx * dx + dy * dy > 10000 && that !== m.holdingTarget) {
@@ -1221,7 +1221,7 @@ const m = {
m.definePlayerMass() //return to normal player mass
if (tech.isAddBlockMass) {
const expand = function (that, massLimit) {
const expand = function(that, massLimit) {
if (that.mass < massLimit) {
const scale = 1.05;
Matter.Body.scale(that, scale, scale);
@@ -1466,7 +1466,7 @@ const m = {
// wake(powerUp);
}
},
hold() { },
hold() {},
setField(index) {
if (isNaN(index)) { //find index by name
let found = false
@@ -1490,7 +1490,7 @@ const m = {
description: "regen <strong>6</strong> <strong class='color-f'>energy</strong> per second<br>use it to <strong>deflect</strong> mobs and <strong>throw</strong> <strong class='color-block'>blocks</strong><br><strong class='color-f'>energy</strong> regen disabled if immune to <strong class='color-harm'>harm</strong>",
// description: "use <strong class='color-f'>energy</strong> to <strong>deflect</strong> mobs,<br><strong>grab</strong> power ups, and <strong>throw</strong> <strong class='color-block'>blocks</strong><br>regen <strong>6</strong> <strong class='color-f'>energy</strong>/s, when not immune to <strong class='color-harm'>harm</strong>",
effect: () => {
m.hold = function () {
m.hold = function() {
if (m.isHolding) {
m.drawHold(m.holdingTarget);
m.holding();
@@ -1584,7 +1584,7 @@ const m = {
} else {
m.harmonicShield = m.harmonicAtomic
}
m.hold = function () {
m.hold = function() {
if (m.isHolding) {
m.drawHold(m.holdingTarget);
m.holding();
@@ -1717,7 +1717,7 @@ const m = {
}
}
}
m.hold = function () {
m.hold = function() {
const wave = Math.sin(m.cycle * 0.022);
m.fieldRange = 160 + 12 * wave + 100 * tech.isBigField
m.fieldArc = 0.34 + 0.04 * wave + 0.065 * tech.isBigField //run calculateFieldThreshold after setting fieldArc, used for powerUp grab and mobPush with lookingAt(mob)
@@ -1809,7 +1809,7 @@ const m = {
m.fieldHarmReduction = 0.45; //55% reduction
m.fieldDrawRadius = 0;
m.hold = function () {
m.hold = function() {
m.airSpeedLimit = 125 //5 * player.mass * player.mass
m.FxAir = 0.016
if (m.isHolding) {
@@ -1953,7 +1953,7 @@ const m = {
effect: () => {
// m.fieldMeterColor = "#0c5"
// m.eyeFillColor = m.fieldMeterColor
m.hold = function () {
m.hold = function() {
if (m.energy > m.maxEnergy - 0.02 && m.fieldCDcycle < m.cycle && !input.field && bullet.length < 200 && (m.cycle % 2)) {
if (tech.isSporeField) {
if (tech.isSporeWorm) {
@@ -2074,7 +2074,7 @@ const m = {
set() {
b.isExtruderOn = false
if (tech.isExtruder) {
m.hold = function () {
m.hold = function() {
b.isExtruderOn = false
if (m.isHolding) {
m.drawHold(m.holdingTarget);
@@ -2115,7 +2115,7 @@ const m = {
ctx.stroke();
}
} else {
m.hold = function () {
m.hold = function() {
if (m.isHolding) {
m.drawHold(m.holdingTarget);
m.holding();
@@ -2147,7 +2147,7 @@ const m = {
if (tech.isRewindField) {
this.rewindCount = 0
m.grabPowerUpRange2 = 300000
m.hold = function () {
m.hold = function() {
if (m.isHolding) {
m.drawHold(m.holdingTarget);
m.holding();
@@ -2317,7 +2317,7 @@ const m = {
m.fieldFire = true;
m.isBodiesAsleep = false;
m.drain = 0.0005
m.hold = function () {
m.hold = function() {
if (m.isHolding) {
m.wakeCheck();
m.drawHold(m.holdingTarget);
@@ -2413,7 +2413,7 @@ const m = {
m.isSneakAttack = true;
const drawRadius = 900
m.hold = function () {
m.hold = function() {
// console.log(m.holdingTarget)
if (m.isHolding) {
m.drawHold(m.holdingTarget);
@@ -2676,7 +2676,7 @@ const m = {
m.fieldOn = false;
m.fieldRadius = 0;
m.drop();
m.hold = function () {
m.hold = function() {
if (input.field) {
if (m.fieldCDcycle < m.cycle) {
const scale = 25
@@ -2857,12 +2857,12 @@ const m = {
name: "wormhole",
description: "use <strong class='color-f'>energy</strong> to <strong>tunnel</strong> through a <strong class='color-worm'>wormhole</strong><br><strong class='color-worm'>wormholes</strong> attract <strong class='color-block'>blocks</strong> and power ups<br><strong>7%</strong> chance to <strong class='color-dup'>duplicate</strong> spawned <strong>power ups</strong>", //<br>bullets may also traverse <strong class='color-worm'>wormholes</strong>
drain: 0,
effect: function () {
effect: function() {
m.duplicateChance = 0.07
m.fieldRange = 0
powerUps.setDupChance(); //needed after adjusting duplication chance
m.hold = function () {
m.hold = function() {
// m.hole = { //this is reset with each new field, but I'm leaving it here for reference
// isOn: false,
// isReady: true,

File diff suppressed because it is too large Load Diff

View File

@@ -289,33 +289,27 @@ const tech = {
tech: [{
name: "integrated armament",
link: `<a target="_blank" href='https://en.wikipedia.org/wiki/Weapon' class="link">integrated armament</a>`,
description: `increase <strong class='color-d'>damage</strong> by <strong>19.95%</strong><br>your inventory can only hold 1 <strong class='color-g'>gun</strong>`,
description: `<span style = 'font-size:95%;'>increase <strong class='color-d'>damage</strong> by <strong>25%</strong>, but new <strong class='color-g'>guns</strong><br>replace your current <strong class='color-g'>gun</strong> and convert <strong class='color-g'>gun</strong><strong class='color-m'>tech</strong></span>`,
maxCount: 1,
count: 0,
frequency: 1,
frequencyDefault: 1,
allowed() {
return b.inventory.length === 1 //&& !tech.haveGunCheck("CPT gun")
return b.inventory.length === 1
},
requires: "only 1 gun",
effect() {
tech.isOneGun = true;
for (let i = 0; i < tech.tech.length; i++) {
if (tech.tech[i].name === "CPT gun") tech.tech[i].description = `adds the <strong>CPT</strong> <strong class='color-g'>gun</strong> to your inventory<br>it <strong>rewinds</strong> your <strong class='color-h'>health</strong>, <strong>velocity</strong>, and <strong>position</strong><br><div style = 'color: #f24'>replaces your current gun</div>`
}
},
remove() {
tech.isOneGun = false;
for (let i = 0; i < tech.tech.length; i++) {
if (tech.tech[i].name === "CPT gun") tech.tech[i].description = `adds the <strong>CPT</strong> <strong class='color-g'>gun</strong> to your inventory<br>it <strong>rewinds</strong> your <strong class='color-h'>health</strong>, <strong>velocity</strong>, and <strong>position</strong>`
}
}
},
{
name: "entanglement",
nameInfo: "<span id = 'tech-entanglement'></span>",
addNameInfo() {
setTimeout(function () {
setTimeout(function() {
simulation.boldActiveGunHUD();
}, 1000);
},
@@ -330,7 +324,7 @@ const tech = {
requires: "at least 2 guns, not mass-energy",
effect() {
tech.isEntanglement = true
setTimeout(function () {
setTimeout(function() {
simulation.boldActiveGunHUD();
}, 1000);
@@ -406,7 +400,7 @@ const tech = {
},
{
name: "gun sciences",
description: "spawn a <strong class='color-g'>gun</strong> and </strong>double</strong> the <strong class='flicker'>frequency</strong><br>of finding <strong class='color-m'>tech</strong> for your <strong class='color-g'>guns</strong>",
description: "spawn a <strong class='color-g'>gun</strong> and </strong>double</strong> the <strong class='flicker'>frequency</strong><br>of finding <strong class='color-g'>gun</strong><strong class='color-m'>tech</strong>",
maxCount: 1,
count: 0,
frequency: 1,
@@ -425,7 +419,7 @@ const tech = {
if (tech.tech[i].isGunTech) tech.tech[i].frequency *= 2
}
},
remove() { }
remove() {}
},
{
name: "ad hoc",
@@ -454,11 +448,11 @@ const tech = {
}
}
},
remove() { }
remove() {}
},
{
name: "applied science",
description: `get a random <strong class='color-m'>tech</strong><br>for each <strong class='color-g'>gun</strong> in your inventory`, //spawn ${powerUps.orb.research(1)} and
description: `get a random <strong class='color-g'>gun</strong><strong class='color-m'>tech</strong><br>for each <strong class='color-g'>gun</strong> in your inventory`, //spawn ${powerUps.orb.research(1)} and
maxCount: 9,
count: 0,
isNonRefundable: true,
@@ -497,7 +491,7 @@ const tech = {
}
simulation.boldActiveGunHUD();
},
remove() { }
remove() {}
},
{
name: "logistics",
@@ -1911,7 +1905,7 @@ const tech = {
description: `toggle <strong class="color-flop">ON</strong> and <strong class="color-flop">OFF</strong> after a <strong>collision</strong><br>unlock advanced <strong class='color-m'>tech</strong> that runs if <strong class="color-flop">ON</strong>`,
nameInfo: "<span id = 'tech-flip-flop'></span>",
addNameInfo() {
setTimeout(function () {
setTimeout(function() {
if (document.getElementById("tech-flip-flop")) {
if (tech.isFlipFlopOn) {
document.getElementById("tech-flip-flop").innerHTML = ` = <strong>ON</strong>`
@@ -1949,7 +1943,7 @@ const tech = {
description: `toggle <strong class="color-flop">ON</strong> and <strong class="color-flop">OFF</strong> after picking up a <strong>power up</strong><br>unlock advanced <strong class='color-m'>tech</strong> that runs if <strong class="color-flop">ON</strong>`,
nameInfo: "<span id = 'tech-switch'></span>",
addNameInfo() {
setTimeout(function () {
setTimeout(function() {
if (document.getElementById("tech-switch")) {
if (tech.isFlipFlopOn) {
document.getElementById("tech-switch").innerHTML = ` = <strong>ON</strong>`
@@ -2616,7 +2610,7 @@ const tech = {
requires: "not ground state, apex predator",
effect() {
tech.isCrouchRegen = true; //only used to check for requirements
m.regenEnergy = function () {
m.regenEnergy = function() {
if (m.immuneCycle < m.cycle && m.crouch) m.energy += 7 * m.fieldRegen; //m.fieldRegen = 0.001
if (m.energy < 0) m.energy = 0
}
@@ -2688,7 +2682,7 @@ const tech = {
requires: "not inductive coupling",
effect() {
tech.isDamageAfterKillNoRegen = true;
m.regenEnergy = function () {
m.regenEnergy = function() {
if (m.immuneCycle < m.cycle && (m.lastKillCycle + 300 < m.cycle)) m.energy += m.fieldRegen; //m.fieldRegen = 0.001
if (m.energy < 0) m.energy = 0
}
@@ -2770,7 +2764,7 @@ const tech = {
}
},
{
name: "entropy exchange",
name: "enthalpy",
description: "<strong class='color-h'>heal</strong> for <strong>3%</strong> of <strong class='color-d'>damage</strong> done<br>take <strong>10%</strong> more <strong class='color-harm'>harm</strong>",
maxCount: 9,
count: 0,
@@ -2906,13 +2900,13 @@ const tech = {
if (tech.tech[i].isHealTech) tech.tech[i].frequency *= 2
}
},
remove() { }
remove() {}
},
{
name: "anthropic principle",
nameInfo: "<span id = 'tech-anthropic'></span>",
addNameInfo() {
setTimeout(function () {
setTimeout(function() {
powerUps.research.changeRerolls(0)
}, 1000);
},
@@ -2929,7 +2923,7 @@ const tech = {
effect() {
tech.isDeathAvoid = true;
tech.isDeathAvoidedThisLevel = false;
setTimeout(function () {
setTimeout(function() {
powerUps.research.changeRerolls(0)
}, 1000);
},
@@ -3185,7 +3179,7 @@ const tech = {
for (let i = 0; i < count; i++) powerUps.spawn(m.pos.x + 100 * (Math.random() - 0.5), m.pos.y + 100 * (Math.random() - 0.5), "tech"); // spawn new tech power ups
//have state is checked in m.death()
},
remove() { }
remove() {}
},
{
name: "Occam's razor",
@@ -3203,7 +3197,7 @@ const tech = {
},
requires: "NOT EXPERIMENT MODE, more than 6 tech",
removePercent: 0.5,
damagePerRemoved: 0.36,
damagePerRemoved: 0.4,
effect() {
let pool = []
for (let i = 0, len = tech.tech.length; i < len; i++) { // spawn new tech power ups
@@ -3460,7 +3454,7 @@ const tech = {
tech.tech[choose].isLost = true
simulation.updateTechHUD();
},
remove() { }
remove() {}
},
{
name: "monte carlo experiment",
@@ -3479,7 +3473,7 @@ const tech = {
const removeTotal = tech.removeTech()
for (let i = 0; i < removeTotal + 1; i++) powerUps.spawn(m.pos.x + 60 * (Math.random() - 0.5), m.pos.y + 60 * (Math.random() - 0.5), "tech");
},
remove() { }
remove() {}
},
{
name: "strange attractor",
@@ -3500,7 +3494,7 @@ const tech = {
powerUps.directSpawn(m.pos.x, m.pos.y, "tech");
if (Math.random() < tech.duplicationChance() * 2) powerUps.directSpawn(m.pos.x + 10, m.pos.y + 5, "tech");
},
remove() { }
remove() {}
},
{
name: "vector fields",
@@ -3551,34 +3545,50 @@ const tech = {
}
}
},
{
name: "backward induction",
description: `use ${powerUps.orb.research(2)} to <strong>choose</strong> all the unchosen<br> <strong class='color-m'>tech</strong> from your previous <strong class='color-m'>tech</strong> selection`,
maxCount: 1,
count: 0,
frequency: 1,
frequencyDefault: 1,
isNonRefundable: true,
isBadRandomOption: true,
allowed() {
return powerUps.tech.choiceLog.length > 10 && !tech.isDeterminism && powerUps.research.count > 1
},
requires: "NOT EXPERIMENT MODE, rejected an option in the last tech selection, at least 2 research, not determinism",
effect: () => {
powerUps.research.changeRerolls(-2)
let num = 3
if (tech.isExtraChoice) num = 5
if (tech.isDeterminism) num = 1
for (let i = 0; i < num; i++) {
const index = powerUps.tech.choiceLog[powerUps.tech.choiceLog.length - i - 1]
if (index !== powerUps.lastTechIndex && tech.tech[index].count < tech.tech[index].maxCount && tech.tech[index].allowed() && tech.tech[index].name !== "backward induction") {
tech.giveTech(index)
simulation.makeTextLog(`<span class='color-var'>tech</span>.giveTech("<span class='color-text'>${tech.tech[index].name}</span>") <em> //backward induction</em>`);
}
}
},
remove() { }
},
// {
// name: "backward induction",
// descriptionFunction() {
// if (build.isExperimentSelection || powerUps.tech.choiceLog.length < 10) return `use ${powerUps.orb.research(2)} to <strong>choose</strong> all the unchosen <strong class='color-m'>tech</strong><br>from your last selection`
// text = ``
// let num = 3
// if (tech.isExtraChoice) num = 5
// if (tech.isDeterminism) num = 1
// for (let i = 0; i < num; i++) {
// const index = powerUps.tech.choiceLog[powerUps.tech.choiceLog.length - i - 1]
// if (index !== powerUps.lastTechIndex && tech.tech[index].count < tech.tech[index].maxCount && tech.tech[index].allowed() && tech.tech[index].name !== "backward induction") {
// text += `${tech.tech[index].name}, `
// }
// }
// text = text.slice(0, -2);
// return `use ${powerUps.orb.research(2)}to <strong>choose</strong> the unchosen<br><strong class='color-m'>tech</strong> from your previous selection:<br><em style = 'font-size:${num===5 ? 70 : 85}%;'>${text}</em>`
// },
// // description: `use ${powerUps.orb.research(2)}to <strong>choose</strong> all the unchosen<br> <strong class='color-m'>tech</strong> from your previous <strong class='color-m'>tech</strong> selection`,
// maxCount: 1,
// count: 0,
// frequency: 100,
// frequencyDefault: 100,
// isNonRefundable: true,
// isBadRandomOption: true,
// allowed() {
// return powerUps.tech.choiceLog.length > 10 && !tech.isDeterminism && powerUps.research.count > 1
// },
// requires: "NOT EXPERIMENT MODE, rejected an option in the last tech selection, at least 2 research, not determinism",
// effect: () => {
// powerUps.research.changeRerolls(-2)
// let num = 3
// if (tech.isExtraChoice) num = 5
// if (tech.isDeterminism) num = 1
// for (let i = 0; i < num; i++) {
// const index = powerUps.tech.choiceLog[powerUps.tech.choiceLog.length - i - 1]
// if (index !== powerUps.lastTechIndex && tech.tech[index].count < tech.tech[index].maxCount && tech.tech[index].allowed() && tech.tech[index].name !== "backward induction") {
// tech.giveTech(index)
// simulation.makeTextLog(`<span class='color-var'>tech</span>.giveTech("<span class='color-text'>${tech.tech[index].name}</span>") <em> //backward induction</em>`);
// }
// }
// },
// remove() {}
// },
{
name: "unified field theory",
description: `spawn ${powerUps.orb.research(6)}and when <strong>paused</strong><br><strong>clicking</strong> the <strong class='color-f'>field</strong> box switches your <strong class='color-f'>field</strong>`,
@@ -3961,21 +3971,49 @@ const tech = {
},
{
name: "pneumatic hammer",
description: `<strong>rivets</strong> are <strong>20%</strong> larger<br>increases mass and physical <strong class='color-d'>damage</strong>`,
description: `<span style = 'font-size:95%;'><strong>rivets</strong>, <strong>slugs</strong>, <strong>needles</strong>, and <strong>nails</strong> are <strong>18%</strong> larger</span><br>increases mass and physical <strong class='color-d'>damage</strong>`,
isGunTech: true,
maxCount: 9,
count: 0,
frequency: 2,
frequencyDefault: 2,
allowed() {
return tech.isRivets
// return tech.haveGunCheck("nail gun") || tech.isSlugShot
return tech.isMineDrop + tech.nailBotCount + tech.fragments + tech.nailsDeathMob + ((tech.haveGunCheck("mine") && !tech.isLaserMine) + (tech.haveGunCheck("nail gun") && !tech.isShieldPierce) + tech.isNeedleShot + tech.isNailShot + tech.isSlugShot) * 2 > 1
},
requires: "nail gun, rivet gun",
requires: "nails, nail gun, rivets, shotgun, slug",
effect() {
tech.rivetSize += 0.2
tech.nailSize += 0.18
},
remove() {
tech.rivetSize = 1;
tech.nailSize = 1;
}
},
{
name: "pneumatic actuator",
description: "<strong>nail gun</strong> takes <strong>no</strong> time to ramp up<br>to it's shortest <strong><em>delay</em></strong> after firing",
isGunTech: true,
maxCount: 1,
count: 0,
frequency: 2,
frequencyDefault: 2,
allowed() {
return tech.haveGunCheck("nail gun") && !tech.isRivets && !tech.isNeedles && !tech.nailRecoil
},
requires: "nail gun, not rotary cannon, rivets, or needles",
effect() {
tech.nailInstantFireRate = true
for (i = 0, len = b.guns.length; i < len; i++) { //find which gun
if (b.guns[i].name === "nail gun") b.guns[i].chooseFireMethod()
}
},
remove() {
if (tech.nailInstantFireRate) {
tech.nailInstantFireRate = false
for (i = 0, len = b.guns.length; i < len; i++) { //find which gun
if (b.guns[i].name === "nail gun") b.guns[i].chooseFireMethod()
}
}
}
},
{
@@ -4017,33 +4055,6 @@ const tech = {
}
}
},
{
name: "pneumatic actuator",
description: "<strong>nail gun</strong> takes <strong>no</strong> time to ramp up<br>to it's shortest <strong><em>delay</em></strong> after firing",
isGunTech: true,
maxCount: 1,
count: 0,
frequency: 2,
frequencyDefault: 2,
allowed() {
return tech.haveGunCheck("nail gun") && !tech.isRivets && !tech.isNeedles && !tech.nailRecoil
},
requires: "nail gun, not rotary cannon, rivets, or needles",
effect() {
tech.nailInstantFireRate = true
for (i = 0, len = b.guns.length; i < len; i++) { //find which gun
if (b.guns[i].name === "nail gun") b.guns[i].chooseFireMethod()
}
},
remove() {
if (tech.nailInstantFireRate) {
tech.nailInstantFireRate = false
for (i = 0, len = b.guns.length; i < len; i++) { //find which gun
if (b.guns[i].name === "nail gun") b.guns[i].chooseFireMethod()
}
}
}
},
{
name: "rotary cannon",
description: "<strong>nail gun</strong> has increased muzzle <strong>speed</strong>,<br>maximum <strong>fire rate</strong>, <strong>accuracy</strong>, and <strong>recoil</strong>",
@@ -4151,8 +4162,8 @@ const tech = {
}
},
{
name: "shotgun spin-statistics",
link: `<a target="_blank" href='https://en.wikipedia.org/wiki/Spin%E2%80%93statistics_theorem' class="link">shotgun spin-statistics</a>`,
name: "spin-statistics",
link: `<a target="_blank" href='https://en.wikipedia.org/wiki/Spin%E2%80%93statistics_theorem' class="link">spin-statistics</a>`,
description: "<strong>immune</strong> to <strong class='color-harm'>harm</strong> while firing the <strong>shotgun</strong><br>shotgun has <strong>50%</strong> fewer shots",
isGunTech: true,
maxCount: 1,
@@ -4230,7 +4241,7 @@ const tech = {
}
},
{
name: "shotgun slug",
name: "slug",
description: "<strong>shotgun</strong> lobs <strong>1</strong> huge <strong>bullet</strong>",
isGunTech: true,
maxCount: 1,
@@ -4243,8 +4254,39 @@ const tech = {
requires: "shotgun, not nail-shot, foam-shot, worm-shot, ice-shot, needle-shot",
effect() {
tech.isSlugShot = true;
for (i = 0, len = b.guns.length; i < len; i++) { //find which gun
if (b.guns[i].name === "shotgun") {
b.guns[i].do = function() {
if (!input.field && input.down) {
ctx.beginPath()
const speed = input.down ? 212 : 160
const v = { x: speed * Math.cos(m.angle), y: speed * Math.sin(m.angle) } //m.Vy / 2 + removed to make the path less jerky
const where = { x: m.pos.x, y: m.pos.y }
for (let i = 0; i < 20; i++) {
v.x *= 0.9712
v.y = v.y * 0.977 + 9.87
where.x += v.x
where.y += v.y
ctx.lineTo(where.x, where.y)
}
ctx.strokeStyle = "rgba(68, 68, 68, 0.2)" //color.map
ctx.lineWidth = 2
ctx.stroke()
}
}
break
}
}
},
remove() {
if (tech.isSlugShot) {
for (i = 0, len = b.guns.length; i < len; i++) { //find which gun
if (b.guns[i].name === "shotgun") {
b.guns[i].do = function() {}
break
}
}
}
tech.isSlugShot = false;
}
},
@@ -4598,6 +4640,7 @@ const tech = {
link: `<a target="_blank" href='https://en.wikipedia.org/wiki/Robot' class="link">missile-bot</a>`,
description: "gain a <strong class='color-bot'>bot</strong> that fires <strong>missiles</strong> at mobs<br>remove your <strong>missile gun</strong>",
isGunTech: true,
isRemoveGun: true,
maxCount: 1,
count: 0,
frequency: 2,
@@ -4829,8 +4872,8 @@ const tech = {
},
{
name: "mycelial fragmentation",
link: `<a target="_blank" href='https://en.wikipedia.org/wiki/Fungus' class="link">tinsellated flagella</a>`,
description: "<strong class='color-p' style='letter-spacing: 2px;'>sporangium</strong> release <strong>6</strong> extra <strong class='color-p' style='letter-spacing: 2px;'>spores</strong><br>during their <strong>growth</strong> phase",
link: `<a target="_blank" href='https://en.wikipedia.org/wiki/Fungus' class="link">mycelial fragmentation</a>`,
description: "<strong class='color-p' style='letter-spacing: 2px;'>sporangium</strong> release <strong>6</strong> more <strong class='color-p' style='letter-spacing: 2px;'>spores</strong><br>during their <strong>growth</strong> phase",
isGunTech: true,
maxCount: 1,
count: 0,
@@ -4967,6 +5010,7 @@ const tech = {
name: "fault tolerance",
description: "spawn <strong>8</strong> <strong>drones</strong> that last <strong>forever</strong><br>remove your <strong>drone gun</strong>",
isGunTech: true,
isRemoveGun: true,
maxCount: 1,
count: 0,
frequency: 1,
@@ -5301,6 +5345,7 @@ const tech = {
name: "surfactant",
description: "trade your <strong>foam gun</strong> for <strong>2</strong> <strong class='color-bot'>foam-bots</strong><br>and <strong>upgrade</strong> all bots to foam<br>",
isGunTech: true,
isRemoveGun: true,
maxCount: 1,
count: 0,
frequency: 1,
@@ -6032,7 +6077,7 @@ const tech = {
b.randomBot()
b.randomBot()
},
remove() { }
remove() {}
},
{
name: "bot prototypes",
@@ -6109,7 +6154,7 @@ const tech = {
}
notUpgradedBots[Math.floor(Math.random() * notUpgradedBots.length)]() //choose random function from the array and run it
},
remove() { }
remove() {}
},
{
name: "mycelium manufacturing",
@@ -6310,7 +6355,7 @@ const tech = {
{
name: "plasma jet",
link: `<a target="_blank" href='https://en.wikipedia.org/wiki/Plasma_(physics)' class="link">plasma jet</a>`,
description: `use ${powerUps.orb.research(1)} to increase <strong class='color-plasma'>plasma</strong> <strong>torch</strong> range <strong>50%</strong>`,
description: `use ${powerUps.orb.research(2)} to increase <strong class='color-plasma'>plasma</strong> <strong>torch</strong> range <strong>50%</strong>`,
// description: "use <strong>1</strong> <strong class='color-r'>research</strong> to <br>increase <strong class='color-plasma'>plasma</strong> <strong>torch's</strong> range by <strong>50%</strong>",
isFieldTech: true,
maxCount: 1,
@@ -6318,16 +6363,18 @@ const tech = {
frequency: 2,
frequencyDefault: 2,
allowed() {
return (tech.plasmaBotCount || m.fieldUpgrades[m.fieldMode].name === "plasma torch") && (build.isExperimentSelection || powerUps.research.count > 0)
return (tech.plasmaBotCount || m.fieldUpgrades[m.fieldMode].name === "plasma torch") && (build.isExperimentSelection || powerUps.research.count > 1)
},
requires: "plasma torch",
effect() {
tech.isPlasmaRange += 0.5;
for (let i = 0; i < 2; i++) {
if (powerUps.research.count > 0) powerUps.research.changeRerolls(-1)
}
},
remove() {
tech.isPlasmaRange = 1;
if (this.count > 0) powerUps.research.changeRerolls(this.count)
if (this.count > 0) powerUps.research.changeRerolls(this.count * 2)
}
},
{
@@ -6508,7 +6555,7 @@ const tech = {
},
{
name: "symbiosis",
description: "after a <strong>mob</strong> <strong>dies</strong>, lose <strong>1</strong> max <strong class='color-h'>health</strong><br><strong>bosses</strong> spawn <strong>1</strong> extra <strong class='color-m'>tech</strong> after they <strong>die</strong>",
description: "after a <strong>mob</strong> <strong>dies</strong>, lose <strong>0.5</strong> max <strong class='color-h'>health</strong><br><strong>bosses</strong> spawn <strong>1</strong> extra <strong class='color-m'>tech</strong> after they <strong>die</strong>",
isFieldTech: true,
maxCount: 1,
count: 0,
@@ -6894,7 +6941,7 @@ const tech = {
effect() {
m.shipMode()
},
remove() { }
remove() {}
},
{
name: "-quantum leap-",
@@ -7118,7 +7165,7 @@ const tech = {
for (let i = 0; i < b.guns.length; i++) b.guns[i].ammo = b.guns[i].ammo * Math.pow(2, 10)
simulation.updateGunHUD();
},
remove() { }
remove() {}
},
{
name: "density",
@@ -7237,7 +7284,7 @@ const tech = {
const bc = new BroadcastChannel('planetesimals');
bc.activated = false
bc.onmessage = function (ev) {
bc.onmessage = function(ev) {
if (ev.data === 'tech') powerUps.directSpawn(m.pos.x, m.pos.y, "tech");
if (ev.data === 'death') {
m.death()
@@ -7249,7 +7296,7 @@ const tech = {
}
}
},
remove() { }
remove() {}
},
{
name: "facsimile",
@@ -7265,7 +7312,7 @@ const tech = {
effect() {
level.levels.splice(level.onLevel, 0, level.levels[level.onLevel]);
},
remove() { }
remove() {}
},
{
name: "negative friction",
@@ -7494,7 +7541,7 @@ const tech = {
effect: () => {
//setup audio context
function tone(frequency) {
const audioCtx = new (window.AudioContext || window.webkitAudioContext)();
const audioCtx = new(window.AudioContext || window.webkitAudioContext)();
const oscillator1 = audioCtx.createOscillator();
const gainNode1 = audioCtx.createGain();
gainNode1.gain.value = 0.5; //controls volume
@@ -7508,7 +7555,7 @@ const tech = {
// let sound = tone(1050)
function EBS() {
const audioCtx = new (window.AudioContext || window.webkitAudioContext)();
const audioCtx = new(window.AudioContext || window.webkitAudioContext)();
const oscillator1 = audioCtx.createOscillator();
const gainNode1 = audioCtx.createGain();
@@ -7573,7 +7620,7 @@ const tech = {
}, delay);
}, delay);
},
remove() { }
remove() {}
},
{
name: "automatic",
@@ -7616,7 +7663,7 @@ const tech = {
document.getElementById("health-bg").style.display = "none"
for (let i = 0; i < 15; i++) powerUps.spawn(m.pos.x + 160 * (Math.random() - 0.5), m.pos.y + 160 * (Math.random() - 0.5), "heal");
},
remove() { }
remove() {}
},
{
name: "not a bug",
@@ -7641,7 +7688,7 @@ const tech = {
// for (;;) {} //freezes the tab
},
remove() { }
remove() {}
},
{
name: "posture",
@@ -7681,7 +7728,7 @@ const tech = {
if (m.onGround && !m.crouch) m.yOffGoal = m.yOffWhen.stand
}, 100);
},
remove() { }
remove() {}
},
{
name: "spinor",
@@ -7697,7 +7744,7 @@ const tech = {
},
requires: "",
effect() {
m.look = function () {
m.look = function() {
//always on mouse look
m.angle = (((m.pos.x + m.pos.y) / 100 + Math.PI) % Math.PI * 2) - Math.PI
//smoothed mouse look translations
@@ -7754,7 +7801,7 @@ const tech = {
}
}, 1000); //every 1 seconds
},
remove() { }
remove() {}
},
// {
// name: "inverted mouse",
@@ -7825,7 +7872,7 @@ const tech = {
simulation.makeGunHUD()
powerUps.spawn(m.pos.x + 60 * (Math.random() - 0.5), m.pos.y + 60 * (Math.random() - 0.5), "gun");
},
remove() { }
remove() {}
},
{
name: "probability",
@@ -7855,7 +7902,7 @@ const tech = {
tech.tech[index].frequency = 100
}
},
remove() { }
remove() {}
},
{
name: "encryption",
@@ -7869,7 +7916,7 @@ const tech = {
allowed() { return true },
requires: "",
effect() {
String.prototype.shuffle = function () {
String.prototype.shuffle = function() {
var a = this.split(""),
n = a.length;
@@ -7884,7 +7931,7 @@ const tech = {
for (let i = 0, len = tech.tech.length; i < len; i++) tech.tech[i].name = tech.tech[i].name.shuffle()
},
remove() { }
remove() {}
},
{
name: "transparency",
@@ -7898,9 +7945,9 @@ const tech = {
allowed() { return true },
requires: "",
effect() {
m.draw = () => { }
m.draw = () => {}
},
remove() { }
remove() {}
},
{
name: "quantum leap",
@@ -7919,7 +7966,7 @@ const tech = {
simulation.trails()
}, 20000); //every 30 seconds
},
remove() { }
remove() {}
},
{
name: "score",
@@ -7938,7 +7985,7 @@ const tech = {
simulation.makeTextLog(`simulation.score <span class='color-symbol'>=</span> ${score.toFixed(0)}`);
}, 10000); //every 10 seconds
},
remove() { }
remove() {}
},
{
name: "pop-ups",
@@ -7956,7 +8003,7 @@ const tech = {
alert(`The best combo is ${tech.tech[Math.floor(Math.random() * tech.tech.length)].name} with ${tech.tech[Math.floor(Math.random() * tech.tech.length)].name}!`);
}, 30000); //every 30 seconds
},
remove() { }
remove() {}
},
{
name: "music",
@@ -7972,7 +8019,7 @@ const tech = {
effect() {
window.open('https://www.youtube.com/results?search_query=music', '_blank')
},
remove() { }
remove() {}
},
{
name: "performance",
@@ -7986,9 +8033,9 @@ const tech = {
allowed() { return true },
requires: "",
effect() {
(function () {
(function() {
var script = document.createElement('script');
script.onload = function () {
script.onload = function() {
var stats = new Stats();
document.body.appendChild(stats.dom);
requestAnimationFrame(function loop() {
@@ -8003,7 +8050,7 @@ const tech = {
document.getElementById("health").style.left = "86px"
document.getElementById("health-bg").style.left = "86px"
},
remove() { }
remove() {}
},
{
name: "repartitioning",
@@ -8026,7 +8073,7 @@ const tech = {
}
for (let i = 0; i < 5; i++) powerUps.spawn(m.pos.x, m.pos.y, "tech");
},
remove() { }
remove() {}
},
{
name: "defragment",
@@ -8044,7 +8091,7 @@ const tech = {
if (tech.tech[i].isJunk) tech.tech[i].frequency = 0
}
},
remove() { }
remove() {}
},
{
name: "ship",
@@ -8063,7 +8110,7 @@ const tech = {
m.shipMode()
level.difficultyDecrease(simulation.difficultyMode)
},
remove() { }
remove() {}
},
// {
// name: "lubrication",
@@ -8100,7 +8147,7 @@ const tech = {
effect() {
setInterval(() => { if (!simulation.paused) ctx.rotate(0.001 * Math.sin(simulation.cycle * 0.01)) }, 16);
},
remove() { }
remove() {}
},
{
name: "umbra",
@@ -8117,7 +8164,7 @@ const tech = {
ctx.shadowColor = '#06f';
ctx.shadowBlur = 25;
},
remove() { }
remove() {}
},
{
name: "lighter",
@@ -8135,7 +8182,7 @@ const tech = {
effect() {
ctx.globalCompositeOperation = "lighter";
},
remove() { }
remove() {}
},
{
name: "rewind",
@@ -8153,7 +8200,7 @@ const tech = {
setTimeout(() => { m.rewind(120) }, i * 5000);
}
},
remove() { }
remove() {}
},
{
name: "energy to mass conversion",
@@ -8181,7 +8228,7 @@ const tech = {
}
},
remove() { }
remove() {}
},
{
name: "level.nextLevel()",
@@ -8197,7 +8244,7 @@ const tech = {
effect() {
level.nextLevel();
},
remove() { }
remove() {}
},
{
name: "expert system",
@@ -8214,7 +8261,7 @@ const tech = {
powerUps.spawn(m.pos.x, m.pos.y, "tech");
tech.addJunkTechToPool(0.64)
},
remove() { }
remove() {}
},
{
name: "energy investment",
@@ -8238,7 +8285,7 @@ const tech = {
}, i * 10000);
}
},
remove() { }
remove() {}
},
{
name: "missile Launching System",
@@ -8262,7 +8309,7 @@ const tech = {
}, i * 1000);
}
},
remove() { }
remove() {}
},
{
name: "grenade production",
@@ -8287,7 +8334,7 @@ const tech = {
}, i * 1000);
}
},
remove() { }
remove() {}
},
// {
// name: "inverted input",
@@ -8327,7 +8374,7 @@ const tech = {
},
requires: "",
effect() {
m.draw = function () {
m.draw = function() {
ctx.fillStyle = m.fillColor;
m.walk_cycle += m.flipLegs * m.Vx;
@@ -8357,7 +8404,7 @@ const tech = {
m.yOff = m.yOff * 0.85 + m.yOffGoal * 0.15; //smoothly move leg height towards height goal
}
},
remove() { }
remove() {}
},
{
name: "diegesis",
@@ -8373,7 +8420,7 @@ const tech = {
},
requires: "",
effect() {
m.draw = function () {
m.draw = function() {
ctx.fillStyle = m.fillColor;
m.walk_cycle += m.flipLegs * m.Vx;
@@ -8398,7 +8445,7 @@ const tech = {
m.yOff = m.yOff * 0.85 + m.yOffGoal * 0.15; //smoothly move leg height towards height goal
}
},
remove() { }
remove() {}
},
{
name: "pareidolia",
@@ -8414,7 +8461,7 @@ const tech = {
},
requires: "",
effect() {
m.draw = function () {
m.draw = function() {
ctx.fillStyle = m.fillColor;
m.walk_cycle += m.flipLegs * m.Vx;
ctx.save();
@@ -8467,7 +8514,7 @@ const tech = {
m.yOff = m.yOff * 0.85 + m.yOffGoal * 0.15;
}
},
remove() { }
remove() {}
},
{
name: "prism",
@@ -8486,12 +8533,12 @@ const tech = {
sat: 100,
light: 50
}
setInterval(function () {
setInterval(function() {
m.color.hue++
m.setFillColors()
}, 10);
},
remove() { }
remove() {}
},
{
name: "assimilation",
@@ -8550,7 +8597,7 @@ const tech = {
const index = Math.floor(Math.random() * bots.length)
for (let i = 0; i < total; i++) bots[index]()
},
remove() { }
remove() {}
},
{
name: "growth hacking",
@@ -8566,7 +8613,7 @@ const tech = {
effect() {
level.difficultyIncrease(simulation.difficultyMode)
},
remove() { }
remove() {}
},
{
name: "stun",
@@ -8582,7 +8629,7 @@ const tech = {
effect() {
for (let i = 0; i < mob.length; i++) mobs.statusStun(mob[i], 480)
},
remove() { }
remove() {}
},
{
name: "re-arm",
@@ -8610,7 +8657,7 @@ const tech = {
}
simulation.makeGunHUD(); //update gun HUD
},
remove() { }
remove() {}
},
{
name: "re-research",
@@ -8632,7 +8679,7 @@ const tech = {
}
powerUps.research.count = 0
},
remove() { }
remove() {}
},
{
name: "quantum black hole",
@@ -8653,7 +8700,7 @@ const tech = {
powerUps.research.changeRerolls(-4)
simulation.makeTextLog(`<span class='color-var'>m</span>.<span class='color-r'>research</span> <span class='color-symbol'>--</span><br>${powerUps.research.count}`)
},
remove() { }
remove() {}
},
{
name: "black hole cluster",
@@ -8673,7 +8720,7 @@ const tech = {
spawn.sucker(where.x, where.y)
}
},
remove() { }
remove() {}
},
//**************************************************
//************************************************** undefined / lore
@@ -9036,5 +9083,6 @@ const tech = {
OccamDamage: null,
isAxion: null,
isWormholeMapIgnore: null,
isLessDamageReduction: null
isLessDamageReduction: null,
nailSize: null
}

View File

@@ -1,24 +1,35 @@
******************************************************** NEXT PATCH **************************************************
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)
pneumatic hammer (20 -> +18% size and damage effects)
now applies to nails, slugs, needles, in addition to rivets
integrated armament 20->25% damage, also if you switch guns converts guntech to new gun
backward induction removed
symbiosis removes 1 -> 0.5 max health per mob kill
plasma jet - costs 1 -> 2 research, and goes a bit farther
Occam's razor gives 36 -> 40% damage per removed tech
******************************************************** TODO ********************************************************
needle benefit from pneumatic hammer?
all nails?
total guntech:
nail gun needle @ 4
base nail gun @ 5
new late game level that is easier if you can: platform well, jump high, immune to slime, wormhole through walls, fly fast
climb vertically to avoid rising slime
populate with multiple boss mobs that can't drop tech
bosses spawn in pairs
antimatter (assuming something else isn't already named this); requires negative mass, causes damage to self and enemies within range while active
increase mass and movement speed at the same time
increase jump differently because it scales extra with mass
m.defaultMass = 4.5
m.definePlayerMass()
give history boss legs?
field tech - disable blocking, but does high damage to mobs inside field
and maybe slows mobs it damages