added phase shield damamge mod

This commit is contained in:
lilgreenland
2020-03-04 10:34:02 -08:00
parent 7a9ef5dcd1
commit 0fe34c219a
4 changed files with 47 additions and 5 deletions

View File

@@ -1099,6 +1099,22 @@ const b = {
b.isModMissileField = false;
}
},
{
name: "quantum dissipation",
description: "<strong>phase decoherence field</strong> uses <strong class='color-f'>energy</strong> to <br><strong class='color-d'>damage</strong> unshielded <strong>mobs</strong> that you <strong>overlap</strong>",
maxCount: 1,
count: 0,
allowed() {
return mech.fieldUpgrades[mech.fieldMode].name === "phase decoherence field"
},
requires: "phase decoherence field",
effect() {
b.isModPhaseFieldDamage = true;
},
remove() {
b.isModPhaseFieldDamage = false;
}
},
],
removeMod(index) {
b.mods[index].remove();

View File

@@ -15,7 +15,7 @@ const level = {
if (level.levelsCleared === 0) {
// level.difficultyIncrease(9)
// b.giveGuns("wave beam")
// mech.setField("plasma torch")
// mech.setField("phase decoherence field")
// b.giveMod("wave phase velocity");
// b.giveMod("reflective cavity");

View File

@@ -1609,6 +1609,19 @@ const mech = {
mech.grabPowerUp();
mech.lookForPickUp();
if (mech.energy > 0.006 && b.isModPhaseFieldDamage) { //damage mobs inside the player
let inPlayer = Matter.Query.region(mob, player.bounds)
if (inPlayer.length > 0) {
for (let i = 0; i < inPlayer.length; i++) {
if (inPlayer[i].dropPowerUp && !inPlayer[i].isShielded) {
inPlayer[i].damage(0.2 * b.dmgScale);
mech.energy -= 0.002;
break;
}
}
}
}
} else {
mech.fieldCDcycle = mech.cycle + 120;
}