harm immunity effects now apply to explosion self damage
tech: CPT grenades no longer harm you

tech: least action - wavelets are slower and do more damage
tech: amplitude - wavelets are taller and do more damage
tech: wavelength - wavelets are longer and do more damage
This commit is contained in:
landgreen
2021-05-03 04:35:49 -07:00
parent 04f29052a9
commit def6076558
5 changed files with 129 additions and 83 deletions

View File

@@ -365,6 +365,7 @@ const b = {
}); });
//player damage and knock back //player damage and knock back
if (m.immuneCycle < m.cycle) {
sub = Vector.sub(where, player.position); sub = Vector.sub(where, player.position);
dist = Vector.magnitude(sub); dist = Vector.magnitude(sub);
@@ -383,6 +384,7 @@ const b = {
player.force.x += knock.x; player.force.x += knock.x;
player.force.y += knock.y; player.force.y += knock.y;
} }
}
//body knock backs //body knock backs
for (let i = 0, len = body.length; i < len; ++i) { for (let i = 0, len = body.length; i < len; ++i) {
@@ -1237,13 +1239,14 @@ const b = {
let dmg = this.dmg / Math.min(10, q[i].mass) let dmg = this.dmg / Math.min(10, q[i].mass)
q[i].damage(dmg); q[i].damage(dmg);
q[i].foundPlayer(); q[i].foundPlayer();
simulation.drawList.push({ //add dmg to draw queue //removed to improve performance
x: this.position.x, // simulation.drawList.push({ //add dmg to draw queue
y: this.position.y, // x: this.position.x,
radius: Math.log(2 * dmg + 1.1) * 40, // y: this.position.y,
color: "rgba(255, 0, 119, 0.5)", // radius: Math.log(2 * dmg + 1.1) * 40,
time: simulation.drawTime // color: "rgba(255, 0, 119, 0.5)",
}); // time: simulation.drawTime
// });
} }
} }
this.cycle++ this.cycle++
@@ -2276,7 +2279,7 @@ const b = {
Matter.Body.scale(this, SCALE, SCALE); Matter.Body.scale(this, SCALE, SCALE);
this.radius *= SCALE; this.radius *= SCALE;
} else { } else {
this.force.y += this.mass * 0.00008; //gravity this.force.y += this.mass * tech.foamGravity; //gravity
if (tech.isFoamAttract) { if (tech.isFoamAttract) {
for (let i = 0, len = mob.length; i < len; i++) { for (let i = 0, len = mob.length; i < len; i++) {
@@ -3606,12 +3609,12 @@ const b = {
} }
}, { }, {
name: "wave beam", name: "wave beam",
description: "emit a packet of oscillating particles<br>that propagate through <strong>walls</strong>", description: "emit a wavelet of <strong>oscillating</strong> particles<br>that propagate through <strong>solids</strong>",
ammo: 0, ammo: 0,
ammoPack: 65, ammoPack: 80,
have: false, have: false,
packetCounter: 0, packetCounter: 0,
delay: 72, delay: 44,
do() { do() {
if (this.packetCounter && !input.fire) { if (this.packetCounter && !input.fire) {
this.packetCounter++; this.packetCounter++;
@@ -3620,20 +3623,25 @@ const b = {
this.packetCounter = 0; this.packetCounter = 0;
} }
} }
//draw cooldown ?
}, },
calculateDamage() {
},
damage: 1,
fire() { fire() {
for (let i = 0; i < 2; i++) { for (let i = 0; i < 2; i++) {
const me = bullet.length; const me = bullet.length;
bullet[me] = Bodies.polygon(m.pos.x + 25 * Math.cos(m.angle), m.pos.y + 25 * Math.sin(m.angle), 7, 3.5, { bullet[me] = Bodies.polygon(m.pos.x + 25 * Math.cos(m.angle), m.pos.y + 25 * Math.sin(m.angle), 7, 3.5, {
angle: m.angle, angle: m.angle,
cycle: -0.5, cycle: -0.5,
endCycle: simulation.cycle + Math.floor((tech.waveReflections ? Infinity : 120) * tech.isBulletsLastLonger), // - this.packetCounter + tech.wavePacketLength, //- this.packetCounter + this.packetLength makes the entire packet go away at the same time endCycle: simulation.cycle + Math.floor((tech.waveReflections ? Infinity : 160) * tech.isBulletsLastLonger), // - this.packetCounter + tech.wavePacketLength, //- this.packetCounter + this.packetLength makes the entire packet go away at the same time
inertia: Infinity, inertia: Infinity,
frictionAir: 0, frictionAir: 0,
slow: 0, slow: 0,
amplitude: (m.crouch ? 10 : 20) * Math.sin(this.packetCounter * 0.088) * ((i % 2) ? (tech.isImaginaryWave ? 1 : -1) : 1), amplitude: (m.crouch ? 10 : 20) * tech.waveAmplitude * Math.sin(this.packetCounter * tech.wavePacketFrequency) * ((i % 2) ? (tech.isImaginaryWave ? 1 : -1) : 1),
minDmgSpeed: 0, minDmgSpeed: 0,
dmg: b.dmgScale * tech.waveBeamDamage * (tech.isImaginaryWave ? 3 : 1) * (0.75 + 0.25 * tech.wavePacketLength / 36), //control damage also when you divide by mob.mass dmg: b.dmgScale * tech.waveBeamDamage * (tech.isImaginaryWave ? 3 : 1) * tech.waveAmplitude * tech.wavePacketLength / 36, //control damage also when you divide by mob.mass
classType: "bullet", classType: "bullet",
collisionFilter: { collisionFilter: {
category: 0, category: 0,
@@ -3675,7 +3683,10 @@ const b = {
}, },
wiggle() { wiggle() {
this.cycle++ this.cycle++
const where = Vector.mult(transverse, this.amplitude * Math.cos(this.cycle * 0.35)) // const where = Vector.mult(transverse, this.amplitude * Math.cos(this.cycle * 0.35)) // 36
// const where = Vector.mult(transverse, 0.5 * this.amplitude * Math.cos(this.cycle * 0.15)) //36
// const where = Vector.mult(transverse, 0.15 * this.amplitude * Math.cos(this.cycle * 0.05)) //36
const where = Vector.mult(transverse, this.amplitude * Math.cos(this.cycle * tech.waveFrequency))
Matter.Body.setPosition(this, Vector.add(this.position, where)) Matter.Body.setPosition(this, Vector.add(this.position, where))
} }
}); });

View File

@@ -17,14 +17,14 @@ const level = {
// simulation.setZoom(); // simulation.setZoom();
// m.setField("nano-scale manufacturing") // m.setField("nano-scale manufacturing")
// b.giveGuns("wave beam") // b.giveGuns("wave beam")
// b.giveGuns("laser") // b.giveGuns("foam")
// tech.isExplodeRadio = true // tech.isExplodeRadio = true
// for (let i = 0; i < 9; i++) tech.giveTech("auto-loading heuristics") // for (let i = 0; i < 1; i++) tech.giveTech("amplitude")
// for (let i = 0; i < 9; i++) tech.giveTech("bound state") // tech.giveTech("aerogel")
// for (let i = 0; i < 9; i++) tech.giveTech("jabbering") // for (let i = 0; i < 0; i++) tech.giveTech("jabbering")
// tech.giveTech("phase velocity") // tech.giveTech("phase velocity")
// tech.giveTech("imaginary") // tech.giveTech("imaginary")
// for (let i = 0; i < 9; i++) tech.giveTech("stationary action") // for (let i = 0; i < 2; i++) tech.giveTech("least action")
// tech.isExplodeRadio = true; // tech.isExplodeRadio = true;
// tech.isMineSentry = true // tech.isMineSentry = true

View File

@@ -535,6 +535,9 @@ const m = {
}, },
rewind(steps) { // m.rewind(Math.floor(Math.min(599, 137 * m.energy))) rewind(steps) { // m.rewind(Math.floor(Math.min(599, 137 * m.energy)))
if (tech.isRewindGrenade) { if (tech.isRewindGrenade) {
const immunityCycle = m.cycle + 60
if (m.immuneCycle < immunityCycle) m.immuneCycle = immunityCycle; //player is immune to damage until after grenades might explode...
for (let i = 1, len = Math.floor(2 + steps / 40); i < len; i++) { for (let i = 1, len = Math.floor(2 + steps / 40); i < len; i++) {
b.grenade(Vector.add(m.pos, { x: 10 * (Math.random() - 0.5), y: 10 * (Math.random() - 0.5) }), -i * Math.PI / len) //fire different angles for each grenade b.grenade(Vector.add(m.pos, { x: 10 * (Math.random() - 0.5), y: 10 * (Math.random() - 0.5) }), -i * Math.PI / len) //fire different angles for each grenade
const who = bullet[bullet.length - 1] const who = bullet[bullet.length - 1]

View File

@@ -1908,7 +1908,7 @@
}, },
{ {
name: "causality bombs", name: "causality bombs",
description: "before you <strong class='color-rewind'>rewind</strong> drop several <strong>grenades</strong>", description: "before you <strong class='color-rewind'>rewind</strong> drop several <strong>grenades</strong><br>become immune to <strong class='color-harm'>harm</strong> until they <strong class='color-e'>explode</strong>",
maxCount: 1, maxCount: 1,
count: 0, count: 0,
frequency: 2, frequency: 2,
@@ -3612,27 +3612,9 @@
tech.bulletSize = 1; tech.bulletSize = 1;
} }
}, },
{
name: "jabbering",
description: "the <strong>wave beam</strong> generates another <strong>packet</strong><br>wave <strong class='color-d'>damage</strong> is increased by <strong>25%</strong>",
isGunTech: true,
maxCount: 9,
count: 0,
frequency: 2,
allowed() {
return tech.haveGunCheck("wave beam")
},
requires: "wave beam",
effect() {
tech.wavePacketLength += 36 //if you change this to not be 36 update /36 in wave .dmg
},
remove() {
tech.wavePacketLength = 36
}
},
{ {
name: "phase velocity", name: "phase velocity",
description: "the <strong>wave beam</strong> propagates faster in solids", description: "<strong>wavelets</strong> propagates faster in solids",
isGunTech: true, isGunTech: true,
maxCount: 1, maxCount: 1,
count: 0, count: 0,
@@ -3646,32 +3628,11 @@
}, },
remove() { remove() {
tech.isPhaseVelocity = false; tech.isPhaseVelocity = false;
}
},
{
name: "stationary action",
description: "the <strong>wave beam</strong> propagates <strong>25%</strong> slower<br>wave <strong class='color-d'>damage</strong> is increased by <strong>40%</strong>",
isGunTech: true,
maxCount: 9,
count: 0,
frequency: 2,
allowed() {
return tech.haveGunCheck("wave beam")
},
requires: "wave beam",
effect() {
tech.waveBeamSpeed *= 0.75;
tech.waveBeamDamage += 0.5 * 0.4
},
remove() {
tech.waveBeamSpeed = 10;
tech.waveBeamDamage = 0.5
} }
}, },
{ {
name: "bound state", name: "bound state",
description: "instead of dissipating normally<br><strong>wave beam</strong> bullets <strong>reflect</strong> backwards <strong>2</strong> times", description: "instead of dissipating normally<br><strong>wavelets</strong> <strong>reflect</strong> backwards <strong>2</strong> times",
isGunTech: true, isGunTech: true,
maxCount: 9, maxCount: 9,
count: 0, count: 0,
@@ -3687,9 +3648,69 @@
tech.waveReflections = 0 tech.waveReflections = 0
} }
}, },
{
name: "wavelength",
description: "<strong>wavelet</strong> length is <strong>25%</strong> longer<br>wave <strong class='color-d'>damage</strong> is increased by <strong>25%</strong>", // description: "holding fire allows the <strong>wave beam</strong> to emits a second <strong>packet</strong><br>at zero ammo cost",
isGunTech: true,
maxCount: 9,
count: 0,
frequency: 2,
allowed() {
return tech.haveGunCheck("wave beam")
},
requires: "wave beam",
effect() {
tech.wavePacketLength *= 1.25 //if you change this to not be 36 update /36 in wave .dmg
tech.wavePacketFrequency *= 0.7995
tech.waveFrequency *= 0.9
},
remove() {
tech.wavePacketLength = 36
tech.waveFrequency = 0.35
tech.wavePacketFrequency = 0.088
}
},
{
name: "amplitude",
description: "<strong>wavelet</strong> amplitude is <strong>33%</strong> higher<br>wave <strong class='color-d'>damage</strong> is increased by <strong>33%</strong>",
isGunTech: true,
maxCount: 3,
count: 0,
frequency: 2,
allowed() {
return tech.haveGunCheck("wave beam")
},
requires: "wave beam",
effect() {
tech.waveAmplitude += 0.33
},
remove() {
tech.waveAmplitude = 1
}
},
{
name: "least action",
description: "<strong>wavelets</strong> propagation speed is <strong>25%</strong> slower<br>wave <strong class='color-d'>damage</strong> is increased by <strong>50%</strong>",
isGunTech: true,
maxCount: 3,
count: 0,
frequency: 2,
allowed() {
return tech.haveGunCheck("wave beam")
},
requires: "wave beam",
effect() {
tech.waveBeamSpeed -= 2.5;
tech.waveBeamDamage += 0.7 * 0.5
},
remove() {
tech.waveBeamSpeed = 10;
tech.waveBeamDamage = 0.7
}
},
{ {
name: "imaginary", name: "imaginary",
description: "the <strong>wave beam</strong> is limited to a <strong>single</strong> strand<br>wave <strong class='color-d'>damage</strong> is increased by <strong>300%</strong>", description: "the <strong>wavelet</strong> is limited to a <strong>single</strong> strand<br>wave <strong class='color-d'>damage</strong> is increased by <strong>300%</strong>",
isGunTech: true, isGunTech: true,
maxCount: 1, maxCount: 1,
count: 0, count: 0,
@@ -4104,8 +4125,8 @@
} }
}, },
{ {
name: "colloidal foam", name: "aerogel",
description: "<strong>foam</strong> bubbles dissipate <strong>40%</strong> faster<br>increase <strong>foam</strong> <strong class='color-d'>damage</strong> per second by <strong>300%</strong>", description: "<strong>foam</strong> bubbles <strong>float</strong> and dissipate <strong>40%</strong> faster<br>increase <strong>foam</strong> <strong class='color-d'>damage</strong> per second by <strong>300%</strong>",
isGunTech: true, isGunTech: true,
maxCount: 1, maxCount: 1,
count: 0, count: 0,
@@ -4116,9 +4137,11 @@
requires: "foam", requires: "foam",
effect() { effect() {
tech.isFastFoam = true tech.isFastFoam = true
tech.foamGravity = -0.0002
}, },
remove() { remove() {
tech.isFastFoam = false; tech.isFastFoam = false;
tech.foamGravity = 0.00008
} }
}, },
{ {
@@ -6544,5 +6567,6 @@
isPhaseVelocity: null, isPhaseVelocity: null,
wavePacketLength: null, wavePacketLength: null,
isImaginaryWave: null, isImaginaryWave: null,
waveBeamSpeed: null waveBeamSpeed: null,
waveAmplitude: null,
} }

View File

@@ -1,8 +1,11 @@
******************************************************** NEXT PATCH ******************************************************** ******************************************************** NEXT PATCH ********************************************************
some wave beam bug fixes and balance harm immunity effects now apply to explosion self damage
tech: CPT grenades no longer harm you
tech: stationary action - slower wave beam but more damage tech: least action - wavelets are slower and do more damage
tech: amplitude - wavelets are taller and do more damage
tech: wavelength - wavelets are longer and do more damage
******************************************************** BUGS ******************************************************** ******************************************************** BUGS ********************************************************
@@ -36,6 +39,11 @@ is there a way to check if the player is stuck inside the map or block
******************************************************** TODO ******************************************************** ******************************************************** TODO ********************************************************
wave tech: dispersion - add noise and damage to waves
wave tech: chirp - amplitude increases with time
make a system to show current gun damage in pause menu?
tech: picking up heal power ups when at full health does harm equal to the heal values tech: picking up heal power ups when at full health does harm equal to the heal values
benefit on pick up: benefit on pick up:
get ammo get ammo