laser now has infinite ammo, but drains field energy

This commit is contained in:
lilgreenland
2019-07-14 18:55:50 -07:00
parent b6f21d76de
commit 7aba4473af
3 changed files with 129 additions and 113 deletions

View File

@@ -72,8 +72,14 @@ const powerUps = {
//ammo given scales as mobs take more hits to kill
const ammo = Math.ceil((target.ammoPack * (0.60 + 0.5 * Math.random())) / b.dmgScale);
target.ammo += ammo;
game.updateGunHUD();
game.makeTextLog("+" + ammo + " ammo: " + target.name, 180);
if (target.ammo === Infinity) {
mech.fieldMeter = 1;
game.makeTextLog("+energy", 180);
} else {
game.updateGunHUD();
game.makeTextLog("+" + ammo + " ammo: " + target.name, 180);
}
}
},
gun: {