electric armor

electric reactive armor renamed electric armor
  reduce harm from explosions by 99%, drain 15 energy,
  and greatly increase knock back
  it does look like you can go through some thin walls,
    but that's how it is in the real world, so not a bug

grenades have 40% more ammo

time dilation generates 12->18 energy/s
This commit is contained in:
landgreen
2022-05-06 06:30:22 -07:00
parent f412e029f5
commit d74e7b53fe
6 changed files with 49 additions and 47 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@@ -378,7 +378,6 @@ const b = {
//player damage //player damage
if (Vector.magnitude(Vector.sub(where, player.position)) < radius) { if (Vector.magnitude(Vector.sub(where, player.position)) < radius) {
const DRAIN = (tech.isExplosionHarm ? 0.9 : 0.45) * (tech.isRadioactiveResistance ? 0.25 : 1) const DRAIN = (tech.isExplosionHarm ? 0.9 : 0.45) * (tech.isRadioactiveResistance ? 0.25 : 1)
// * (tech.isImmuneExplosion ? Math.min(1, Math.max(1 - m.energy * 0.7, 0)) : 1)
if (m.immuneCycle < m.cycle) m.energy -= DRAIN if (m.immuneCycle < m.cycle) m.energy -= DRAIN
if (m.energy < 0) { if (m.energy < 0) {
m.energy = 0 m.energy = 0
@@ -426,16 +425,23 @@ const b = {
dist = Vector.magnitude(sub); dist = Vector.magnitude(sub);
if (dist < radius) { if (dist < radius) {
const harm = radius * (tech.isExplosionHarm ? 0.00036 : 0.00018) if (simulation.dmgScale) {
if (tech.isImmuneExplosion) { const harm = radius * (tech.isExplosionHarm ? 0.00036 : 0.00018)
const mitigate = Math.min(1, Math.max(1 - m.energy * 0.5, 0)) if (tech.isImmuneExplosion && m.energy > 0.15) {
if (simulation.dmgScale) m.damage(mitigate * harm); // const mitigate = Math.min(1, Math.max(1 - m.energy * 0.5, 0))
} else { m.energy -= 0.15
if (simulation.dmgScale) m.damage(harm); m.damage(0.01 * harm); //remove 99% of the damage 1-0.99
console.log(Math.max(0, Math.min(0.15 - 0.01 * player.speed, 0.15)))
knock = Vector.mult(Vector.normalise(sub), -player.mass * Math.max(0, Math.min(0.15 - 0.002 * player.speed, 0.15)));
player.force.x = knock.x; // not += so crazy forces can't build up with MIRV
player.force.y = knock.y;
} else {
if (simulation.dmgScale) m.damage(harm);
knock = Vector.mult(Vector.normalise(sub), -Math.sqrt(dmg) * player.mass * 0.013);
player.force.x += knock.x;
player.force.y += knock.y;
}
} }
knock = Vector.mult(Vector.normalise(sub), -Math.sqrt(dmg) * player.mass * 0.013);
player.force.x += knock.x;
player.force.y += knock.y;
} else if (dist < alertRange) { } else if (dist < alertRange) {
knock = Vector.mult(Vector.normalise(sub), -Math.sqrt(dmg) * player.mass * 0.005); knock = Vector.mult(Vector.normalise(sub), -Math.sqrt(dmg) * player.mass * 0.005);
player.force.x += knock.x; player.force.x += knock.x;
@@ -4529,11 +4535,11 @@ const b = {
const distanceToPlayer = Vector.magnitude(Vector.sub(this.position, player.position)) const distanceToPlayer = Vector.magnitude(Vector.sub(this.position, player.position))
if (distanceToPlayer > 100) { //if far away move towards player if (distanceToPlayer > 100) { //if far away move towards player
if (this.explode) { if (this.explode) {
if (tech.isImmuneExplosion && m.energy > 1.43) { // if (tech.isImmuneExplosion && m.energy > 1.43) {
b.explosion(this.position, this.explode); // b.explosion(this.position, this.explode);
} else { // } else {
b.explosion(this.position, Math.max(0, Math.min(this.explode, (distanceToPlayer - 70) / b.explosionRange()))); // }
} b.explosion(this.position, Math.max(0, Math.min(this.explode, (distanceToPlayer - 70) / b.explosionRange())));
this.explode = 0; this.explode = 0;
} }
this.force = Vector.mult(Vector.normalise(Vector.sub(player.position, this.position)), this.mass * this.acceleration) this.force = Vector.mult(Vector.normalise(Vector.sub(player.position, this.position)), this.mass * this.acceleration)
@@ -5922,7 +5928,7 @@ const b = {
name: "grenades", name: "grenades",
description: "lob a single <strong>bouncy</strong> projectile<br><strong class='color-e'>explodes</strong> on <strong>contact</strong> or after one second", description: "lob a single <strong>bouncy</strong> projectile<br><strong class='color-e'>explodes</strong> on <strong>contact</strong> or after one second",
ammo: 0, ammo: 0,
ammoPack: 5, ammoPack: 7,
have: false, have: false,
do() {}, //do is set in b.setGrenadeMode() do() {}, //do is set in b.setGrenadeMode()
fire() { fire() {

View File

@@ -17,10 +17,10 @@ const level = {
if (level.levelsCleared === 0) { //this code only runs on the first level if (level.levelsCleared === 0) { //this code only runs on the first level
// simulation.isHorizontalFlipped = true // simulation.isHorizontalFlipped = true
// m.setField("time dilation") // m.setField("time dilation")
// b.giveGuns("foam") // b.giveGuns("grenades")
// tech.giveTech("rocket-propelled grenade") // tech.giveTech("rocket-propelled grenade")
// tech.giveTech("needle gun") // tech.giveTech("electric armor")
// tech.giveTech("rivet gun") // tech.giveTech("MIRV")
// tech.giveTech("capacitor bank") // tech.giveTech("capacitor bank")
// tech.giveTech("rotary cannon") // tech.giveTech("rotary cannon")
// tech.giveTech("pneumatic actuator") // tech.giveTech("pneumatic actuator")
@@ -37,7 +37,7 @@ const level = {
// m.immuneCycle = Infinity //you can't take damage // m.immuneCycle = Infinity //you can't take damage
// level.difficultyIncrease(15) //30 is near max on hard //60 is near max on why // level.difficultyIncrease(15) //30 is near max on hard //60 is near max on why
// simulation.enableConstructMode() //used to build maps in testing mode // simulation.enableConstructMode() //used to build maps in testing mode
// level.labs(); // level.warehouse();
// level.testing(); //not in rotation, used for testing // level.testing(); //not in rotation, used for testing
if (simulation.isTraining) { level.walk(); } else { level.intro(); } //normal starting level ************************************************ if (simulation.isTraining) { level.walk(); } else { level.intro(); } //normal starting level ************************************************
// powerUps.research.changeRerolls(3000) // powerUps.research.changeRerolls(3000)
@@ -5217,13 +5217,13 @@ const level = {
spawn.mapRect(-1900, -600, 1775, 100); spawn.mapRect(-1900, -600, 1775, 100);
spawn.mapRect(-1900, -550, 100, 1250); spawn.mapRect(-1900, -550, 100, 1250);
//house //house
spawn.mapRect(-175, -550, 50, 400); spawn.mapRect(-225, -550, 100, 400);
spawn.mapRect(-175, -10, 350, 50); spawn.mapRect(-225, -10, 400, 50);
spawn.mapRect(-25, -20, 100, 50); spawn.mapRect(-25, -20, 100, 50);
//exit house //exit house
spawn.mapRect(300, -10, 350, 50); spawn.mapRect(300, -10, 350, 50);
spawn.mapRect(-150, -300, 800, 50); spawn.mapRect(-150, -350, 800, 100);
spawn.mapRect(600, -275, 50, 75); spawn.mapRect(600, -275, 50, 75);
spawn.mapRect(425, -20, 100, 25); spawn.mapRect(425, -20, 100, 25);
// spawn.mapRect(-1900, 600, 2700, 100); // spawn.mapRect(-1900, 600, 2700, 100);
@@ -5324,10 +5324,10 @@ const level = {
Composite.add(engine.world, cons[cons.length - 1]); Composite.add(engine.world, cons[cons.length - 1]);
} }
//blocks //blocks
spawn.bodyRect(-165, -150, 30, 35, 1); spawn.bodyRect(-212, -150, 30, 35, 1);
spawn.bodyRect(-165, -115, 30, 35, 1); spawn.bodyRect(-212, -115, 30, 35, 1);
spawn.bodyRect(-165, -80, 30, 35, 1); spawn.bodyRect(-212, -80, 30, 35, 1);
spawn.bodyRect(-165, -45, 30, 35, 1); spawn.bodyRect(-212, -45, 30, 35, 1);
spawn.bodyRect(-750, 400, 150, 150, 0.5); spawn.bodyRect(-750, 400, 150, 150, 0.5);
spawn.bodyRect(-400, 1175, 100, 250, 1); //block to get to top path on bottom level spawn.bodyRect(-400, 1175, 100, 250, 1); //block to get to top path on bottom level

View File

@@ -2477,7 +2477,7 @@ const m = {
{ {
name: "time dilation", name: "time dilation",
// description: "use <strong class='color-f'>energy</strong> to <strong style='letter-spacing: 1px;'>stop time</strong><br>while time is stopped you can <strong>move</strong> and <strong>fire</strong><br>and <strong>collisions</strong> do <strong>50%</strong> less <strong class='color-harm'>harm</strong>", // description: "use <strong class='color-f'>energy</strong> to <strong style='letter-spacing: 1px;'>stop time</strong><br>while time is stopped you can <strong>move</strong> and <strong>fire</strong><br>and <strong>collisions</strong> do <strong>50%</strong> less <strong class='color-harm'>harm</strong>",
description: "use <strong class='color-f'>energy</strong> to <strong style='letter-spacing: 2px;'>stop time</strong><br>for everything except you<br>generate <strong>12</strong> <strong class='color-f'>energy</strong>/second", description: "use <strong class='color-f'>energy</strong> to <strong style='letter-spacing: 2px;'>stop time</strong><br>for everything except you<br>generate <strong>18</strong> <strong class='color-f'>energy</strong>/second",
set() { set() {
if (tech.isRewindField) { if (tech.isRewindField) {
this.rewindCount = 0 this.rewindCount = 0
@@ -2637,6 +2637,7 @@ const m = {
m.holdingTarget = null; //clears holding target (this is so you only pick up right after the field button is released and a hold target exists) m.holdingTarget = null; //clears holding target (this is so you only pick up right after the field button is released and a hold target exists)
} }
if (m.energy < m.maxEnergy) m.regenEnergy(); //extra energy regen if (m.energy < m.maxEnergy) m.regenEnergy(); //extra energy regen
if (m.energy < m.maxEnergy) m.regenEnergy(); //extra energy regen
m.drawFieldMeter() m.drawFieldMeter()
} }
} }

View File

@@ -4812,9 +4812,9 @@ const tech = {
} }
}, },
{ {
name: "electric reactive armor", name: "electric armor",
// description: "<strong class='color-e'>explosions</strong> do no <strong class='color-harm'>harm</strong><br> while your <strong class='color-f'>energy</strong> is above <strong>98%</strong>", // description: "<strong class='color-e'>explosions</strong> do no <strong class='color-harm'>harm</strong><br> while your <strong class='color-f'>energy</strong> is above <strong>98%</strong>",
description: "<strong class='color-harm'>harm</strong> from <strong class='color-e'>explosions</strong> is passively reduced<br>by <strong>5%</strong> for every <strong>10</strong> stored <strong class='color-f'>energy</strong>", description: "<strong class='color-e'>explosion</strong> <strong class='color-harm'>harm</strong> is reduce by <strong>99%</strong>, but<br>they drain <strong>15</strong> <strong class='color-f'>energy</strong> and have more force",
isGunTech: true, isGunTech: true,
maxCount: 1, maxCount: 1,
count: 0, count: 0,

View File

@@ -1,27 +1,22 @@
******************************************************** NEXT PATCH ************************************************** ******************************************************** NEXT PATCH **************************************************
default foam gun fires a stream electric reactive armor renamed electric armor
tech: pressure vessel - in addition to the stream, foam gun builds up charges. reduce harm from explosions by 99%, drain 15 energy,
charges release after you stop firing and greatly increase knock back
capacitor tech doubles pressure vessel effect it does look like you can go through some thin walls,
tech: syntactic foam - foam does 41% more damage per second but that's how it is in the real world, so not a bug
quantum foam removed
spore gun has 25% more ammo and fires 25% more often grenades have 40% more ammo
spores and worms move 25% faster
nail gun has 5% more ammo time dilation generates 12->18 energy/s
all versions of nail gun have a much higher fire rate
harpoon/grapple density reduced by 20%
this also lowers damage about 10%
harpoon/grapple properly follow conservation of momentum
(a small jerk when it retracts)
bug fixes
******************************************************** TODO ******************************************************** ******************************************************** TODO ********************************************************
a self referencing tech that switches states every time you access the text of it
switches state with it runs the description function
could be ON/OFF tech
could be JUNK
gunIndex section at the end seems pointless gunIndex section at the end seems pointless
merge with the choosing functions? merge with the choosing functions?