negative mass field mod

This commit is contained in:
landgreen
2020-02-28 06:48:49 -08:00
parent c9898ad53f
commit 6f6131237a
4 changed files with 32 additions and 7 deletions

View File

@@ -57,13 +57,14 @@ const b = {
isModFlechetteMultiShot: null, isModFlechetteMultiShot: null,
isModMineAmmoBack: null, isModMineAmmoBack: null,
isModRailNails: null, isModRailNails: null,
isModHawking: null,
modOnHealthChange() { //used with acid mod modOnHealthChange() { //used with acid mod
if (b.isModAcidDmg && mech.health > 0.8) { if (b.isModAcidDmg && mech.health > 0.8) {
game.playerDmgColor = "rgba(0,80,80,0.9)" game.playerDmgColor = "rgba(0,80,80,0.9)"
b.modAcidDmg = 0.9 b.modAcidDmg = 1.5
} else { } else {
game.playerDmgColor = "rgba(0,0,0,0.7)" game.playerDmgColor = "rgba(0,0,0,0.7)"
b.modAcidDmg = 0 b.modAcidDmg = 1
} }
}, },
mods: [{ mods: [{
@@ -1014,6 +1015,22 @@ const b = {
b.isModSporeField = false; b.isModSporeField = false;
} }
}, },
{
name: "hawking radiation",
description: "<strong>negative mass field</strong> releases virtual particles that<br><strong class='color-d'>damage</strong> mobs within range",
maxCount: 1,
count: 0,
allowed() {
return mech.fieldUpgrades[mech.fieldMode].name === "negative mass field"
},
requires: "negative mass field",
effect() {
b.isModHawking = true;
},
remove() {
b.isModHawking = false;
}
},
], ],
removeMod(index) { removeMod(index) {
b.mods[index].remove(); b.mods[index].remove();

View File

@@ -178,6 +178,7 @@ function collisionChecks(event) {
if (obj.classType === "bullet" && obj.speed > obj.minDmgSpeed) { if (obj.classType === "bullet" && obj.speed > obj.minDmgSpeed) {
// const dmg = b.dmgScale * (obj.dmg + 0.15 * obj.mass * Vector.magnitude(Vector.sub(mob[k].velocity, obj.velocity))); // const dmg = b.dmgScale * (obj.dmg + 0.15 * obj.mass * Vector.magnitude(Vector.sub(mob[k].velocity, obj.velocity)));
let dmg = b.dmgScale * (obj.dmg + b.modAcidDmg + 0.15 * obj.mass * Vector.magnitude(Vector.sub(mob[k].velocity, obj.velocity))) let dmg = b.dmgScale * (obj.dmg + b.modAcidDmg + 0.15 * obj.mass * Vector.magnitude(Vector.sub(mob[k].velocity, obj.velocity)))
// console.log(obj.dmg / (0.15 * obj.mass * Vector.magnitude(Vector.sub(mob[k].velocity, obj.velocity))))
if (b.isModCrit && !mob[k].seePlayer.recall && !mob[k].shield) dmg *= 5 if (b.isModCrit && !mob[k].seePlayer.recall && !mob[k].shield) dmg *= 5
mob[k].foundPlayer(); mob[k].foundPlayer();
mob[k].damage(dmg); mob[k].damage(dmg);
@@ -195,7 +196,7 @@ function collisionChecks(event) {
if (obj.classType === "body" && obj.speed > 5) { if (obj.classType === "body" && obj.speed > 5) {
const v = Vector.magnitude(Vector.sub(mob[k].velocity, obj.velocity)); const v = Vector.magnitude(Vector.sub(mob[k].velocity, obj.velocity));
if (v > 8) { if (v > 8) {
let dmg = b.dmgScale * (b.modAcidDmg + v * Math.sqrt(obj.mass) * 0.07); let dmg = b.dmgScale * (v * Math.sqrt(obj.mass) * 0.07);
mob[k].damage(dmg, true); mob[k].damage(dmg, true);
if (mob[k].distanceToPlayer2() < 1000000) mob[k].foundPlayer(); if (mob[k].distanceToPlayer2() < 1000000) mob[k].foundPlayer();
game.drawList.push({ game.drawList.push({

View File

@@ -1442,6 +1442,15 @@ const mech = {
ctx.globalCompositeOperation = "difference"; ctx.globalCompositeOperation = "difference";
ctx.fill(); ctx.fill();
ctx.globalCompositeOperation = "source-over"; ctx.globalCompositeOperation = "source-over";
if (b.isModHawking) {
for (let i = 0, len = mob.length; i < len; i++) {
if (Vector.magnitude(Vector.sub(mob[i].position, mech.pos)) < this.fieldDrawRadius) {
}
}
}
} else { } else {
//trigger cool down //trigger cool down
mech.fieldCDcycle = mech.cycle + 120; mech.fieldCDcycle = mech.cycle + 120;

View File

@@ -1,5 +1,7 @@
************** TODO - n-gon ************** ************** TODO - n-gon **************
mod - negative mass field does damage to mobs in zone
mod - flechettes mod for poison damage mod - flechettes mod for poison damage
other flechettes multi-shot is disabled other flechettes multi-shot is disabled
mod - flechettes are guided towards targets mod - flechettes are guided towards targets
@@ -13,10 +15,6 @@ gun - buff vacuum bomb
mod - double explosions? mod - double explosions?
mod - doesn't suck player in? mod - doesn't suck player in?
mod - negative mass field does damage to mobs in zone
mod - rail gun burst on impact into nails
mod - make bodies destroyable mod - make bodies destroyable
they drop ammo and heals they drop ammo and heals