negative mass field

plasma field does 20% more damage, but can no longer block

bremsstrahlung radiation only apply to the harmonic field, and does a bit less damage

negative mass field
moves faster horizontally
can't block
can hold mroe massive blocks, but can't throw them fast
takes 0.5 dmg while active
This commit is contained in:
landgreen
2020-03-12 06:49:26 -07:00
parent bad077e7eb
commit 9c7eed3b29
6 changed files with 79 additions and 53 deletions

View File

@@ -524,22 +524,6 @@ const b = {
b.isModPiezo = false;
}
},
{
name: "bremsstrahlung radiation",
description: "when your <strong>field blocks</strong> it also does <strong class='color-d'>damage</strong>",
maxCount: 9,
count: 0,
allowed() {
return mech.fieldUpgrades[mech.fieldMode].name !== "time dilation field" && mech.fieldUpgrades[mech.fieldMode].name !== "phase decoherence field" && !(b.isModHawking && mech.fieldUpgrades[mech.fieldMode].name === "negative mass field")
},
requires: "not time dilation field<br><strong>requires</strong> not phase decoherence field",
effect() {
b.modBlockDmg += 0.7 //if you change this value also update the for loop in the electricity graphics in mech.pushMass
},
remove() {
b.modBlockDmg = 0;
}
},
{
name: "energy conservation",
description: "gain <strong class='color-f'>energy</strong> proportional to <strong class='color-d'>damage</strong> done",
@@ -1095,6 +1079,22 @@ const b = {
b.isModHawking = 0;
}
},
{
name: "bremsstrahlung radiation",
description: "<strong>blocking</strong> with <strong>standing wave harmonics</strong><br><strong class='color-d'>damages</strong> the blocked mob ",
maxCount: 9,
count: 0,
allowed() {
return mech.fieldUpgrades[mech.fieldMode].name === "standing wave harmonics"
},
requires: "standing wave harmonics",
effect() {
b.modBlockDmg += 0.6 //if you change this value also update the for loop in the electricity graphics in mech.pushMass
},
remove() {
b.modBlockDmg = 0;
}
},
{
name: "frequency resonance",
description: "<strong>standing wave harmonics</strong> shield is retuned<br>increase <strong>size</strong> and <strong>blocking</strong> efficiency by <strong>30%</strong>",

View File

@@ -205,6 +205,8 @@ function collisionChecks(event) {
if (mob[k].isShielded) dmg *= 0.5
mob[k].damage(dmg, true);
if (mob[k].distanceToPlayer2() < 1000000) mob[k].foundPlayer();
// mobs.statusStun(mob[k], 120)
game.drawList.push({
//add dmg to draw queue
x: pairs[i].activeContacts[0].vertex.x,

View File

@@ -79,13 +79,13 @@ const mobs = {
})
}
},
statusStun(who, cycles = 120) {
statusStun(who, cycles = 180) {
if (!who.shield && !who.isShielded) {
Matter.Body.setVelocity(who, {
x: who.velocity.x * 0.8,
y: who.velocity.y * 0.8
x: who.velocity.x * 0.5,
y: who.velocity.y * 0.5
});
Matter.Body.setAngularVelocity(who, who.angularVelocity * 0.8);
Matter.Body.setAngularVelocity(who, who.angularVelocity * 0.5);
//remove other "stun" effects on this mob
let i = who.status.length
while (i--) {
@@ -98,8 +98,7 @@ const mobs = {
x: who.position.x + 100 * (Math.random() - 0.5),
y: who.position.y + 100 * (Math.random() - 0.5)
}
who.force.y += who.mass * 0.001 //extra gravity
if (who.velocity.y < 2) who.force.y += who.mass * 0.0005 //extra gravity
ctx.beginPath();
ctx.moveTo(who.vertices[0].x, who.vertices[0].y);
for (let j = 1, len = who.vertices.length; j < len; ++j) {

View File

@@ -458,6 +458,7 @@ const mech = {
defaultFPSCycle: 0, //tracks when to return to normal fps
collisionImmuneCycle: 0, //used in engine
damage(dmg) {
dmg *= mech.fieldDamageResistance
if (b.isModEntanglement && b.inventory[0] === b.activeGun) {
for (let i = 0, len = b.inventory.length; i < len; i++) {
dmg *= 0.9
@@ -670,6 +671,7 @@ const mech = {
fieldRegen: 0,
fieldMode: 0,
fieldFire: false,
fieldDamageResistance: 1,
holdingMassScale: 0,
throwChargeRate: 0,
throwChargeMax: 0,
@@ -682,6 +684,7 @@ const mech = {
if (mech.energy < mech.fieldEnergyMax) mech.energy = mech.fieldEnergyMax;
mech.fieldRegen = 0.001;
mech.fieldShieldingScale = 1;
mech.fieldDamageResistance = 1;
mech.fieldFire = false;
mech.fieldCDcycle = 0;
mech.isStealth = false;
@@ -1223,7 +1226,8 @@ const mech = {
mech.energy -= DRAIN;
mech.grabPowerUp();
mech.lookForPickUp();
mech.pushMobs360();
// mech.pushMobs360();
// mech.pushMobsFacing();
//calculate laser collision
let best;
@@ -1297,7 +1301,7 @@ const mech = {
y: best.y
};
if (best.who.alive) {
const dmg = 0.4 * b.dmgScale; //********** SCALE DAMAGE HERE *********************
const dmg = 0.5 * b.dmgScale; //********** SCALE DAMAGE HERE *********************
best.who.damage(dmg);
best.who.locatePlayer();
@@ -1354,10 +1358,10 @@ const mech = {
ctx.lineWidth = 2 * Math.random();
ctx.stroke();
//draw shield around player
ctx.beginPath();
ctx.arc(mech.pos.x, mech.pos.y, mech.fieldRange * 0.75, 0, 2 * Math.PI);
ctx.fillStyle = "rgba(255,0,255,0.05)"
ctx.fill();
// ctx.beginPath();
// ctx.arc(mech.pos.x, mech.pos.y, mech.fieldRange * 0.75, 0, 2 * Math.PI);
// ctx.fillStyle = "rgba(255,0,255,0.05)"
// ctx.fill();
// mech.pushBody360(100); //disabled because doesn't work at short range
} else {
mech.fieldCDcycle = mech.cycle + 120; //if out of energy
@@ -1373,16 +1377,17 @@ const mech = {
},
{
name: "negative mass field",
description: "use <strong class='color-f'>energy</strong> to nullify &nbsp; <strong style='letter-spacing: 12px;'>gravity</strong><br><strong>launch</strong> larger blocks at much higher speeds",
description: "use <strong class='color-f'>energy</strong> to nullify &nbsp; <strong style='letter-spacing: 12px;'>gravity</strong><br>and reduce <strong>harm</strong> by <strong>50%</strong>", //<br><strong>launch</strong> larger blocks at much higher speeds
fieldDrawRadius: 0,
isEasyToAim: true,
effect: () => {
mech.fieldFire = true;
mech.throwChargeRate = 3;
mech.throwChargeMax = 110;
// mech.throwChargeRate = 3;
// mech.throwChargeMax = 110;
mech.holdingMassScale = 0.03; //can hold heavier blocks with lower cost to jumping
mech.hold = function () {
mech.fieldDamageResistance = 1;
if (mech.isHolding) {
mech.drawHold(mech.holdingTarget);
mech.holding();
@@ -1390,9 +1395,23 @@ const mech = {
} else if ((keys[32] || game.mouseDownRight) && mech.fieldCDcycle < mech.cycle) { //push away
const DRAIN = 0.00035
if (mech.energy > DRAIN) {
mech.fieldDamageResistance = 0.5;
mech.grabPowerUp();
mech.lookForPickUp();
mech.pushMobs360();
// mech.pushMobs360();
//repulse mobs
// for (let i = 0, len = mob.length; i < len; ++i) {
// sub = Vector.sub(mob[i].position, mech.pos);
// dist2 = Vector.magnitudeSquared(sub);
// if (dist2 < this.fieldDrawRadius * this.fieldDrawRadius) {
// const force = Vector.mult(Vector.perp(Vector.normalise(sub)), 0.002)
// mob[i].force.x = force.x
// mob[i].force.y = force.y
// }
// }
//look for nearby objects to make zero-g
function zeroG(who, range, mag = 1.06) {
for (let i = 0, len = who.length; i < len; ++i) {
@@ -1428,7 +1447,7 @@ const mech = {
//add extra friction for horizontal motion
if (keys[65] || keys[68] || keys[37] || keys[39]) {
Matter.Body.setVelocity(player, {
x: player.velocity.x * 0.95,
x: player.velocity.x * 0.99,
y: player.velocity.y * 0.97
});
} else { //slow rise and fall
@@ -1447,7 +1466,7 @@ const mech = {
if (b.isModHawking) {
for (let i = 0, len = mob.length; i < len; i++) {
if (mob[i].distanceToPlayer2() < this.fieldDrawRadius * this.fieldDrawRadius && Matter.Query.ray(map, mech.pos, mob[i].position).length === 0 && Matter.Query.ray(body, mech.pos, mob[i].position).length === 0) {
mob[i].damage(b.dmgScale * 0.08);
mob[i].damage(b.dmgScale * 0.085);
mob[i].locatePlayer();
//draw electricity

View File

@@ -236,12 +236,12 @@ const powerUps = {
if (Math.random() < b.isModBayesian) powerUps.spawn(x, y, "gun");
return;
}
if (Math.random() < 0.0027 * (14 - b.modCount)) { //a new mod has a low chance for each not acquired mod up to 15
if (Math.random() < 0.0027 * (15 - b.modCount)) { //a new mod has a low chance for each not acquired mod up to 15
powerUps.spawn(x, y, "mod");
if (Math.random() < b.isModBayesian) powerUps.spawn(x, y, "mod");
return;
}
if (Math.random() < 0.003) {
if (Math.random() < 0.002) {
powerUps.spawn(x, y, "field");
if (Math.random() < b.isModBayesian) powerUps.spawn(x, y, "field");
return;
@@ -251,13 +251,13 @@ const powerUps = {
if (mech.fieldMode === 0) {
powerUps.spawn(x, y, "field")
if (Math.random() < b.isModBayesian) powerUps.spawn(x, y, "field")
} else if (Math.random() < 0.80) {
} else if (Math.random() < 0.85) {
powerUps.spawn(x, y, "mod")
if (Math.random() < b.isModBayesian) powerUps.spawn(x, y, "mod")
} else if (Math.random() < 0.35) {
powerUps.spawn(x, y, "gun")
if (Math.random() < b.isModBayesian) powerUps.spawn(x, y, "gun")
} else if (Math.random() < 0.65) {
} else if (Math.random() < 0.5) {
powerUps.spawn(x, y, "field");
if (Math.random() < b.isModBayesian) powerUps.spawn(x, y, "field");
} else if (mech.health < 0.7) {