level boss health rework

level bosses will do about 50% less damage on collisions, but they will take about 33% more to kill

fixed and renamed the new drone tech
This commit is contained in:
landgreen
2021-03-16 20:33:14 -07:00
parent 05fcb823b2
commit 4b50f08056
7 changed files with 37 additions and 40 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@@ -2109,11 +2109,11 @@ const b = {
powerUp.splice(i, 1); powerUp.splice(i, 1);
if (tech.isDroneGrab) { if (tech.isDroneGrab) {
this.isImproved = true; this.isImproved = true;
const SCALE = 2.5 const SCALE = 2.25
Matter.Body.scale(this, SCALE, SCALE); Matter.Body.scale(this, SCALE, SCALE);
this.lookFrequency = 30; this.lookFrequency = 30 + Math.floor(11 * Math.random());
this.endCycle += 2500 this.endCycle += 3000 * tech.droneCycleReduction * tech.isBulletsLastLonger
this.frictionAir = 0 // this.frictionAir = 0
} }
break; break;
} }

View File

@@ -1006,6 +1006,7 @@ const mobs = {
//mobs specific damage changes //mobs specific damage changes
if (tech.isFarAwayDmg) dmg *= 1 + Math.sqrt(Math.max(500, Math.min(3000, this.distanceToPlayer())) - 500) * 0.0067 //up to 50% dmg at max range of 3500 if (tech.isFarAwayDmg) dmg *= 1 + Math.sqrt(Math.max(500, Math.min(3000, this.distanceToPlayer())) - 500) * 0.0067 //up to 50% dmg at max range of 3500
if (this.shield) dmg *= 0.075 if (this.shield) dmg *= 0.075
if (this.isBoss) dmg *= 0.25
//energy and heal drain should be calculated after damage boosts //energy and heal drain should be calculated after damage boosts
if (tech.energySiphon && dmg !== Infinity && this.dropPowerUp) m.energy += Math.min(this.health, dmg) * tech.energySiphon if (tech.energySiphon && dmg !== Infinity && this.dropPowerUp) m.energy += Math.min(this.health, dmg) * tech.energySiphon

View File

@@ -243,8 +243,8 @@ const simulation = {
}, },
drawList: [], //so you can draw a first frame of explosions.. I know this is bad drawList: [], //so you can draw a first frame of explosions.. I know this is bad
drawTime: 8, //how long circles are drawn. use to push into drawlist.time drawTime: 8, //how long circles are drawn. use to push into drawlist.time
mobDmgColor: "rgba(255,0,0,0.7)", //used top push into drawList.color mobDmgColor: "rgba(255,0,0,0.7)", //color when a mob damages the player // set by mass-energy tech
playerDmgColor: "rgba(0,0,0,0.7)", //used top push into drawList.color playerDmgColor: "rgba(0,0,0,0.7)", //color when the player damages a mob
drawCircle() { drawCircle() {
//draws a circle for two cycles, used for showing damage mostly //draws a circle for two cycles, used for showing damage mostly
let i = simulation.drawList.length; let i = simulation.drawList.length;
@@ -1007,7 +1007,7 @@ const simulation = {
for (let i = 0, len = cons.length; i < len; ++i) { for (let i = 0, len = cons.length; i < len; ++i) {
ctx.moveTo(cons[i].pointA.x, cons[i].pointA.y); ctx.moveTo(cons[i].pointA.x, cons[i].pointA.y);
ctx.lineTo(cons[i].bodyB.position.x, cons[i].bodyB.position.y); ctx.lineTo(cons[i].bodyB.position.x, cons[i].bodyB.position.y);
// ctx.lineTo(cons[i].bodyB.position.x + cons[i].pointB.x, cons[i].bodyB.position.y + cons[i].pointB.y); ctx.lineTo(cons[i].bodyB.position.x + cons[i].pointB.x, cons[i].bodyB.position.y + cons[i].pointB.y);
} }
for (let i = 0, len = consBB.length; i < len; ++i) { for (let i = 0, len = consBB.length; i < len; ++i) {
ctx.moveTo(consBB[i].bodyA.position.x, consBB[i].bodyA.position.y); ctx.moveTo(consBB[i].bodyA.position.x, consBB[i].bodyA.position.y);

View File

@@ -96,7 +96,7 @@ const spawn = {
me.frictionAir = 0.01; me.frictionAir = 0.01;
me.memory = Infinity; me.memory = Infinity;
me.locatePlayer(); me.locatePlayer();
const density = 0.85 const density = 0.25
Matter.Body.setDensity(me, density); //extra dense //normal is 0.001 //makes effective life much larger Matter.Body.setDensity(me, density); //extra dense //normal is 0.001 //makes effective life much larger
// spawn.shield(me, x, y, 1); // spawn.shield(me, x, y, 1);
me.onDeath = function() { me.onDeath = function() {
@@ -530,7 +530,7 @@ const spawn = {
me.seeAtDistance2 = 1400000; me.seeAtDistance2 = 1400000;
me.cellMassMax = 70 me.cellMassMax = 70
me.collisionFilter.mask = cat.player | cat.bullet //| cat.map | cat.body me.collisionFilter.mask = cat.player | cat.bullet //| cat.map | cat.body
Matter.Body.setDensity(me, 0.001) // 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() {
Matter.Body.scale(this, 0.4, 0.4); Matter.Body.scale(this, 0.4, 0.4);
@@ -595,7 +595,7 @@ const spawn = {
me.frictionAir = 0.01 me.frictionAir = 0.01
me.seeAtDistance2 = 1000000; me.seeAtDistance2 = 1000000;
me.accelMag = 0.0005 * simulation.accelScale; me.accelMag = 0.0005 * simulation.accelScale;
Matter.Body.setDensity(me, 0.001); //normal is 0.001 Matter.Body.setDensity(me, 0.00035); //normal is 0.001
me.collisionFilter.mask = cat.bullet | cat.player me.collisionFilter.mask = cat.bullet | cat.player
me.memory = Infinity; me.memory = Infinity;
me.seePlayerFreq = 30 me.seePlayerFreq = 30
@@ -909,7 +909,7 @@ const spawn = {
me.collisionFilter.mask = cat.player | cat.bullet me.collisionFilter.mask = cat.player | cat.bullet
// me.frictionAir = 0.005; // me.frictionAir = 0.005;
me.memory = 1600; me.memory = 1600;
Matter.Body.setDensity(me, 0.075); //extra dense //normal is 0.001 //makes effective life much larger Matter.Body.setDensity(me, 0.03); //extra dense //normal is 0.001 //makes effective life much larger
me.onDeath = function() { me.onDeath = function() {
//applying forces to player doesn't seem to work inside this method, not sure why //applying forces to player doesn't seem to work inside this method, not sure why
powerUps.spawnBossPowerUp(this.position.x, this.position.y) powerUps.spawnBossPowerUp(this.position.x, this.position.y)
@@ -1009,7 +1009,7 @@ const spawn = {
let targets = [] //track who is in the node boss, for shields let targets = [] //track who is in the node boss, for shields
mobs.spawn(x, y, 6, radius, "#b386e8"); mobs.spawn(x, y, 6, radius, "#b386e8");
let me = mob[mob.length - 1]; let me = mob[mob.length - 1];
Matter.Body.setDensity(me, 0.003); //extra dense //normal is 0.001 //makes effective life much larger Matter.Body.setDensity(me, 0.0015); //extra dense //normal is 0.001 //makes effective life much larger
me.isBoss = true; me.isBoss = true;
targets.push(me.id) //add to shield protection targets.push(me.id) //add to shield protection
me.friction = 0; me.friction = 0;
@@ -1103,7 +1103,7 @@ const spawn = {
// me.frictionAir = 0.005; // me.frictionAir = 0.005;
// me.memory = 1600; // me.memory = 1600;
// Matter.Body.setDensity(me, 0.02); //extra dense //normal is 0.001 //makes effective life much larger // Matter.Body.setDensity(me, 0.02); //extra dense //normal is 0.001 //makes effective life much larger
Matter.Body.setDensity(me, 0.0015 + 0.0005 * Math.sqrt(simulation.difficulty)); //extra dense //normal is 0.001 //makes effective life much larger Matter.Body.setDensity(me, 0.0005 + 0.00018 * Math.sqrt(simulation.difficulty)); //extra dense //normal is 0.001 //makes effective life much larger
spawn.shield(me, x, y, 1); spawn.shield(me, x, y, 1);
@@ -1353,14 +1353,12 @@ const spawn = {
me.frictionAir = 0.01; me.frictionAir = 0.01;
me.frictionStatic = 0; me.frictionStatic = 0;
me.friction = 0; me.friction = 0;
me.lookTorque = 0.000001 * (Math.random() > 0.5 ? -1 : 1); me.lookTorque = 0.000001 * (Math.random() > 0.5 ? -1 : 1);
me.fireDir = { me.fireDir = {
x: 0, x: 0,
y: 0 y: 0
} }
Matter.Body.setDensity(me, 0.023); //extra dense //normal is 0.001 //makes effective life much larger Matter.Body.setDensity(me, 0.008); //extra dense //normal is 0.001 //makes effective life much larger
spawn.shield(me, x, y, 1); spawn.shield(me, x, y, 1);
spawn.spawnOrbitals(me, radius + 200 + 300 * Math.random()) spawn.spawnOrbitals(me, radius + 200 + 300 * Math.random())
me.onHit = function() { me.onHit = function() {
@@ -1493,7 +1491,7 @@ const spawn = {
me.pulseRadius = Math.min(500, 230 + simulation.difficulty * 3) me.pulseRadius = Math.min(500, 230 + simulation.difficulty * 3)
me.fireDelay = Math.max(60, 140 - simulation.difficulty * 2) me.fireDelay = Math.max(60, 140 - simulation.difficulty * 2)
me.isFiring = false me.isFiring = false
Matter.Body.setDensity(me, 0.03); //extra dense //normal is 0.001 //makes effective life much larger Matter.Body.setDensity(me, 0.01); //extra dense //normal is 0.001 //makes effective life much larger
me.isBoss = true; me.isBoss = true;
spawn.shield(me, x, y, 1); spawn.shield(me, x, y, 1);
spawn.spawnOrbitals(me, radius + 200 + 300 * Math.random(), 1) spawn.spawnOrbitals(me, radius + 200 + 300 * Math.random(), 1)
@@ -1725,7 +1723,7 @@ const spawn = {
me.frictionAir = 0.03; me.frictionAir = 0.03;
// me.torque -= me.inertia * 0.002 // me.torque -= me.inertia * 0.002
spawn.spawnOrbitals(me, radius + 50 + 200 * Math.random()) spawn.spawnOrbitals(me, radius + 50 + 200 * Math.random())
Matter.Body.setDensity(me, 0.05); //extra dense //normal is 0.001 //makes effective life much larger Matter.Body.setDensity(me, 0.03); //extra dense //normal is 0.001 //makes effective life much larger
// spawn.shield(me, x, y, 1); //not working, not sure why // spawn.shield(me, x, y, 1); //not working, not sure why
me.onDeath = function() { me.onDeath = function() {
powerUps.spawnBossPowerUp(this.position.x, this.position.y) powerUps.spawnBossPowerUp(this.position.x, this.position.y)
@@ -2138,7 +2136,7 @@ const spawn = {
mobs.spawn(x, y, 3, radius, "rgba(255,0,200,0.5)"); mobs.spawn(x, y, 3, radius, "rgba(255,0,200,0.5)");
let me = mob[mob.length - 1]; let me = mob[mob.length - 1];
me.isBoss = true; me.isBoss = true;
Matter.Body.setDensity(me, 0.004 + 0.00035 * Math.sqrt(simulation.difficulty)); //extra dense //normal is 0.001 //makes effective life much larger Matter.Body.setDensity(me, 0.002 + 0.0001 * Math.sqrt(simulation.difficulty)); //extra dense //normal is 0.001 //makes effective life much larger
me.stroke = "transparent"; //used for drawGhost me.stroke = "transparent"; //used for drawGhost
me.seeAtDistance2 = 1500000; me.seeAtDistance2 = 1500000;
@@ -2230,7 +2228,7 @@ const spawn = {
x: 0, x: 0,
y: 0 y: 0
}; };
Matter.Body.setDensity(me, 0.03 + 0.0008 * Math.sqrt(simulation.difficulty)); //extra dense //normal is 0.001 //makes effective life much larger Matter.Body.setDensity(me, 0.01 + 0.0003 * Math.sqrt(simulation.difficulty)); //extra dense //normal is 0.001 //makes effective life much larger
me.onDeath = function() { me.onDeath = function() {
powerUps.spawnBossPowerUp(this.position.x, this.position.y) powerUps.spawnBossPowerUp(this.position.x, this.position.y)
// this.vertices = Matter.Vertices.hull(Matter.Vertices.clockwiseSort(this.vertices)) //helps collisions functions work better after vertex have been changed // this.vertices = Matter.Vertices.hull(Matter.Vertices.clockwiseSort(this.vertices)) //helps collisions functions work better after vertex have been changed
@@ -2499,7 +2497,7 @@ const spawn = {
spawn.shield(me, x, y, 1); spawn.shield(me, x, y, 1);
spawn.spawnOrbitals(me, radius + 50 + 200 * Math.random()) spawn.spawnOrbitals(me, radius + 50 + 200 * Math.random())
Matter.Body.setDensity(me, 0.004 + 0.0005 * Math.sqrt(simulation.difficulty)); //extra dense //normal is 0.001 //makes effective life much larger Matter.Body.setDensity(me, 0.002 + 0.0002 * Math.sqrt(simulation.difficulty)); //extra dense //normal is 0.001 //makes effective life much larger
me.onDeath = function() { me.onDeath = function() {
powerUps.spawnBossPowerUp(this.position.x, this.position.y) powerUps.spawnBossPowerUp(this.position.x, this.position.y)
// this.vertices = Matter.Vertices.hull(Matter.Vertices.clockwiseSort(this.vertices)) //helps collisions functions work better after vertex have been changed // this.vertices = Matter.Vertices.hull(Matter.Vertices.clockwiseSort(this.vertices)) //helps collisions functions work better after vertex have been changed
@@ -2539,7 +2537,7 @@ const spawn = {
spawn.shield(me, x, y, 1); spawn.shield(me, x, y, 1);
spawn.spawnOrbitals(me, radius + 50 + 200 * Math.random()) spawn.spawnOrbitals(me, radius + 50 + 200 * Math.random())
Matter.Body.setDensity(me, 0.03); //extra dense //normal is 0.001 //makes effective life much larger Matter.Body.setDensity(me, 0.01); //extra dense //normal is 0.001 //makes effective life much larger
me.onDeath = function() { me.onDeath = function() {
powerUps.spawnBossPowerUp(this.position.x, this.position.y) powerUps.spawnBossPowerUp(this.position.x, this.position.y)
// this.vertices = Matter.Vertices.hull(Matter.Vertices.clockwiseSort(this.vertices)) //helps collisions functions work better after vertex have been changed // this.vertices = Matter.Vertices.hull(Matter.Vertices.clockwiseSort(this.vertices)) //helps collisions functions work better after vertex have been changed
@@ -2600,7 +2598,7 @@ const spawn = {
spawn.shield(me, x, y, 1); spawn.shield(me, x, y, 1);
spawn.spawnOrbitals(me, radius + 50 + 200 * Math.random()) spawn.spawnOrbitals(me, radius + 50 + 200 * Math.random())
Matter.Body.setDensity(me, 0.025); //extra dense //normal is 0.001 //makes effective life much larger Matter.Body.setDensity(me, 0.01); //extra dense //normal is 0.001 //makes effective life much larger
me.onDeath = function() { me.onDeath = function() {
powerUps.spawnBossPowerUp(this.position.x, this.position.y) powerUps.spawnBossPowerUp(this.position.x, this.position.y)
// this.vertices = Matter.Vertices.hull(Matter.Vertices.clockwiseSort(this.vertices)) //helps collisions functions work better after vertex have been changed // this.vertices = Matter.Vertices.hull(Matter.Vertices.clockwiseSort(this.vertices)) //helps collisions functions work better after vertex have been changed
@@ -2751,7 +2749,7 @@ const spawn = {
me.accelMag = 0.00075 * simulation.accelScale; me.accelMag = 0.00075 * simulation.accelScale;
me.memory = 250; me.memory = 250;
me.laserRange = 500; me.laserRange = 500;
Matter.Body.setDensity(me, 0.0015 + 0.0005 * Math.sqrt(simulation.difficulty)); //extra dense //normal is 0.001 //makes effective life much larger Matter.Body.setDensity(me, 0.001 + 0.0001 * Math.sqrt(simulation.difficulty)); //extra dense //normal is 0.001 //makes effective life much larger
me.onDeath = function() { me.onDeath = function() {
powerUps.spawnBossPowerUp(this.position.x, this.position.y) powerUps.spawnBossPowerUp(this.position.x, this.position.y)
for (let i = 0; i < mob.length; i++) { //wake up tail mobs for (let i = 0; i < mob.length; i++) { //wake up tail mobs
@@ -2836,8 +2834,7 @@ const spawn = {
me.g = 0.0001; //required if using 'gravity' me.g = 0.0001; //required if using 'gravity'
me.accelMag = 0.002 * simulation.accelScale; me.accelMag = 0.002 * simulation.accelScale;
me.memory = 20; me.memory = 20;
Matter.Body.setDensity(me, 0.001 + 0.0005 * Math.sqrt(simulation.difficulty)); //extra dense //normal is 0.001 //makes effective life much larger Matter.Body.setDensity(me, 0.0005 + 0.0002 * Math.sqrt(simulation.difficulty)); //extra dense //normal is 0.001 //makes effective life much larger
cons[cons.length] = Constraint.create({ cons[cons.length] = Constraint.create({
pointA: { pointA: {
@@ -2997,7 +2994,7 @@ const spawn = {
mobs.spawn(x, y, nodes, radius, "rgb(255,0,150)"); mobs.spawn(x, y, nodes, radius, "rgb(255,0,150)");
let me = mob[mob.length - 1]; let me = mob[mob.length - 1];
me.isBoss = true; me.isBoss = true;
Matter.Body.setDensity(me, 0.004 + 0.00035 * Math.sqrt(simulation.difficulty)); //extra dense //normal is 0.001 //makes effective life much larger Matter.Body.setDensity(me, 0.002 + 0.00015 * Math.sqrt(simulation.difficulty)); //extra dense //normal is 0.001 //makes effective life much larger
me.stroke = "transparent"; //used for drawGhost me.stroke = "transparent"; //used for drawGhost
me.seeAtDistance2 = 2000000; me.seeAtDistance2 = 2000000;

View File

@@ -1748,6 +1748,7 @@
document.getElementById("health-bg").style.display = "none" document.getElementById("health-bg").style.display = "none"
document.getElementById("dmg").style.backgroundColor = "#0cf"; document.getElementById("dmg").style.backgroundColor = "#0cf";
tech.isEnergyHealth = true; tech.isEnergyHealth = true;
simulation.mobDmgColor = "rgba(14, 190, 235,0.7)" //"#0cf"
m.displayHealth(); m.displayHealth();
}, },
remove() { remove() {
@@ -1756,6 +1757,7 @@
document.getElementById("health-bg").style.display = "inline" document.getElementById("health-bg").style.display = "inline"
document.getElementById("dmg").style.backgroundColor = "#f67"; document.getElementById("dmg").style.backgroundColor = "#f67";
m.health = Math.max(Math.min(m.maxHealth, m.energy), 0.1); m.health = Math.max(Math.min(m.maxHealth, m.energy), 0.1);
simulation.mobDmgColor = "rgba(0,0,0,0.7)"
m.displayHealth(); m.displayHealth();
} }
}, { }, {
@@ -3586,8 +3588,8 @@
tech.isFastDrones = false tech.isFastDrones = false
} }
}, { }, {
name: "harvester", name: "delivery drone",
description: "after a <strong>drone</strong> picks up a <strong>power up</strong>,<br>it's <strong>larger</strong>, <strong>faster</strong>, and very <strong>durable</strong>", description: "if a <strong>drone</strong> picks up a <strong>power up</strong>,<br>it becomes <strong>larger</strong>, <strong>faster</strong>, and more <strong>durable</strong>",
isGunTech: true, isGunTech: true,
maxCount: 1, maxCount: 1,
count: 0, count: 0,
@@ -3603,7 +3605,7 @@
tech.isDroneGrab = false tech.isDroneGrab = false
} }
}, { }, {
name: "planned obsolescence", name: "reduced tolerances",
description: "reduce all <strong>drone</strong> production costs by <strong>300%</strong><br>reduce the average <strong>drone</strong> lifetime by <strong>53%</strong>", description: "reduce all <strong>drone</strong> production costs by <strong>300%</strong><br>reduce the average <strong>drone</strong> lifetime by <strong>53%</strong>",
isGunTech: true, isGunTech: true,
maxCount: 3, maxCount: 3,
@@ -3614,8 +3616,9 @@
}, },
requires: "drones", requires: "drones",
effect() { effect() {
tech.droneCycleReduction = Math.pow(0.47, this.count) tech.droneCycleReduction = Math.pow(0.47, 1 + this.count)
tech.droneEnergyReduction = Math.pow(0.33, this.count) tech.droneEnergyReduction = Math.pow(0.33, 1 + this.count)
console.log(tech.droneCycleReduction, tech.droneEnergyReduction)
for (i = 0, len = b.guns.length; i < len; i++) { //find which gun for (i = 0, len = b.guns.length; i < len; i++) { //find which gun
if (b.guns[i].name === "drones") b.guns[i].ammoPack = b.guns[i].defaultAmmoPack * Math.pow(3, this.count) if (b.guns[i].name === "drones") b.guns[i].ammoPack = b.guns[i].defaultAmmoPack * Math.pow(3, this.count)
} }

View File

@@ -1,14 +1,8 @@
******************************************************** NEXT PATCH ******************************************************** ******************************************************** NEXT PATCH ********************************************************
bug fixes level bosses will do about 50% less damage on collisions, but they will take about 33% more to kill
strong anthropic principle does 0.03599% more damage
spores can stick to rotating blocks now
probably fixed the new wormhole field while targeting a block -> crouch lock bug
ceramic needles now correctly bypass shields
needles fire 3 at a time with a short delay and no spread fixed and renamed the new drone tech
tech: planned obsolescence - 3x drone ammo, 1/3 drone nano-scale energy cost, but 53% reduced drone life span
******************************************************** BUGS ******************************************************** ******************************************************** BUGS ********************************************************
@@ -41,6 +35,8 @@ fix door.isOpen actually meaning isClosed?
******************************************************** TODO ******************************************************** ******************************************************** TODO ********************************************************
damage circles when you have MEE should be field color
mob vision: look at player history mob vision: look at player history
build a new type of attraction for mobs build a new type of attraction for mobs
if mobs can't see player, they check to see if they can see where the player was in the history if mobs can't see player, they check to see if they can see where the player was in the history