wavelets
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:
71
js/bullet.js
71
js/bullet.js
@@ -365,23 +365,25 @@ const b = {
|
||||
});
|
||||
|
||||
//player damage and knock back
|
||||
sub = Vector.sub(where, player.position);
|
||||
dist = Vector.magnitude(sub);
|
||||
if (m.immuneCycle < m.cycle) {
|
||||
sub = Vector.sub(where, player.position);
|
||||
dist = Vector.magnitude(sub);
|
||||
|
||||
if (dist < radius) {
|
||||
if (tech.isImmuneExplosion) {
|
||||
const mitigate = Math.min(1, Math.max(1 - m.energy * 0.7, 0))
|
||||
m.damage(mitigate * radius * (tech.isExplosionHarm ? 0.0004 : 0.0001));
|
||||
} else {
|
||||
m.damage(radius * (tech.isExplosionHarm ? 0.0004 : 0.0001));
|
||||
if (dist < radius) {
|
||||
if (tech.isImmuneExplosion) {
|
||||
const mitigate = Math.min(1, Math.max(1 - m.energy * 0.7, 0))
|
||||
m.damage(mitigate * radius * (tech.isExplosionHarm ? 0.0004 : 0.0001));
|
||||
} else {
|
||||
m.damage(radius * (tech.isExplosionHarm ? 0.0004 : 0.0001));
|
||||
}
|
||||
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) {
|
||||
knock = Vector.mult(Vector.normalise(sub), -Math.sqrt(dmg) * player.mass * 0.005);
|
||||
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) {
|
||||
knock = Vector.mult(Vector.normalise(sub), -Math.sqrt(dmg) * player.mass * 0.005);
|
||||
player.force.x += knock.x;
|
||||
player.force.y += knock.y;
|
||||
}
|
||||
|
||||
//body knock backs
|
||||
@@ -1237,13 +1239,14 @@ const b = {
|
||||
let dmg = this.dmg / Math.min(10, q[i].mass)
|
||||
q[i].damage(dmg);
|
||||
q[i].foundPlayer();
|
||||
simulation.drawList.push({ //add dmg to draw queue
|
||||
x: this.position.x,
|
||||
y: this.position.y,
|
||||
radius: Math.log(2 * dmg + 1.1) * 40,
|
||||
color: "rgba(255, 0, 119, 0.5)",
|
||||
time: simulation.drawTime
|
||||
});
|
||||
//removed to improve performance
|
||||
// simulation.drawList.push({ //add dmg to draw queue
|
||||
// x: this.position.x,
|
||||
// y: this.position.y,
|
||||
// radius: Math.log(2 * dmg + 1.1) * 40,
|
||||
// color: "rgba(255, 0, 119, 0.5)",
|
||||
// time: simulation.drawTime
|
||||
// });
|
||||
}
|
||||
}
|
||||
this.cycle++
|
||||
@@ -2276,7 +2279,7 @@ const b = {
|
||||
Matter.Body.scale(this, SCALE, SCALE);
|
||||
this.radius *= SCALE;
|
||||
} else {
|
||||
this.force.y += this.mass * 0.00008; //gravity
|
||||
this.force.y += this.mass * tech.foamGravity; //gravity
|
||||
|
||||
if (tech.isFoamAttract) {
|
||||
for (let i = 0, len = mob.length; i < len; i++) {
|
||||
@@ -3606,12 +3609,12 @@ const b = {
|
||||
}
|
||||
}, {
|
||||
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,
|
||||
ammoPack: 65,
|
||||
ammoPack: 80,
|
||||
have: false,
|
||||
packetCounter: 0,
|
||||
delay: 72,
|
||||
delay: 44,
|
||||
do() {
|
||||
if (this.packetCounter && !input.fire) {
|
||||
this.packetCounter++;
|
||||
@@ -3620,20 +3623,25 @@ const b = {
|
||||
this.packetCounter = 0;
|
||||
}
|
||||
}
|
||||
//draw cooldown ?
|
||||
},
|
||||
calculateDamage() {
|
||||
|
||||
},
|
||||
damage: 1,
|
||||
fire() {
|
||||
for (let i = 0; i < 2; i++) {
|
||||
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, {
|
||||
angle: m.angle,
|
||||
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,
|
||||
frictionAir: 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,
|
||||
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",
|
||||
collisionFilter: {
|
||||
category: 0,
|
||||
@@ -3675,7 +3683,10 @@ const b = {
|
||||
},
|
||||
wiggle() {
|
||||
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))
|
||||
}
|
||||
});
|
||||
|
||||
10
js/level.js
10
js/level.js
@@ -17,14 +17,14 @@ const level = {
|
||||
// simulation.setZoom();
|
||||
// m.setField("nano-scale manufacturing")
|
||||
// b.giveGuns("wave beam")
|
||||
// b.giveGuns("laser")
|
||||
// b.giveGuns("foam")
|
||||
// tech.isExplodeRadio = true
|
||||
// for (let i = 0; i < 9; i++) tech.giveTech("auto-loading heuristics")
|
||||
// for (let i = 0; i < 9; i++) tech.giveTech("bound state")
|
||||
// for (let i = 0; i < 9; i++) tech.giveTech("jabbering")
|
||||
// for (let i = 0; i < 1; i++) tech.giveTech("amplitude")
|
||||
// tech.giveTech("aerogel")
|
||||
// for (let i = 0; i < 0; i++) tech.giveTech("jabbering")
|
||||
// tech.giveTech("phase velocity")
|
||||
// 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.isMineSentry = true
|
||||
|
||||
@@ -535,6 +535,9 @@ const m = {
|
||||
},
|
||||
rewind(steps) { // m.rewind(Math.floor(Math.min(599, 137 * m.energy)))
|
||||
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++) {
|
||||
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]
|
||||
|
||||
116
js/tech.js
116
js/tech.js
@@ -1908,7 +1908,7 @@
|
||||
},
|
||||
{
|
||||
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,
|
||||
count: 0,
|
||||
frequency: 2,
|
||||
@@ -3612,27 +3612,9 @@
|
||||
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",
|
||||
description: "the <strong>wave beam</strong> propagates faster in solids",
|
||||
description: "<strong>wavelets</strong> propagates faster in solids",
|
||||
isGunTech: true,
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
@@ -3646,32 +3628,11 @@
|
||||
},
|
||||
remove() {
|
||||
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",
|
||||
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,
|
||||
maxCount: 9,
|
||||
count: 0,
|
||||
@@ -3687,9 +3648,69 @@
|
||||
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",
|
||||
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,
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
@@ -4104,8 +4125,8 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "colloidal foam",
|
||||
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>",
|
||||
name: "aerogel",
|
||||
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,
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
@@ -4116,9 +4137,11 @@
|
||||
requires: "foam",
|
||||
effect() {
|
||||
tech.isFastFoam = true
|
||||
tech.foamGravity = -0.0002
|
||||
},
|
||||
remove() {
|
||||
tech.isFastFoam = false;
|
||||
tech.foamGravity = 0.00008
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -6544,5 +6567,6 @@
|
||||
isPhaseVelocity: null,
|
||||
wavePacketLength: null,
|
||||
isImaginaryWave: null,
|
||||
waveBeamSpeed: null
|
||||
waveBeamSpeed: null,
|
||||
waveAmplitude: null,
|
||||
}
|
||||
Reference in New Issue
Block a user