radioactive explosions

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

squirrel cage - move even faster, but take 5% more harm

tech: iridium-192 - explosions are radioactive, +80% damage, spread over 4 seconds
This commit is contained in:
landgreen
2021-01-17 09:23:57 -08:00
parent 261977b774
commit 3657db7548
7 changed files with 138 additions and 73 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@@ -314,13 +314,26 @@ const b = {
dmg *= 1.6 dmg *= 1.6
} }
simulation.drawList.push({ //add dmg to draw queue
x: where.x, if (tech.isExplodeRadio) {
y: where.y, simulation.drawList.push({ //add dmg to draw queue
radius: radius, x: where.x,
color: "rgba(255,25,0,0.6)", y: where.y,
time: simulation.drawTime 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 const alertRange = 100 + radius * 2; //alert range
simulation.drawList.push({ //add alert to draw queue simulation.drawList.push({ //add alert to draw queue
@@ -342,14 +355,6 @@ const b = {
} else { } else {
mech.damage(radius * (tech.isExplosionHarm ? 0.0004 : 0.0001)); 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); knock = Vector.mult(Vector.normalise(sub), -Math.sqrt(dmg) * player.mass * 0.013);
player.force.x += knock.x; player.force.x += knock.x;
player.force.y += knock.y; player.force.y += knock.y;
@@ -398,7 +403,11 @@ const b = {
if (dist < radius) { if (dist < radius) {
if (mob[i].shield) dmg *= 2.5 //balancing explosion dmg to shields 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 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(); mob[i].locatePlayer();
knock = Vector.mult(Vector.normalise(sub), (-Math.sqrt(dmg * damageScale) * mob[i].mass) * 0.01); knock = Vector.mult(Vector.normalise(sub), (-Math.sqrt(dmg * damageScale) * mob[i].mass) * 0.01);
mob[i].force.x += knock.x; 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 player.force.y -= KNOCK * Math.sin(mech.angle) * 0.35 //reduce knock back in vertical direction to stop super jumps
pushAway(1200 * this.charge) pushAway(1200 * this.charge)
} else { // charging on mouse down } 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 mech.fireCDcycle = Infinity //can't fire until mouse is released
const previousCharge = this.charge 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 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); }, dmg, 0, true, 0.2);
for (let i = 1, len = 5 + tech.historyLaser * 5; i < len; i++) { for (let i = 1, len = 5 + tech.historyLaser * 5; i < len; i++) {
const history = mech.history[(mech.cycle - i * spacing) % 600] const history = mech.history[(mech.cycle - i * spacing) % 600]
const off = history.yOff - 24.2859
b.laser({ b.laser({
x: history.position.x + 20 * Math.cos(history.angle), 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), 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); }, dmg, 0, true, 0.2);
} }
ctx.strokeStyle = "#f00"; ctx.strokeStyle = "#f00";
@@ -4220,6 +4241,12 @@ const b = {
mech.health = history.health mech.health = history.health
mech.displayHealth(); mech.displayHealth();
} }
mech.yOff = history.yOff
if (mech.yOff < 48) {
mech.doCrouch()
} else {
mech.undoCrouch()
}
} }
} else { //button is held the first time } else { //button is held the first time
this.rewindCount = 0; this.rewindCount = 0;

View File

@@ -177,13 +177,14 @@ const build = {
} }
}, },
pauseGrid() { pauseGrid() {
const harm = (1 - mech.harmReduction()) * 100
let text = "" let text = ""
if (!simulation.isChoosing) text += `<div class="pause-grid-module"> if (!simulation.isChoosing) text += `<div class="pause-grid-module">
<span style="font-size:1.5em;font-weight: 600;">PAUSED</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; press P to resume</div>` <span style="font-size:1.5em;font-weight: 600;">PAUSED</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; press P to resume</div>`
text += `<div class="pause-grid-module" style = "font-size: 13px;line-height: 120%;padding: 5px;"> text += `<div class="pause-grid-module" style = "font-size: 13px;line-height: 120%;padding: 5px;">
<strong class='color-d'>damage</strong> increase: ${((tech.damageFromTech()-1)*100).toFixed(0)}% <strong class='color-d'>damage</strong> increase: ${((tech.damageFromTech()-1)*100).toFixed(0)}%
<br><strong class='color-harm'>harm</strong> reduction: ${((1-mech.harmReduction())*100).toFixed(0)}% <br><strong class='color-harm'>harm</strong> reduction: ${harm.toFixed(harm > 90 ? 2 : 0)}%
<br><strong><em>fire delay</em></strong> decrease: ${((1-b.fireCD)*100).toFixed(0)}% <br><strong><em>fire delay</em></strong> decrease: ${((1-b.fireCD)*100).toFixed(b.fireCD < 0.1 ? 2 : 0)}%
<br><strong class='color-dup'>duplication</strong> chance: ${(Math.min(1,tech.duplicationChance())*100).toFixed(0)}% <br><strong class='color-dup'>duplication</strong> chance: ${(Math.min(1,tech.duplicationChance())*100).toFixed(0)}%
<br> <br>
<br><strong class='color-r'>research</strong>: ${powerUps.research.count} <br><strong class='color-r'>research</strong>: ${powerUps.research.count}

View File

@@ -17,16 +17,17 @@ const level = {
// simulation.zoomScale = 1000; // simulation.zoomScale = 1000;
// simulation.setZoom(); // simulation.setZoom();
// mech.setField("plasma torch") // mech.setField("plasma torch")
// b.giveGuns("nail gun") // b.giveGuns("grenades")
// tech.giveTech("rivet gun") // tech.isExplodeRadio = true
// tech.giveTech("boom-bot")
// tech.giveTech("needle gun") // tech.giveTech("needle gun")
// tech.giveTech("supercritical fission") // tech.giveTech("supercritical fission")
// tech.giveTech("irradiated nails") // tech.giveTech("irradiated nails")
// tech.giveTech("4s half-life") // tech.giveTech("4s half-life")
// tech.giveTech("1/2s half-life") // tech.giveTech("CPT gun")
// tech.isMineSentry = true // 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("missile-bot")
// tech.giveTech("nail-bot") // tech.giveTech("nail-bot")
// for (let i = 0; i < 15; i++) tech.giveTech("plasma jet") // for (let i = 0; i < 15; i++) tech.giveTech("plasma jet")
@@ -671,6 +672,10 @@ const level = {
x: 2425, x: 2425,
y: -600 y: -600
}, -2 * Math.PI / 3) //up left }, -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 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 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) const door = level.door(312, -750, 25, 190, 185)
level.custom = () => { 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.query();
buttonDoor.draw(); buttonDoor.draw();
if (buttonDoor.isUp) { if (buttonDoor.isUp) {
@@ -837,9 +869,6 @@ const level = {
spawn.mapRect(1400, -2600, 375, 675); //right platform spawn.mapRect(1400, -2600, 375, 675); //right platform
spawn.mapRect(1925, -2600, 775, 675); //far right platform spawn.mapRect(1925, -2600, 775, 675); //far right platform
spawn.bodyRect(2130, -2660, 50, 50); //button's block 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(150, -2100, 200, 175);
spawn.mapRect(1050, -2100, 200, 175); spawn.mapRect(1050, -2100, 200, 175);
@@ -4404,11 +4433,12 @@ const level = {
} }
let v = Vector.mult(this.portalPair.unit, mag) let v = Vector.mult(this.portalPair.unit, mag)
Matter.Body.setVelocity(body[i], v); 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
// }
} }
} }
// } // }

View File

@@ -103,7 +103,8 @@ const mech = {
x: 0, x: 0,
y: 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 Sy: 0, //adds a smoothing effect to vertical only
Vx: 0, Vx: 0,
Vy: 0, Vy: 0,
@@ -146,9 +147,11 @@ const mech = {
x: player.velocity.x, x: player.velocity.x,
y: player.velocity.y y: player.velocity.y
}, },
yOff: mech.yOff,
angle: mech.angle, angle: mech.angle,
health: mech.health, health: mech.health,
energy: mech.energy, energy: mech.energy,
activeGun: b.activeGun
} }
} }
}, },
@@ -169,6 +172,7 @@ const mech = {
x: player.velocity.x, x: player.velocity.x,
y: player.velocity.y y: player.velocity.y
}, },
yOff: mech.yOff,
angle: mech.angle, angle: mech.angle,
health: mech.health, health: mech.health,
energy: mech.energy, energy: mech.energy,
@@ -493,6 +497,7 @@ const mech = {
harmReduction() { harmReduction() {
let dmg = 1 let dmg = 1
dmg *= mech.fieldHarmReduction 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.isSpeedHarm) dmg *= 1 - Math.min(player.speed * 0.0185, 0.55)
if (tech.isSlowFPS) dmg *= 0.8 if (tech.isSlowFPS) dmg *= 0.8
if (tech.isPiezo) dmg *= 0.85 if (tech.isPiezo) dmg *= 0.85
@@ -537,6 +542,12 @@ const mech = {
let history = mech.history[(mech.cycle - steps) % 600] let history = mech.history[(mech.cycle - steps) % 600]
Matter.Body.setPosition(player, history.position); Matter.Body.setPosition(player, history.position);
Matter.Body.setVelocity(player, { x: history.velocity.x, y: history.velocity.y }); 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 // b.activeGun = history.activeGun
// for (let i = 0; i < b.inventory.length; i++) { // for (let i = 0; i < b.inventory.length; i++) {
@@ -579,7 +590,8 @@ const mech = {
for (let i = 1; i < steps; i++) { for (let i = 1; i < steps; i++) {
history = mech.history[(mech.cycle - i) % 600] history = mech.history[(mech.cycle - i) % 600]
mech.pos.x = history.position.x 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(); mech.draw();
} }
ctx.restore(); ctx.restore();

View File

@@ -384,7 +384,7 @@ const tech = {
}, },
{ {
name: "squirrel-cage rotor", name: "squirrel-cage rotor",
description: "<strong>move</strong> and <strong>jump</strong> about <strong>25%</strong> faster", description: "<strong>move</strong> and <strong>jump</strong> about <strong>30%</strong> faster<br>but you take <strong>5%</strong> more <strong class='color-harm'>harm</strong>",
maxCount: 9, maxCount: 9,
count: 0, count: 0,
allowed() { allowed() {
@@ -392,8 +392,8 @@ const tech = {
}, },
requires: "", requires: "",
effect() { // good with melee builds, content skipping builds effect() { // good with melee builds, content skipping builds
tech.squirrelFx += 0.2; tech.squirrelFx += 0.25;
tech.squirrelJump += 0.09; tech.squirrelJump += 0.1;
mech.setMovement() mech.setMovement()
}, },
remove() { remove() {
@@ -501,6 +501,22 @@ const tech = {
b.setFireCD(); b.setFireCD();
} }
}, },
{
name: "iridium-192",
description: "<strong class='color-e'>explosions</strong> release <strong class='color-p'>gamma radiation</strong><br><strong>80%</strong> more <strong class='color-d'>damage</strong> 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", name: "ammonium nitrate",
description: "increase <strong class='color-e'>explosive</strong> <strong class='color-d'>damage</strong> by <strong>20%</strong><br>increase <strong class='color-e'>explosive</strong> <strong>radius</strong> by <strong>20%</strong>", description: "increase <strong class='color-e'>explosive</strong> <strong class='color-d'>damage</strong> by <strong>20%</strong><br>increase <strong class='color-e'>explosive</strong> <strong>radius</strong> by <strong>20%</strong>",
@@ -2156,7 +2172,7 @@ const tech = {
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
return tech.isNailRadiation || tech.isWormholeDamage || tech.isNeutronBomb return tech.isNailRadiation || tech.isWormholeDamage || tech.isNeutronBomb || tech.isExplodeRadio
}, },
requires: "radiation damage source", requires: "radiation damage source",
effect() { effect() {
@@ -2207,9 +2223,9 @@ const tech = {
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { 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() { effect() {
tech.isNeedles = true tech.isNeedles = true
for (i = 0, len = b.guns.length; i < len; i++) { //find which gun for (i = 0, len = b.guns.length; i < len; i++) { //find which gun
@@ -2244,9 +2260,9 @@ const tech = {
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { 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() { effect() {
tech.isRivets = true tech.isRivets = true
for (i = 0, len = b.guns.length; i < len; i++) { //find which gun for (i = 0, len = b.guns.length; i < len; i++) { //find which gun
@@ -2378,7 +2394,7 @@ const tech = {
maxCount: 1, maxCount: 1,
count: 0, count: 0,
allowed() { allowed() {
return tech.haveGunCheck("nail gun") && !tech.isIceCrystals return (tech.nailBotCount > 2 || tech.haveGunCheck("nail gun")) && !tech.isIceCrystals
}, },
requires: "nail gun, not ice crystals", requires: "nail gun, not ice crystals",
effect() { effect() {
@@ -2424,7 +2440,7 @@ const tech = {
}, },
{ {
name: "1/2s half-life", name: "1/2s half-life",
description: "<strong>nails</strong> are made of <strong class='color-p'>lithium-8</strong><br>flechette <strong class='color-d'>damage</strong> occurs after <strong>1/2</strong> a second", description: "<strong>nails</strong> are made of <strong class='color-p'>lithium-8</strong><br><strong class='color-d'>damage</strong> occurs after <strong>1/2</strong> a second",
isGunTech: true, isGunTech: true,
maxCount: 1, maxCount: 1,
count: 0, count: 0,
@@ -4146,5 +4162,6 @@ const tech = {
isRestHarm: null, isRestHarm: null,
isFireMoveLock: null, isFireMoveLock: null,
isRivets: null, isRivets: null,
isNeedles: null isNeedles: null,
isExplodeRadio: null
} }

View File

@@ -1,33 +1,17 @@
******************************************************** NEXT PATCH ******************************************************** ******************************************************** NEXT PATCH ********************************************************
damage immunity graphic is more obvious various bug fixes
difficulty mode no longer increases after killing final boss (it was too confusing) 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 squirrel cage - move even faster, but take 5% more harm
removed Galilean group
removed gun flechettes tech: iridium-192 - explosions are radioactive, +80% damage, spread over 4 seconds
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)
******************************************************** BUGS ******************************************************** ******************************************************** 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) 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 (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 ******************************************************** ******************************************************** 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 tech: double your rerolls
set your duplication chance to zero set your duplication chance to zero
requires 5 rerolls and 20% duplication chance requires 5 rerolls and 20% duplication chance