wave
matter wave renamed wave
tech: frequency - wave has unlimited ammo, but -50% wave firerate
tech: sympathetic resonance - when phonon waves hit a mob they make a new resonance wave
effect cooldown grows +5s with each chained resonance
uncertainty principle works with phonon wave
phase velocity works with all other wave tech, 40->35% damage
boundstate reduces wave range by 25->15%
non-renewables 88% -> 67% damage
improved fine-structure constant graphic for when you lose coupling
laser mobs pulse a laser 50% of the time for 2x damage
a bunch of bug fixes
caliber does a bit more damage at 1 stack, but does less damage at 3+ stacks
it grew mass and damage at an exponential rate before
now it's closer to the +30% damage description
This commit is contained in:
101
js/spawn.js
101
js/spawn.js
@@ -3594,21 +3594,116 @@ const spawn = {
|
||||
};
|
||||
},
|
||||
laser(x, y, radius = 30) {
|
||||
mobs.spawn(x, y, 3, radius, "#f00");
|
||||
const color = "#f00"
|
||||
mobs.spawn(x, y, 3, radius, color);
|
||||
let me = mob[mob.length - 1];
|
||||
me.vertices = Matter.Vertices.rotate(me.vertices, Math.PI, me.position); //make the pointy side of triangle the front
|
||||
Matter.Body.rotate(me, Math.random() * Math.PI * 2);
|
||||
me.accelMag = 0.0001 * simulation.accelScale;
|
||||
me.laserInterval = 100
|
||||
me.onHit = function() {
|
||||
//run this function on hitting player
|
||||
this.explode();
|
||||
};
|
||||
me.do = function() {
|
||||
this.torque = this.lookTorque * this.inertia * 0.5;
|
||||
this.seePlayerByLookingAt();
|
||||
this.checkStatus();
|
||||
this.attraction();
|
||||
this.laser();
|
||||
this.torque = this.lookTorque * this.inertia * 0.5;
|
||||
if (this.seePlayer.recall) {
|
||||
//set direction to turn to fire
|
||||
if (!(simulation.cycle % this.seePlayerFreq)) this.fireDir = Vector.normalise(Vector.sub(this.seePlayer.position, this.position));
|
||||
|
||||
if (simulation.cycle % this.laserInterval > this.laserInterval / 2) {
|
||||
const vertexCollision = function(v1, v1End, domain) {
|
||||
for (let i = 0; i < domain.length; ++i) {
|
||||
let vertices = domain[i].vertices;
|
||||
const len = vertices.length - 1;
|
||||
for (let j = 0; j < len; j++) {
|
||||
results = simulation.checkLineIntersection(v1, v1End, vertices[j], vertices[j + 1]);
|
||||
if (results.onLine1 && results.onLine2) {
|
||||
const dx = v1.x - results.x;
|
||||
const dy = v1.y - results.y;
|
||||
const dist2 = dx * dx + dy * dy;
|
||||
if (dist2 < best.dist2 && (!domain[i].mob || domain[i].alive)) {
|
||||
best = {
|
||||
x: results.x,
|
||||
y: results.y,
|
||||
dist2: dist2,
|
||||
who: domain[i],
|
||||
v1: vertices[j],
|
||||
v2: vertices[j + 1]
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
results = simulation.checkLineIntersection(v1, v1End, vertices[0], vertices[len]);
|
||||
if (results.onLine1 && results.onLine2) {
|
||||
const dx = v1.x - results.x;
|
||||
const dy = v1.y - results.y;
|
||||
const dist2 = dx * dx + dy * dy;
|
||||
if (dist2 < best.dist2) {
|
||||
best = {
|
||||
x: results.x,
|
||||
y: results.y,
|
||||
dist2: dist2,
|
||||
who: domain[i],
|
||||
v1: vertices[0],
|
||||
v2: vertices[len]
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
const seeRange = 8000;
|
||||
best = {
|
||||
x: null,
|
||||
y: null,
|
||||
dist2: Infinity,
|
||||
who: null,
|
||||
v1: null,
|
||||
v2: null
|
||||
};
|
||||
const look = {
|
||||
x: this.position.x + seeRange * Math.cos(this.angle),
|
||||
y: this.position.y + seeRange * Math.sin(this.angle)
|
||||
};
|
||||
vertexCollision(this.position, look, map);
|
||||
vertexCollision(this.position, look, body);
|
||||
if (!m.isCloak) vertexCollision(this.position, look, [playerBody, playerHead]);
|
||||
|
||||
// hitting player
|
||||
if ((best.who === playerBody || best.who === playerHead) && m.immuneCycle < m.cycle) {
|
||||
const dmg = 0.003 * simulation.dmgScale;
|
||||
m.damage(dmg);
|
||||
//draw damage
|
||||
ctx.fillStyle = color;
|
||||
ctx.beginPath();
|
||||
ctx.arc(best.x, best.y, dmg * 1500, 0, 2 * Math.PI);
|
||||
ctx.fill();
|
||||
}
|
||||
//draw beam
|
||||
if (best.dist2 === Infinity) best = look;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(this.vertices[1].x, this.vertices[1].y);
|
||||
ctx.lineTo(best.x, best.y);
|
||||
ctx.strokeStyle = color;
|
||||
ctx.lineWidth = 3;
|
||||
ctx.setLineDash([50 + 120 * Math.random(), 50 * Math.random()]);
|
||||
ctx.stroke();
|
||||
ctx.setLineDash([]);
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.arc(this.vertices[1].x, this.vertices[1].y, 1 + 0.3 * (this.laserInterval - simulation.cycle % this.laserInterval), 0, 2 * Math.PI); //* this.fireCycle / this.fireDelay
|
||||
ctx.fillStyle = color;
|
||||
ctx.fill();
|
||||
} else {
|
||||
ctx.beginPath();
|
||||
ctx.arc(this.vertices[1].x, this.vertices[1].y, 1 + 0.3 * (simulation.cycle % this.laserInterval), 0, 2 * Math.PI); //* this.fireCycle / this.fireDelay
|
||||
ctx.fillStyle = color;
|
||||
ctx.fill();
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
laserBoss(x, y, radius = 30) {
|
||||
|
||||
Reference in New Issue
Block a user