explosions balance, added pulse gun, harmonic field balance
This commit is contained in:
1152
js/bullets.js
1152
js/bullets.js
File diff suppressed because it is too large
Load Diff
@@ -14,8 +14,8 @@ const level = {
|
||||
start() {
|
||||
if (level.levelsCleared === 0) {
|
||||
// game.difficulty = 6; //for testing to simulate possible mobs spawns
|
||||
// b.giveGuns(7)
|
||||
// mech.fieldUpgrades[1].effect();
|
||||
b.giveGuns(15)
|
||||
// mech.fieldUpgrades[2].effect();
|
||||
// b.giveMod(21)
|
||||
|
||||
this.intro(); //starting level
|
||||
@@ -109,10 +109,7 @@ const level = {
|
||||
// powerUps.spawn(450, -400, "mod", false, 6);
|
||||
// powerUps.spawn(450, -400, "mod", false);
|
||||
// spawn.bodyRect(-45, -100, 40, 50);
|
||||
spawn.starter(800, -1050);
|
||||
spawn.starter(800, -1050);
|
||||
spawn.starter(800, -1050);
|
||||
spawn.starter(800, -1050);
|
||||
spawn.shooter(800, -1050);
|
||||
// spawn.groupBoss(-600, -550);
|
||||
// spawn.hopper(800, -150);
|
||||
// spawn.beamer(800, -150);
|
||||
|
||||
18
js/mobs.js
18
js/mobs.js
@@ -268,12 +268,7 @@ const mobs = {
|
||||
ctx.setLineDash([125 * Math.random(), 125 * Math.random()]);
|
||||
// ctx.lineDashOffset = 6*(game.cycle % 215);
|
||||
if (this.distanceToPlayer() < this.laserRange && !mech.isStealth) {
|
||||
//if (Math.random()>0.2 && this.seePlayer.yes && this.distanceToPlayer2()<800000) {
|
||||
if (b.isModTempResist) {
|
||||
mech.damage(0.00006 * game.dmgScale);
|
||||
} else {
|
||||
mech.damage(0.0003 * game.dmgScale);
|
||||
}
|
||||
mech.damage(0.0003 * game.dmgScale);
|
||||
if (mech.fieldMeter > 0.1) mech.fieldMeter -= 0.004
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(this.position.x, this.position.y);
|
||||
@@ -361,12 +356,7 @@ const mobs = {
|
||||
if (!mech.isStealth) vertexCollision(this.position, look, [player]);
|
||||
// hitting player
|
||||
if (best.who === player) {
|
||||
if (b.isModTempResist) {
|
||||
dmg = 0.0004 * game.dmgScale;
|
||||
} else {
|
||||
dmg = 0.002 * game.dmgScale;
|
||||
}
|
||||
|
||||
dmg = 0.002 * game.dmgScale;
|
||||
mech.damage(dmg);
|
||||
//draw damage
|
||||
ctx.fillStyle = color;
|
||||
@@ -915,8 +905,8 @@ const mobs = {
|
||||
const angle = Math.atan2(unitVector.y, unitVector.x);
|
||||
Matter.Body.setAngle(this, angle - Math.PI);
|
||||
},
|
||||
explode() {
|
||||
mech.damage(Math.min(Math.max(0.02 * Math.sqrt(this.mass), 0.01), 0.35) * game.dmgScale);
|
||||
explode(mass = this.mass) {
|
||||
mech.damage(Math.min(Math.max(0.02 * Math.sqrt(mass), 0.01), 0.35) * game.dmgScale);
|
||||
this.dropPowerUp = false;
|
||||
this.death(); //death with no power up or body
|
||||
},
|
||||
|
||||
43
js/player.js
43
js/player.js
@@ -458,7 +458,7 @@ const mech = {
|
||||
if (b.isModDroneOnDamage) {
|
||||
const len = (dmg - 0.08 + 0.05 * Math.random()) / 0.05
|
||||
for (let i = 0; i < len; i++) {
|
||||
if (Math.random() < 0.6) b.guns[13].fire() //spawn drone
|
||||
if (Math.random() < 0.6) b.drone() //spawn drone
|
||||
}
|
||||
}
|
||||
|
||||
@@ -886,20 +886,20 @@ const mech = {
|
||||
mech.holdingTarget = null
|
||||
//knock backs
|
||||
const unit = Matter.Vector.normalise(Matter.Vector.sub(player.position, who.position))
|
||||
const mass = Math.min(Math.sqrt(who.mass), 3.5); //large masses above 4*4 can start to overcome the push back
|
||||
const massRoot = Math.sqrt(Math.min(12, Math.max(0.15, who.mass))); // masses above 12 can start to overcome the push back
|
||||
Matter.Body.setVelocity(who, {
|
||||
x: player.velocity.x - (15 * unit.x) / mass,
|
||||
y: player.velocity.y - (15 * unit.y) / mass
|
||||
x: player.velocity.x - (15 * unit.x) / massRoot,
|
||||
y: player.velocity.y - (15 * unit.y) / massRoot
|
||||
});
|
||||
if (mech.crouch) {
|
||||
Matter.Body.setVelocity(player, {
|
||||
x: player.velocity.x + 0.4 * unit.x * mass,
|
||||
y: player.velocity.y + 0.4 * unit.y * mass
|
||||
x: player.velocity.x + 0.4 * unit.x * massRoot,
|
||||
y: player.velocity.y + 0.4 * unit.y * massRoot
|
||||
});
|
||||
} else {
|
||||
Matter.Body.setVelocity(player, {
|
||||
x: player.velocity.x + 5 * unit.x * mass,
|
||||
y: player.velocity.y + 5 * unit.y * mass
|
||||
x: player.velocity.x + 5 * unit.x * massRoot,
|
||||
y: player.velocity.y + 5 * unit.y * massRoot
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1086,7 +1086,7 @@ const mech = {
|
||||
mech.holding();
|
||||
mech.throw();
|
||||
} else if ((keys[32] || game.mouseDownRight) && mech.fieldCDcycle < mech.cycle) {
|
||||
const DRAIN = 0.0027
|
||||
const DRAIN = 0.0023
|
||||
if (mech.fieldMeter > DRAIN) {
|
||||
mech.fieldMeter -= DRAIN;
|
||||
|
||||
@@ -1140,7 +1140,7 @@ const mech = {
|
||||
},
|
||||
{
|
||||
name: "plasma torch",
|
||||
description: "use <strong class='color-f'>energy</strong> to emit <strong class='color-d'>damaging</strong> plasma<br><strong>decreased</strong> <strong>shield</strong> range and efficiency",
|
||||
description: "use <strong class='color-f'>energy</strong> to emit <strong class='color-d'>damaging</strong> plasma<br><em>effective at close range</em>",
|
||||
effect: () => {
|
||||
mech.fieldMode = 2;
|
||||
mech.fieldText();
|
||||
@@ -1289,10 +1289,16 @@ const mech = {
|
||||
}
|
||||
ctx.lineWidth = 2 * Math.random();
|
||||
ctx.stroke();
|
||||
//draw shield around player
|
||||
const pushRange = 110;
|
||||
ctx.beginPath();
|
||||
ctx.arc(mech.pos.x, mech.pos.y, pushRange, 0, 2 * Math.PI);
|
||||
ctx.fillStyle = "rgba(255,0,255,0.05)"
|
||||
ctx.fill();
|
||||
|
||||
mech.grabPowerUp();
|
||||
mech.lookForPickUp();
|
||||
mech.pushMobs360(110);
|
||||
mech.pushMobs360(pushRange);
|
||||
// mech.pushBody360(100); //disabled because doesn't work at short range
|
||||
} else {
|
||||
mech.fieldCDcycle = mech.cycle + 120; //if out of energy
|
||||
@@ -1395,13 +1401,13 @@ const mech = {
|
||||
},
|
||||
{
|
||||
name: "standing wave harmonics",
|
||||
description: "oscillating <strong>shields</strong> surround you <strong>constantly</strong><br> <strong>decreased</strong> <strong class='color-f'>energy</strong> regeneration",
|
||||
description: "three oscillating <strong>shields</strong> are perminantly active<br><strong class='color-f'>energy</strong> regenerates at normal rate",
|
||||
effect: () => {
|
||||
mech.fieldMode = 4;
|
||||
mech.fieldText();
|
||||
mech.setHoldDefaults();
|
||||
mech.fieldRegen *= 0.6;
|
||||
mech.fieldShieldingScale = 1.5;
|
||||
// mech.fieldRegen *= 0.6;
|
||||
mech.fieldShieldingScale = 1.33;
|
||||
|
||||
mech.hold = function () {
|
||||
if (mech.isHolding) {
|
||||
@@ -1440,17 +1446,16 @@ const mech = {
|
||||
},
|
||||
{
|
||||
name: "nano-scale manufacturing",
|
||||
description: "excess <strong class='color-f'>energy</strong> used to build <strong>drones</strong><br><strong>3x</strong> <strong class='color-f'>energy</strong> regeneration",
|
||||
description: "excess <strong class='color-f'>energy</strong> used to build <strong>drones</strong><br><strong>2x</strong> <strong class='color-f'>energy</strong> regeneration",
|
||||
effect: () => {
|
||||
let gunIndex = 13 //Math.random() < 0.5 ? 13 : 14
|
||||
mech.fieldMode = 5;
|
||||
mech.fieldText();
|
||||
mech.setHoldDefaults();
|
||||
mech.fieldRegen *= 3;
|
||||
mech.fieldRegen *= 2;
|
||||
mech.hold = function () {
|
||||
if (mech.fieldMeter > mech.fieldEnergyMax - 0.02) {
|
||||
mech.fieldMeter -= 0.43;
|
||||
b.guns[gunIndex].fire() //spawn drone
|
||||
mech.fieldMeter -= 0.32;
|
||||
b.drone(1)
|
||||
mech.fireCDcycle = mech.cycle + 25; // set fire cool down to prevent +energy from making huge numbers of drones
|
||||
}
|
||||
if (mech.isHolding) {
|
||||
|
||||
@@ -900,9 +900,9 @@ const spawn = {
|
||||
let me = mob[mob.length - 1];
|
||||
me.stroke = "transparent";
|
||||
me.onHit = function () {
|
||||
this.explode();
|
||||
this.explode(this.mass * 10);
|
||||
};
|
||||
Matter.Body.setDensity(me, 0.001); //normal is 0.001
|
||||
Matter.Body.setDensity(me, 0.0001); //normal is 0.001
|
||||
me.timeLeft = 240;
|
||||
me.g = 0.001; //required if using 'gravity'
|
||||
me.frictionAir = 0;
|
||||
|
||||
Reference in New Issue
Block a user