needles, and diffraction

diffraction grating only gains 1 extra beam, but no longer gets a damage reduction
  also the beam split is wider than before

needle move twice as fast (was 50, now is 100)
  and they are 50% longer and 25% thinner
  damage was improved about 20%
  delay between each needle in a volley is slightly longer
This commit is contained in:
landgreen
2021-04-20 06:36:22 -07:00
parent 43568616fd
commit b50e2ba9ce
8 changed files with 59 additions and 91 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@@ -1483,26 +1483,12 @@ const b = {
color: "rgba(255,0,0,0.5)", color: "rgba(255,0,0,0.5)",
time: simulation.drawTime time: simulation.drawTime
}); });
if (tech.isLaserPush) { //push mobs away if (tech.isLaserPush) { //push mobs away
// console.log(-0.003 * Math.min(4, best.who.mass), dmg)
const index = path.length - 1 const index = path.length - 1
// const force = Vector.mult(Vector.normalise(Vector.sub(path[Math.max(0, index - 1)], path[index])), -0.003 * Math.min(4, best.who.mass))
// const push = -0.004 / (1 + tech.beamSplitter + tech.wideLaser + tech.historyLaser)
// console.log(push)
const force = Vector.mult(Vector.normalise(Vector.sub(path[index], path[Math.max(0, index - 1)])), 0.003 * push * Math.min(6, best.who.mass)) const force = Vector.mult(Vector.normalise(Vector.sub(path[index], path[Math.max(0, index - 1)])), 0.003 * push * Math.min(6, best.who.mass))
Matter.Body.applyForce(best.who, path[index], force) Matter.Body.applyForce(best.who, path[index], force)
// Matter.Body.setVelocity(best.who, { //friction
// x: best.who.velocity.x * 0.7,
// y: best.who.velocity.y * 0.7
// });
} }
} }
// ctx.fillStyle = color; //draw mob damage circle
// ctx.beginPath();
// ctx.arc(path[path.length - 1].x, path[path.length - 1].y, Math.sqrt(damage) * 100, 0, 2 * Math.PI);
// ctx.fill();
}; };
const reflection = function() { // https://math.stackexchange.com/questions/13261/how-to-get-a-reflection-vector const reflection = function() { // https://math.stackexchange.com/questions/13261/how-to-get-a-reflection-vector
const n = Vector.perp(Vector.normalise(Vector.sub(best.v1, best.v2))); const n = Vector.perp(Vector.normalise(Vector.sub(best.v1, best.v2)));
@@ -2317,7 +2303,6 @@ const b = {
const velocity = Vector.mult(Vector.normalise(Vector.sub(where, who.position)), speed) const velocity = Vector.mult(Vector.normalise(Vector.sub(where, who.position)), speed)
velocity.y -= Math.abs(who.position.x - closestMob.position.x) / 150; //gives an arc, but not a good one velocity.y -= Math.abs(who.position.x - closestMob.position.x) / 150; //gives an arc, but not a good one
Matter.Body.setVelocity(who, velocity); Matter.Body.setVelocity(who, velocity);
if (isSpin) Matter.Body.setAngularVelocity(who, 2 + 2 * Math.random() * (Math.random() < 0.5 ? -1 : 1));
} }
}, },
targetedNail(position, num = 1, speed = 40 + 10 * Math.random(), range = 1200, isRandomAim = true) { targetedNail(position, num = 1, speed = 40 + 10 * Math.random(), range = 1200, isRandomAim = true) {
@@ -3219,7 +3204,7 @@ const b = {
fireNeedles() { fireNeedles() {
function makeNeedle(angle = m.angle) { function makeNeedle(angle = m.angle) {
const me = bullet.length; const me = bullet.length;
bullet[me] = Bodies.rectangle(m.pos.x + 40 * Math.cos(m.angle), m.pos.y + 40 * Math.sin(m.angle), 50, 1, b.fireAttributes(angle)); bullet[me] = Bodies.rectangle(m.pos.x + 40 * Math.cos(m.angle), m.pos.y + 40 * Math.sin(m.angle), 75, 0.75, b.fireAttributes(angle));
bullet[me].collisionFilter.mask = tech.isNeedleShieldPierce ? cat.body : cat.body | cat.mobShield bullet[me].collisionFilter.mask = tech.isNeedleShieldPierce ? cat.body : cat.body | cat.mobShield
Matter.Body.setDensity(bullet[me], 0.00001); //0.001 is normal Matter.Body.setDensity(bullet[me], 0.00001); //0.001 is normal
bullet[me].endCycle = simulation.cycle + 180; bullet[me].endCycle = simulation.cycle + 180;
@@ -3239,14 +3224,14 @@ const b = {
} }
if (!immune) { if (!immune) {
if (tech.isNailCrit && !who.shield && Vector.dot(Vector.normalise(Vector.sub(who.position, this.position)), Vector.normalise(this.velocity)) > 0.975) { if (tech.isNailCrit && !who.shield && Vector.dot(Vector.normalise(Vector.sub(who.position, this.position)), Vector.normalise(this.velocity)) > 0.975) {
b.explosion(this.position, 220 + 30 * Math.random()); //makes bullet do explosive damage at end b.explosion(this.position, 220 + 50 * Math.random()); //makes bullet do explosive damage at end
} }
this.immuneList.push(who.id) //remember that this needle has hit this mob once already this.immuneList.push(who.id) //remember that this needle has hit this mob once already
who.foundPlayer(); who.foundPlayer();
if (tech.isNailRadiation) { if (tech.isNailRadiation) {
mobs.statusDoT(who, tech.isFastRadiation ? 9 : 2.25, tech.isSlowRadiation ? 240 : (tech.isFastRadiation ? 30 : 120)) // one tick every 30 cycles mobs.statusDoT(who, tech.isFastRadiation ? 12 : 3, tech.isSlowRadiation ? 240 : (tech.isFastRadiation ? 30 : 120)) // one tick every 30 cycles
} else { } else {
let dmg = b.dmgScale * 3.5 let dmg = b.dmgScale * 3.75
if (tech.isCrit && who.isStunned) dmg *= 4 if (tech.isCrit && who.isStunned) dmg *= 4
who.damage(dmg, tech.isNeedleShieldPierce); who.damage(dmg, tech.isNeedleShieldPierce);
simulation.drawList.push({ //add dmg to draw queue simulation.drawList.push({ //add dmg to draw queue
@@ -3267,12 +3252,14 @@ const b = {
x: 0, x: 0,
y: 0 y: 0
}); });
this.do = function() {} this.do = function() {
if (!Matter.Query.collides(this, map).length) this.force.y += this.mass * 0.001;
}
} else if (this.speed < 30) { } else if (this.speed < 30) {
this.force.y += this.mass * 0.0007; //no gravity until it slows down to improve aiming this.force.y += this.mass * 0.001; //no gravity until it slows down to improve aiming
} }
}; };
const SPEED = 50 const SPEED = 100
Matter.Body.setVelocity(bullet[me], { Matter.Body.setVelocity(bullet[me], {
x: m.Vx / 2 + SPEED * Math.cos(angle), x: m.Vx / 2 + SPEED * Math.cos(angle),
y: m.Vy / 2 + SPEED * Math.sin(angle) y: m.Vy / 2 + SPEED * Math.sin(angle)
@@ -3285,13 +3272,13 @@ const b = {
m.fireCDcycle = m.cycle + 50 * b.fireCD; // cool down m.fireCDcycle = m.cycle + 50 * b.fireCD; // cool down
makeNeedle() makeNeedle()
for (let i = 1; i < 4; i++) { //4 total needles for (let i = 1; i < 4; i++) { //4 total needles
setTimeout(() => { if (!simulation.paused) makeNeedle() }, 40 * i); setTimeout(() => { if (!simulation.paused) makeNeedle() }, 60 * i);
} }
} else { } else {
m.fireCDcycle = m.cycle + 30 * b.fireCD; // cool down m.fireCDcycle = m.cycle + 30 * b.fireCD; // cool down
makeNeedle() makeNeedle()
for (let i = 1; i < 3; i++) { //3 total needles for (let i = 1; i < 3; i++) { //3 total needles
setTimeout(() => { if (!simulation.paused) makeNeedle() }, 40 * i); setTimeout(() => { if (!simulation.paused) makeNeedle() }, 60 * i);
} }
} }
@@ -3320,7 +3307,7 @@ const b = {
if (tech.isNailCrit && !who.shield && Vector.dot(Vector.normalise(Vector.sub(who.position, this.position)), Vector.normalise(this.velocity)) > 0.975) { if (tech.isNailCrit && !who.shield && Vector.dot(Vector.normalise(Vector.sub(who.position, this.position)), Vector.normalise(this.velocity)) > 0.975) {
b.explosion(this.position, 300 + 30 * Math.random()); //makes bullet do explosive damage at end b.explosion(this.position, 300 + 30 * Math.random()); //makes bullet do explosive damage at end
} }
if (tech.isNailRadiation) mobs.statusDoT(who, 7 * (tech.isFastRadiation ? 12 : 0.3), tech.isSlowRadiation ? 240 : (tech.isFastRadiation ? 30 : 120)) // one tick every 30 cycles if (tech.isNailRadiation) mobs.statusDoT(who, 7 * (tech.isFastRadiation ? 1.4 : 0.35), tech.isSlowRadiation ? 240 : (tech.isFastRadiation ? 30 : 120)) // one tick every 30 cycles
}; };
bullet[me].minDmgSpeed = 10 bullet[me].minDmgSpeed = 10
@@ -4483,27 +4470,21 @@ const b = {
} else { } else {
m.fireCDcycle = m.cycle m.fireCDcycle = m.cycle
m.energy -= m.fieldRegen + tech.laserFieldDrain * tech.isLaserDiode m.energy -= m.fieldRegen + tech.laserFieldDrain * tech.isLaserDiode
const divergence = m.crouch ? 0.15 : 0.2 // const divergence = m.crouch ? 0.15 : 0.2
const scale = Math.pow(0.9, tech.beamSplitter) // const scale = Math.pow(0.9, tech.beamSplitter)
const pushScale = scale * scale // const pushScale = scale * scale
let dmg = tech.laserDamage * scale //Math.pow(0.9, tech.laserDamage) let dmg = tech.laserDamage // * scale //Math.pow(0.9, tech.laserDamage)
const where = { const where = {
x: m.pos.x + 20 * Math.cos(m.angle), x: m.pos.x + 20 * Math.cos(m.angle),
y: m.pos.y + 20 * Math.sin(m.angle) y: m.pos.y + 20 * Math.sin(m.angle)
} }
const divergence = m.crouch ? 0.2 : 0.5
const angle = m.angle - tech.beamSplitter * divergence / 2
for (let i = 0; i < 1 + tech.beamSplitter; i++) {
b.laser(where, { b.laser(where, {
x: where.x + 3000 * Math.cos(m.angle), x: where.x + 3000 * Math.cos(angle + i * divergence),
y: where.y + 3000 * Math.sin(m.angle) y: where.y + 3000 * Math.sin(angle + i * divergence)
}, dmg, tech.laserReflections, false, pushScale) }, dmg, tech.laserReflections, false)
for (let i = 1; i < 1 + tech.beamSplitter; i++) {
b.laser(where, {
x: where.x + 3000 * Math.cos(m.angle + i * divergence),
y: where.y + 3000 * Math.sin(m.angle + i * divergence)
}, dmg, tech.laserReflections, false, pushScale)
b.laser(where, {
x: where.x + 3000 * Math.cos(m.angle - i * divergence),
y: where.y + 3000 * Math.sin(m.angle - i * divergence)
}, dmg, tech.laserReflections, false, pushScale)
} }
} }
}, },
@@ -4608,12 +4589,18 @@ const b = {
let energy = 0.3 * Math.min(m.energy, 1.5) let energy = 0.3 * Math.min(m.energy, 1.5)
m.energy -= energy * tech.isLaserDiode m.energy -= energy * tech.isLaserDiode
if (tech.beamSplitter) { if (tech.beamSplitter) {
energy *= Math.pow(0.85, tech.beamSplitter) // energy *= Math.pow(0.9, tech.beamSplitter)
b.pulse(energy, m.angle) // b.pulse(energy, m.angle)
for (let i = 1; i < 1 + tech.beamSplitter; i++) { // for (let i = 1; i < 1 + tech.beamSplitter; i++) {
b.pulse(energy, m.angle - i * 0.27) // b.pulse(energy, m.angle - i * 0.27)
b.pulse(energy, m.angle + i * 0.27) // b.pulse(energy, m.angle + i * 0.27)
// }
const divergence = m.crouch ? 0.2 : 0.5
const angle = m.angle - tech.beamSplitter * divergence / 2
for (let i = 0; i < 1 + tech.beamSplitter; i++) {
b.pulse(energy, angle + i * divergence)
} }
} else { } else {
b.pulse(energy, m.angle) b.pulse(energy, m.angle)
} }

View File

@@ -16,12 +16,12 @@ const level = {
// simulation.zoomScale = 1000; // simulation.zoomScale = 1000;
// simulation.setZoom(); // simulation.setZoom();
// m.setField("nano-scale manufacturing") // m.setField("nano-scale manufacturing")
// b.giveGuns("laser") // b.giveGuns("nail gun")
// tech.isExplodeRadio = true // tech.isExplodeRadio = true
// for (let i = 0; i < 1; i++) tech.giveTech("dynamo-bot") // for (let i = 0; i < 1; i++) tech.giveTech("dynamo-bot")
// tech.giveTech("incendiary ammunition") // tech.giveTech("diffraction grating")
// tech.giveTech("flip-flop") // tech.giveTech("pulse")
// tech.giveTech("causality bombs") // tech.giveTech("needle gun")
// tech.giveTech("cardinality") // tech.giveTech("cardinality")
// tech.giveTech("Bayesian statistics") // tech.giveTech("Bayesian statistics")
// tech.isExplodeRadio = true; // tech.isExplodeRadio = true;
@@ -1113,17 +1113,13 @@ const level = {
// spawn.shooterBoss(1900, -500) // spawn.shooterBoss(1900, -500)
// spawn.launcherBoss(1200, -500) // spawn.launcherBoss(1200, -500)
// spawn.laserTargetingBoss(1600, -400) // spawn.laserTargetingBoss(1600, -400)
spawn.striker(1600, -500) // spawn.striker(1600, -500)
spawn.striker(1600, -500)
spawn.striker(1600, -500)
// spawn.laserTargetingBoss(1700, -120) // spawn.laserTargetingBoss(1700, -120)
// spawn.bomberBoss(1400, -500) // spawn.bomberBoss(1400, -500)
spawn.sniper(1800, -120) // spawn.sniper(1800, -120)
spawn.sniper(1800, -120)
spawn.sniper(2800, -120)
// spawn.streamBoss(1600, -500) // spawn.streamBoss(1600, -500)
// spawn.orbitalBoss(1600, -500) // spawn.orbitalBoss(1600, -500)
// spawn.spawnerBossCulture(1600, -500) spawn.cellBossCulture(1600, -500)
// spawn.shieldingBoss(1600, -500) // spawn.shieldingBoss(1600, -500)
// spawn.beamer(1200, -500) // spawn.beamer(1200, -500)
// spawn.shield(mob[mob.length - 1], 1800, -120, 1); // spawn.shield(mob[mob.length - 1], 1800, -120, 1);

View File

@@ -1198,7 +1198,11 @@ const mobs = {
} }
Matter.World.remove(engine.world, this); Matter.World.remove(engine.world, this);
mob.splice(i, 1); mob.splice(i, 1);
if (tech.isMobBlockFling) b.targetedBlock(body[body.length - 1], true) if (tech.isMobBlockFling) {
const who = body[body.length - 1]
b.targetedBlock(who, true)
Matter.Body.setAngularVelocity(who, (0.5 + 0.2 * Math.random()) * (Math.random() < 0.5 ? -1 : 1));
}
} else { } else {
Matter.World.remove(engine.world, this); Matter.World.remove(engine.world, this);
mob.splice(i, 1); mob.splice(i, 1);

View File

@@ -1151,14 +1151,14 @@ const m = {
const solid = function(that) { const solid = function(that) {
const dx = that.position.x - player.position.x; const dx = that.position.x - player.position.x;
const dy = that.position.y - player.position.y; const dy = that.position.y - player.position.y;
if (dx * dx + dy * dy > 10000 && that !== m.holdingTarget) { if (that.speed < 3 && dx * dx + dy * dy > 10000 && that !== m.holdingTarget) {
that.collisionFilter.category = cat.body; //make solid that.collisionFilter.category = cat.body; //make solid
that.collisionFilter.mask = cat.player | cat.map | cat.body | cat.bullet | cat.mob | cat.mobBullet; //can hit player now that.collisionFilter.mask = cat.player | cat.map | cat.body | cat.bullet | cat.mob | cat.mobBullet; //can hit player now
} else { } else {
setTimeout(solid, 25, that); setTimeout(solid, 50, that);
} }
}; };
setTimeout(solid, 150, m.holdingTarget); setTimeout(solid, 500, m.holdingTarget);
const charge = Math.min(m.throwCharge / 5, 1) const charge = Math.min(m.throwCharge / 5, 1)
//***** scale throw speed with the first number, 80 ***** //***** scale throw speed with the first number, 80 *****

View File

@@ -527,7 +527,7 @@ const spawn = {
me.seePlayerFreq = Math.floor(11 + 7 * Math.random()) me.seePlayerFreq = Math.floor(11 + 7 * Math.random())
me.seeAtDistance2 = 1400000; me.seeAtDistance2 = 1400000;
me.cellMassMax = 70 me.cellMassMax = 70
me.collisionFilter.mask = cat.player | cat.bullet | cat.body //| cat.map | cat.body me.collisionFilter.mask = cat.player | cat.bullet //| cat.body | cat.map
Matter.Body.setDensity(me, 0.00035) // normal density is 0.001 // this reduces life by half and decreases knockback Matter.Body.setDensity(me, 0.00035) // normal density is 0.001 // this reduces life by half and decreases knockback
const k = 642 //k=r^2/m const k = 642 //k=r^2/m
me.split = function() { me.split = function() {

View File

@@ -4188,7 +4188,7 @@
}, },
{ {
name: "diffraction grating", name: "diffraction grating",
description: `your <strong class='color-laser'>laser</strong> gains <strong>2 diverging</strong> beams<br>decrease individual beam <strong class='color-d'>damage</strong> by <strong>10%</strong>`, description: `your <strong class='color-laser'>laser</strong> gains a <strong>diverging</strong> beam`,
isGunTech: true, isGunTech: true,
maxCount: 9, maxCount: 9,
count: 0, count: 0,

View File

@@ -1,15 +1,12 @@
******************************************************** NEXT PATCH ******************************************************** ******************************************************** NEXT PATCH ********************************************************
thrown blocks can damage intangible mobs for a couple seconds after they are thrown diffraction grating only gains 1 extra beam, but no longer gets a damage reduction
they are set to act like bullets for a few seconds after being thrown also the beam split is wider than before
all blocks do 50% more damage to mobs and 50% longer stun
blocks do more damage vs. shielded mobs (damage penalty is 40%, was 66%))
mass driver - damage increase set to 200% (up from 100%)
negative mass field can lift blocks twice as heavy as before with little movement reduction
tech: flywheel - when mobs die their body is spun and flung at nearby mobs
requires mass driver, no other mob death tech
needle move twice as fast (was 50, now is 100)
and they are 50% longer and 25% thinner
damage was improved about 20%
delay between each needle in a volley is slightly longer
******************************************************** BUGS ******************************************************** ******************************************************** BUGS ********************************************************
@@ -41,10 +38,9 @@ fix door.isOpen actually meaning isClosed?
******************************************************** TODO ******************************************************** ******************************************************** TODO ********************************************************
chance for the block resulting from a slain enemy to be thrown at the nearest mob. make some bullets move super fast, but do collisions checks in .do()
tech: flywheel - after a mob dies their body is fired towards a nearby mob check for hitting mobs or map with fractional velocity
requires: block throwing technology? if velocity is above 40ish
adjust for gravity
import the procedural level generation from one of the older versions of the game as one single level import the procedural level generation from one of the older versions of the game as one single level
@@ -61,30 +57,15 @@ blocking produces ice-IX
standing wave harmonics standing wave harmonics
maybe just a chance to proc for perfect diamagnetism maybe just a chance to proc for perfect diamagnetism
laser beam splitter should only increase by 1,2,3,4 not 1,3,5
tech field: while _____ is active take 100% more harm and do 100% more damage tech field: while _____ is active take 100% more harm and do 100% more damage
while firing while firing
or while plasma field is active or while plasma field is active
make a boss that increases tech.deathSpawns while it is alive
tech.deathSpawns += 2
on death tech.deathSpawns -= 2
how to make it clear that the bos is producing the spawns?
boss is make of many spawn-like mobs
but they need to have a different color from spawns
similar to how cellBoss works
with stronger flocking/attracting forces
quantum foam: hold fire to charge up foam, release fire to let go an amount relative to hold long you held fire quantum foam: hold fire to charge up foam, release fire to let go an amount relative to hold long you held fire
foam gun fires a bullet that tracks how long mouse is down foam gun fires a bullet that tracks how long mouse is down
when mouse is up it streams out a hose of foam based on how long foam was down when mouse is up it streams out a hose of foam based on how long foam was down
bullet is small and hidden bullet is small and hidden
make some bullets move super fast, but do collisions checks in .do()
check for hitting mobs or map with fractional velocity
if velocity is above 40ish
flipflop, but toggles after a kill flipflop, but toggles after a kill
new level: procedural generation new level: procedural generation