diff --git a/.DS_Store b/.DS_Store
index 20686d1..c965d31 100644
Binary files a/.DS_Store and b/.DS_Store differ
diff --git a/js/bullet.js b/js/bullet.js
index 1ad262b..cb2d337 100644
--- a/js/bullet.js
+++ b/js/bullet.js
@@ -314,13 +314,26 @@ const b = {
dmg *= 1.6
}
- simulation.drawList.push({ //add dmg to draw queue
- x: where.x,
- y: where.y,
- radius: radius,
- color: "rgba(255,25,0,0.6)",
- time: simulation.drawTime
- });
+
+ if (tech.isExplodeRadio) {
+ simulation.drawList.push({ //add dmg to draw queue
+ x: where.x,
+ y: where.y,
+ radius: radius,
+ color: "rgba(25,139,170,0.45)",
+ time: simulation.drawTime
+ });
+ } else {
+ simulation.drawList.push({ //add dmg to draw queue
+ x: where.x,
+ y: where.y,
+ radius: radius,
+ color: "rgba(255,25,0,0.6)",
+ time: simulation.drawTime
+ });
+ }
+
+
const alertRange = 100 + radius * 2; //alert range
simulation.drawList.push({ //add alert to draw queue
@@ -342,14 +355,6 @@ const b = {
} else {
mech.damage(radius * (tech.isExplosionHarm ? 0.0004 : 0.0001));
}
- // if (!(tech.isImmuneExplosion && mech.energy > 0.97)) {
- // if (tech.isExplosionHarm) {
- // mech.damage(radius * 0.0004); //300% more player damage from explosions
- // } else {
- // mech.damage(radius * 0.0001); //normal player damage from explosions
- // }
- // mech.drop();
- // }
knock = Vector.mult(Vector.normalise(sub), -Math.sqrt(dmg) * player.mass * 0.013);
player.force.x += knock.x;
player.force.y += knock.y;
@@ -398,7 +403,11 @@ const b = {
if (dist < radius) {
if (mob[i].shield) dmg *= 2.5 //balancing explosion dmg to shields
if (Matter.Query.ray(map, mob[i].position, where).length > 0) dmg *= 0.5 //reduce damage if a wall is in the way
- mob[i].damage(dmg * damageScale * b.dmgScale);
+ if (tech.isExplodeRadio) {
+ mobs.statusDoT(mob[i], dmg * damageScale * 0.25, 240) //apply radiation damage status effect on direct hits
+ } else {
+ mob[i].damage(dmg * damageScale * b.dmgScale);
+ }
mob[i].locatePlayer();
knock = Vector.mult(Vector.normalise(sub), (-Math.sqrt(dmg * damageScale) * mob[i].mass) * 0.01);
mob[i].force.x += knock.x;
@@ -3887,6 +3896,17 @@ const b = {
player.force.y -= KNOCK * Math.sin(mech.angle) * 0.35 //reduce knock back in vertical direction to stop super jumps
pushAway(1200 * this.charge)
} else { // charging on mouse down
+
+ if (tech.isFireMoveLock) {
+ Matter.Body.setVelocity(player, {
+ x: 0,
+ y: -55 * player.mass * simulation.g //undo gravity before it is added
+ });
+ player.force.x = 0
+ player.force.y = 0
+ }
+
+
mech.fireCDcycle = Infinity //can't fire until mouse is released
const previousCharge = this.charge
let smoothRate = 0.98 * (mech.crouch ? 0.99 : 1) * (0.98 + 0.02 * b.fireCD) //small b.fireCD = faster shots, b.fireCD=1 = normal shot, big b.fireCD = slower chot
@@ -4162,12 +4182,13 @@ const b = {
}, dmg, 0, true, 0.2);
for (let i = 1, len = 5 + tech.historyLaser * 5; i < len; i++) {
const history = mech.history[(mech.cycle - i * spacing) % 600]
+ const off = history.yOff - 24.2859
b.laser({
x: history.position.x + 20 * Math.cos(history.angle),
- y: history.position.y + 20 * Math.sin(history.angle) - mech.yPosDifference
+ y: history.position.y + 20 * Math.sin(history.angle) - off
}, {
x: history.position.x + 3000 * Math.cos(history.angle),
- y: history.position.y + 3000 * Math.sin(history.angle) - mech.yPosDifference
+ y: history.position.y + 3000 * Math.sin(history.angle) - off
}, dmg, 0, true, 0.2);
}
ctx.strokeStyle = "#f00";
@@ -4220,6 +4241,12 @@ const b = {
mech.health = history.health
mech.displayHealth();
}
+ mech.yOff = history.yOff
+ if (mech.yOff < 48) {
+ mech.doCrouch()
+ } else {
+ mech.undoCrouch()
+ }
}
} else { //button is held the first time
this.rewindCount = 0;
diff --git a/js/index.js b/js/index.js
index 8df2cd6..c724784 100644
--- a/js/index.js
+++ b/js/index.js
@@ -177,13 +177,14 @@ const build = {
}
},
pauseGrid() {
+ const harm = (1 - mech.harmReduction()) * 100
let text = ""
if (!simulation.isChoosing) text += `
PAUSED press P to resume
`
text += `
damage increase: ${((tech.damageFromTech()-1)*100).toFixed(0)}%
-
harm reduction: ${((1-mech.harmReduction())*100).toFixed(0)}%
-
fire delay decrease: ${((1-b.fireCD)*100).toFixed(0)}%
+
harm reduction: ${harm.toFixed(harm > 90 ? 2 : 0)}%
+
fire delay decrease: ${((1-b.fireCD)*100).toFixed(b.fireCD < 0.1 ? 2 : 0)}%
duplication chance: ${(Math.min(1,tech.duplicationChance())*100).toFixed(0)}%
research: ${powerUps.research.count}
diff --git a/js/level.js b/js/level.js
index 06607a5..e1c1439 100644
--- a/js/level.js
+++ b/js/level.js
@@ -17,16 +17,17 @@ const level = {
// simulation.zoomScale = 1000;
// simulation.setZoom();
// mech.setField("plasma torch")
- // b.giveGuns("nail gun")
- // tech.giveTech("rivet gun")
+ // b.giveGuns("grenades")
+ // tech.isExplodeRadio = true
+ // tech.giveTech("boom-bot")
// tech.giveTech("needle gun")
// tech.giveTech("supercritical fission")
// tech.giveTech("irradiated nails")
// tech.giveTech("4s half-life")
- // tech.giveTech("1/2s half-life")
+ // tech.giveTech("CPT gun")
// tech.isMineSentry = true
- // for (let i = 0; i < 60; i++) tech.giveTech("output coupler")
+ // for (let i = 0; i < 60; i++) tech.giveTech("rivet diameter")
// tech.giveTech("missile-bot")
// tech.giveTech("nail-bot")
// for (let i = 0; i < 15; i++) tech.giveTech("plasma jet")
@@ -671,6 +672,10 @@ const level = {
x: 2425,
y: -600
}, -2 * Math.PI / 3) //up left
+ spawn.mapRect(0, -1955, 175, 30);
+ const removeIndex1 = map.length - 1 //so much work to catch blocks caught at the bottom of the vertical portals
+ spawn.mapRect(1225, -1955, 175, 30);
+ const removeIndex2 = map.length - 1 //so much work to catch blocks caught at the bottom of the vertical portals
const hazard = level.hazard(350, -2025, 700, 10, 0.4, "hsl(0, 100%, 50%)", true) //laser
const hazard2 = level.hazard(1775, -2550, 150, 10, 0.4, "hsl(0, 100%, 50%)", true) //laser
@@ -682,6 +687,33 @@ const level = {
const door = level.door(312, -750, 25, 190, 185)
level.custom = () => {
+ if (!(mech.cycle % 60)) { //so much work to catch blocks caught at the bottom of the vertical portals
+ let touching = Matter.Query.collides(map[removeIndex1], body)
+ if (touching.length) {
+ // console.log(touching[0].bodyB)
+ Matter.World.remove(engine.world, touching[0].bodyB);
+ for (let i = 0, len = body.length; i < len; i++) {
+ if (body[i].id === touching[0].bodyB.id) {
+ body.splice(i, 1);
+ break
+ }
+ }
+ //
+ }
+ touching = Matter.Query.collides(map[removeIndex2], body)
+ if (touching.length) {
+ // console.log(touching[0].bodyB)
+ Matter.World.remove(engine.world, touching[0].bodyB);
+ for (let i = 0, len = body.length; i < len; i++) {
+ if (body[i].id === touching[0].bodyB.id) {
+ body.splice(i, 1);
+ break
+ }
+ }
+ }
+ }
+
+
buttonDoor.query();
buttonDoor.draw();
if (buttonDoor.isUp) {
@@ -837,9 +869,6 @@ const level = {
spawn.mapRect(1400, -2600, 375, 675); //right platform
spawn.mapRect(1925, -2600, 775, 675); //far right platform
spawn.bodyRect(2130, -2660, 50, 50); //button's block
-
- spawn.mapRect(0, -1975, 175, 50);
- spawn.mapRect(1225, -1975, 175, 50);
spawn.mapRect(150, -2100, 200, 175);
spawn.mapRect(1050, -2100, 200, 175);
@@ -4404,11 +4433,12 @@ const level = {
}
let v = Vector.mult(this.portalPair.unit, mag)
Matter.Body.setVelocity(body[i], v);
- } else if (body[i].speed < 0.1) { //touching this portal and very slow
- Matter.World.remove(engine.world, body[i]);
- body.splice(i, 1);
- break
}
+ // else if (body[i].speed < 0.1) { //touching this portal and very slow
+ // Matter.World.remove(engine.world, body[i]);
+ // body.splice(i, 1);
+ // break
+ // }
}
}
// }
diff --git a/js/player.js b/js/player.js
index c8af914..9c4d0e8 100644
--- a/js/player.js
+++ b/js/player.js
@@ -103,7 +103,8 @@ const mech = {
x: 0,
y: 0
},
- yPosDifference: 24.285923217549026, //player.position.y - mech.pos.y
+ yPosDifference: 24.2859, //player.position.y - mech.pos.y //24.285923217549026
+ // yPosDifferenceCrouched: -2.7140767824453604,
Sy: 0, //adds a smoothing effect to vertical only
Vx: 0,
Vy: 0,
@@ -146,9 +147,11 @@ const mech = {
x: player.velocity.x,
y: player.velocity.y
},
+ yOff: mech.yOff,
angle: mech.angle,
health: mech.health,
energy: mech.energy,
+ activeGun: b.activeGun
}
}
},
@@ -169,6 +172,7 @@ const mech = {
x: player.velocity.x,
y: player.velocity.y
},
+ yOff: mech.yOff,
angle: mech.angle,
health: mech.health,
energy: mech.energy,
@@ -493,6 +497,7 @@ const mech = {
harmReduction() {
let dmg = 1
dmg *= mech.fieldHarmReduction
+ if (tech.squirrelFx !== 1) dmg *= 1 + (tech.squirrelFx - 1) / 5 //cause more damage
if (tech.isSpeedHarm) dmg *= 1 - Math.min(player.speed * 0.0185, 0.55)
if (tech.isSlowFPS) dmg *= 0.8
if (tech.isPiezo) dmg *= 0.85
@@ -537,6 +542,12 @@ const mech = {
let history = mech.history[(mech.cycle - steps) % 600]
Matter.Body.setPosition(player, history.position);
Matter.Body.setVelocity(player, { x: history.velocity.x, y: history.velocity.y });
+ mech.yOff = history.yOff
+ if (mech.yOff < 48) {
+ mech.doCrouch()
+ } else {
+ mech.undoCrouch()
+ }
// b.activeGun = history.activeGun
// for (let i = 0; i < b.inventory.length; i++) {
@@ -579,7 +590,8 @@ const mech = {
for (let i = 1; i < steps; i++) {
history = mech.history[(mech.cycle - i) % 600]
mech.pos.x = history.position.x
- mech.pos.y = history.position.y
+ mech.pos.y = history.position.y + mech.yPosDifference - history.yOff
+ mech.yOff = history.yOff
mech.draw();
}
ctx.restore();
diff --git a/js/tech.js b/js/tech.js
index e1e9688..08bdd9d 100644
--- a/js/tech.js
+++ b/js/tech.js
@@ -384,7 +384,7 @@ const tech = {
},
{
name: "squirrel-cage rotor",
- description: "move and jump about 25% faster",
+ description: "move and jump about 30% faster
but you take 5% more harm",
maxCount: 9,
count: 0,
allowed() {
@@ -392,8 +392,8 @@ const tech = {
},
requires: "",
effect() { // good with melee builds, content skipping builds
- tech.squirrelFx += 0.2;
- tech.squirrelJump += 0.09;
+ tech.squirrelFx += 0.25;
+ tech.squirrelJump += 0.1;
mech.setMovement()
},
remove() {
@@ -501,6 +501,22 @@ const tech = {
b.setFireCD();
}
},
+ {
+ name: "iridium-192",
+ description: "explosions release gamma radiation
80% more damage over 4 seconds",
+ maxCount: 1,
+ count: 0,
+ allowed() {
+ return tech.haveGunCheck("missiles") || tech.isIncendiary || (tech.haveGunCheck("grenades") && !tech.isNeutronBomb) || tech.haveGunCheck("vacuum bomb") || tech.isPulseLaser || tech.isMissileField || tech.boomBotCount > 1
+ },
+ requires: "an explosive damage source",
+ effect: () => {
+ tech.isExplodeRadio = true;
+ },
+ remove() {
+ tech.isExplodeRadio = false;
+ }
+ },
{
name: "ammonium nitrate",
description: "increase explosive damage by 20%
increase explosive radius by 20%",
@@ -2156,7 +2172,7 @@ const tech = {
maxCount: 1,
count: 0,
allowed() {
- return tech.isNailRadiation || tech.isWormholeDamage || tech.isNeutronBomb
+ return tech.isNailRadiation || tech.isWormholeDamage || tech.isNeutronBomb || tech.isExplodeRadio
},
requires: "radiation damage source",
effect() {
@@ -2207,9 +2223,9 @@ const tech = {
maxCount: 1,
count: 0,
allowed() {
- return tech.haveGunCheck("nail gun") && !tech.nailFireRate && !tech.isIceCrystals
+ return tech.haveGunCheck("nail gun") && !tech.nailFireRate && !tech.isIceCrystals && !tech.isRivets
},
- requires: "nail gun, not ice crystal or pneumatic actuator",
+ requires: "nail gun, not ice crystal, rivets, or pneumatic actuator",
effect() {
tech.isNeedles = true
for (i = 0, len = b.guns.length; i < len; i++) { //find which gun
@@ -2244,9 +2260,9 @@ const tech = {
maxCount: 1,
count: 0,
allowed() {
- return tech.haveGunCheck("nail gun") && !tech.nailFireRate && !tech.isIceCrystals
+ return tech.haveGunCheck("nail gun") && !tech.nailFireRate && !tech.isIceCrystals && !tech.isNeedles
},
- requires: "nail gun, not ice crystal or pneumatic actuator",
+ requires: "nail gun, not ice crystal, needles, or pneumatic actuator",
effect() {
tech.isRivets = true
for (i = 0, len = b.guns.length; i < len; i++) { //find which gun
@@ -2378,7 +2394,7 @@ const tech = {
maxCount: 1,
count: 0,
allowed() {
- return tech.haveGunCheck("nail gun") && !tech.isIceCrystals
+ return (tech.nailBotCount > 2 || tech.haveGunCheck("nail gun")) && !tech.isIceCrystals
},
requires: "nail gun, not ice crystals",
effect() {
@@ -2424,7 +2440,7 @@ const tech = {
},
{
name: "1/2s half-life",
- description: "nails are made of lithium-8
flechette damage occurs after 1/2 a second",
+ description: "nails are made of lithium-8
damage occurs after 1/2 a second",
isGunTech: true,
maxCount: 1,
count: 0,
@@ -4146,5 +4162,6 @@ const tech = {
isRestHarm: null,
isFireMoveLock: null,
isRivets: null,
- isNeedles: null
+ isNeedles: null,
+ isExplodeRadio: null
}
\ No newline at end of file
diff --git a/todo.txt b/todo.txt
index d2fc1dd..2fdcb6f 100644
--- a/todo.txt
+++ b/todo.txt
@@ -1,33 +1,17 @@
******************************************************** NEXT PATCH ********************************************************
-damage immunity graphic is more obvious
-difficulty mode no longer increases after killing final boss (it was too confusing)
+various bug fixes
+ Laser+slow light prop+crouch= all but one laser stays in original position
+ CPT rewind and gun: correctly put you back into a crouch position
+ Higgs + rail gun allows movement
+ blocks don't linger at the bottom of portals anymore
-tech: Higgs mechanism - you can't move when firing, reduce harm by 60% when firing
- removed Galilean group
+squirrel cage - move even faster, but take 5% more harm
-removed gun flechettes
-removed critical bifrication
-removed railroad ties
-removed incendiary (for nail gun)
-
-nail gun:
- needle gun: accurate, piercing mobs, fire 3 at a time
- rivet gun: accurate, ballistic arc, doesn't use much ammo
- tech: bigger rivets (9x stack)
- all nails
- radioactive 2s tick (about 70% damage increase)
- 0.5s full tick
- 4s longer tick
- critical hits -> explosion (from flechettes)
+tech: iridium-192 - explosions are radioactive, +80% damage, spread over 4 seconds
******************************************************** BUGS ********************************************************
-Laser+slow light prop+crouch= all but one laser stays in original position
- log crouch state and apply that to laser, rewind
-
-CPT check for crouch after rewind
-
(always) make it so that when you are immune to harm you can either jump on mobs or you pass through them
(always) is there a way to check if the player is stuck inside the map or block
@@ -43,12 +27,6 @@ CPT check for crouch after rewind
******************************************************** TODO ********************************************************
-tech: increase maxHealth by 100%, but you can no longer see your health
-
-modify tech: increase squirrel cage speed, but also increase harm taken by 5-10%
-
-tech: explosions are radioactive
-
tech: double your rerolls
set your duplication chance to zero
requires 5 rerolls and 20% duplication chance