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,6 +314,16 @@ const b = {
dmg *= 1.6
}
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,
@@ -321,6 +331,9 @@ const b = {
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
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;

View File

@@ -177,13 +177,14 @@ const build = {
}
},
pauseGrid() {
const harm = (1 - mech.harmReduction()) * 100
let text = ""
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>`
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)}%
<br><strong class='color-harm'>harm</strong> reduction: ${((1-mech.harmReduction())*100).toFixed(0)}%
<br><strong><em>fire delay</em></strong> decrease: ${((1-b.fireCD)*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(b.fireCD < 0.1 ? 2 : 0)}%
<br><strong class='color-dup'>duplication</strong> chance: ${(Math.min(1,tech.duplicationChance())*100).toFixed(0)}%
<br>
<br><strong class='color-r'>research</strong>: ${powerUps.research.count}

View File

@@ -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
// }
}
}
// }

View File

@@ -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();

View File

@@ -384,7 +384,7 @@ const tech = {
},
{
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,
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: "<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",
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,
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: "<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,
maxCount: 1,
count: 0,
@@ -4146,5 +4162,6 @@ const tech = {
isRestHarm: null,
isFireMoveLock: null,
isRivets: null,
isNeedles: null
isNeedles: null,
isExplodeRadio: null
}

View File

@@ -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