nano scale Manufacturing balance

This commit is contained in:
landgreen
2019-09-18 06:03:13 -07:00
parent 9187ced17d
commit f36bf2ebb2
4 changed files with 34 additions and 6 deletions

View File

@@ -207,7 +207,7 @@ const b = {
knock = Matter.Vector.mult(Matter.Vector.normalise(sub), (-Math.sqrt(dmg * damageScale) * mob[i].mass) / 18); knock = Matter.Vector.mult(Matter.Vector.normalise(sub), (-Math.sqrt(dmg * damageScale) * mob[i].mass) / 18);
mob[i].force.x += knock.x; mob[i].force.x += knock.x;
mob[i].force.y += knock.y; mob[i].force.y += knock.y;
damageScale *= 0.7 //reduced damage for each additional explosion target damageScale *= 0.8 //reduced damage for each additional explosion target
} else if (!mob[i].seePlayer.recall && dist < alertRange) { } else if (!mob[i].seePlayer.recall && dist < alertRange) {
mob[i].locatePlayer(); mob[i].locatePlayer();
knock = Matter.Vector.mult(Matter.Vector.normalise(sub), (-Math.sqrt(dmg * damageScale) * mob[i].mass) / 35); knock = Matter.Vector.mult(Matter.Vector.normalise(sub), (-Math.sqrt(dmg * damageScale) * mob[i].mass) / 35);

View File

@@ -12,9 +12,10 @@ const level = {
start() { start() {
// game.zoomScale = 1400 //1400 // game.zoomScale = 1400 //1400
if (game.levelsCleared === 0) { if (game.levelsCleared === 0) {
document.title = "n-gon";
this.intro(); //starting level this.intro(); //starting level
// b.giveGuns(0) // set a starting gun for testing // b.giveGuns(0) // set a starting gun for testing
// mech.fieldUpgrades[2]() //give a field power up for testing mech.fieldUpgrades[5]() //give a field power up for testing
// game.levelsCleared = 3; //for testing to simulate possible mobs spawns // game.levelsCleared = 3; //for testing to simulate possible mobs spawns
// this.bosses(); // this.bosses();
// this.testingMap(); // this.testingMap();

View File

@@ -708,7 +708,7 @@ const mech = {
// push all mobs in range // push all mobs in range
for (let i = 0, len = mob.length; i < len; ++i) { for (let i = 0, len = mob.length; i < len; ++i) {
if (this.lookingAt(mob[i]) && Matter.Vector.magnitude(Matter.Vector.sub(mob[i].position, this.pos)) < this.grabRange && Matter.Query.ray(map, mob[i].position, this.pos).length === 0) { if (this.lookingAt(mob[i]) && Matter.Vector.magnitude(Matter.Vector.sub(mob[i].position, this.pos)) < this.grabRange && Matter.Query.ray(map, mob[i].position, this.pos).length === 0) {
const fieldBlockCost = Math.max(0.02, mob[i].mass * 0.02) const fieldBlockCost = Math.max(0.02, mob[i].mass * 0.015)
if (this.fieldMeter > fieldBlockCost) { if (this.fieldMeter > fieldBlockCost) {
this.fieldMeter -= fieldBlockCost; this.fieldMeter -= fieldBlockCost;
if (this.fieldDamage) mob[i].damage(b.dmgScale * this.fieldDamage); if (this.fieldDamage) mob[i].damage(b.dmgScale * this.fieldDamage);
@@ -870,7 +870,7 @@ const mech = {
}, },
() => { () => {
mech.fieldMode = 2; mech.fieldMode = 2;
game.makeTextLog("<strong style='font-size:30px;'>Kinetic Energy Field</strong><br> (left mouse or space bar)<p> field emitter does damage on contact <br> blocks are thrown at a higher velocity</p>", 1000); game.makeTextLog("<strong style='font-size:30px;'>Kinetic Energy Field</strong><br> (left mouse or space bar)<p> field emitter does damage on contact<br> blocks are thrown at a higher velocity</p>", 1000);
mech.setHoldDefaults(); mech.setHoldDefaults();
//throw quicker and harder //throw quicker and harder
mech.throwChargeRate = 3; //0.5 mech.throwChargeRate = 3; //0.5
@@ -920,7 +920,7 @@ const mech = {
}, },
() => { () => {
mech.fieldMode = 3; mech.fieldMode = 3;
game.makeTextLog("<strong style='font-size:30px;'>Negative Mass Field</strong><br> (left mouse or space bar)<p> field emitter nullifies gravity around player<br> field emitter can hold more massive objects</p>", 1000); game.makeTextLog("<strong style='font-size:30px;'>Negative Mass Field</strong><br> (left mouse or space bar)<p> field emitter nullifies gravity around player<br> field emitter holds more massive objects</p>", 1000);
mech.setHoldDefaults(); mech.setHoldDefaults();
mech.holdingMassScale = 0.05; //can hold heavier blocks mech.holdingMassScale = 0.05; //can hold heavier blocks
mech.fieldArc = 1; //field covers full 360 degrees mech.fieldArc = 1; //field covers full 360 degrees
@@ -1007,6 +1007,34 @@ const mech = {
mech.drawFieldMeter() mech.drawFieldMeter()
} }
}, },
() => {
mech.fieldMode = 5;
game.makeTextLog("<strong style='font-size:30px;'>Nano-Scale Manufacturing</strong><br> (passive effect) <p>when energy is full, build a drone using 10 energy<br> reduced energy regeneration</p>", 1000);
mech.setHoldDefaults();
mech.fieldRegen = 0.0005 //0.0015;
mech.hold = function () {
if (mech.fieldMeter === 1) {
mech.fieldMeter -= 0.1;
b.guns[12].fire() //spawn drone
}
if (mech.isHolding) {
mech.drawHold(mech.holdingTarget);
mech.holding();
mech.throw();
} else if ((keys[32] || game.mouseDownRight && mech.fieldMeter > 0.1)) { //not hold but field button is pressed
mech.drawField();
mech.grabPowerUp();
mech.pushMobs();
mech.lookForPickUp();
} else if (mech.holdingTarget && mech.fireCDcycle < game.cycle) { //holding, but field button is released
mech.pickUp();
} else {
mech.holdingTarget = null; //clears holding target (this is so you only pick up right after the field button is released and a hold target exists)
}
mech.drawFieldMeter()
}
},
// () => { // () => {
// mech.fieldMode = 1; // mech.fieldMode = 1;
// game.makeTextLog("<h2>Time Dilation Field</h2><br><strong>active ability:</strong> hold left and right mouse to slow time<br><strong>passive bonus:</strong> +field regeneration", 1000); //<br><strong>passive bonus:</strong> can phase through blocks // game.makeTextLog("<h2>Time Dilation Field</h2><br><strong>active ability:</strong> hold left and right mouse to slow time<br><strong>passive bonus:</strong> +field regeneration", 1000); //<br><strong>passive bonus:</strong> can phase through blocks

View File

@@ -858,7 +858,6 @@ const spawn = {
let me = mob[mob.length - 1]; let me = mob[mob.length - 1];
me.stroke = "transparent"; me.stroke = "transparent";
me.onHit = function () { me.onHit = function () {
console.log(this.mass)
this.explode(); this.explode();
}; };
Matter.Body.setDensity(me, 0.001); //normal is 0.001 Matter.Body.setDensity(me, 0.001); //normal is 0.001