bug fixes
This commit is contained in:
@@ -23,7 +23,7 @@ const b = {
|
|||||||
} else {
|
} else {
|
||||||
if (mod.isAmmoFromHealth) {
|
if (mod.isAmmoFromHealth) {
|
||||||
if (mech.health > 2 * mod.isAmmoFromHealth * mech.maxHealth) {
|
if (mech.health > 2 * mod.isAmmoFromHealth * mech.maxHealth) {
|
||||||
mech.damage(mod.isAmmoFromHealth * mech.maxHealth);
|
mech.damage(mod.isAmmoFromHealth * mech.maxHealth / mech.harmReduction());
|
||||||
powerUps.spawn(mech.pos.x, mech.pos.y, "ammo");
|
powerUps.spawn(mech.pos.x, mech.pos.y, "ammo");
|
||||||
if (Math.random() < mod.bayesian) powerUps.spawn(mech.pos.x, mech.pos.y, "ammo");
|
if (Math.random() < mod.bayesian) powerUps.spawn(mech.pos.x, mech.pos.y, "ammo");
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -250,7 +250,7 @@ const build = {
|
|||||||
for (let i = 0, len = mod.mods.length; i < len; i++) {
|
for (let i = 0, len = mod.mods.length; i < len; i++) {
|
||||||
const modID = document.getElementById("mod-" + i)
|
const modID = document.getElementById("mod-" + i)
|
||||||
|
|
||||||
if (mod.mods[i].allowed()) {
|
if (mod.mods[i].allowed() || isAllowed) {
|
||||||
if (mod.mods[i].count > 1) {
|
if (mod.mods[i].count > 1) {
|
||||||
modID.innerHTML = `<div class="grid-title"><div class="circle-grid mod"></div> ${mod.mods[i].name} (${mod.mods[i].count}x)</div>${mod.mods[i].description}</div>`
|
modID.innerHTML = `<div class="grid-title"><div class="circle-grid mod"></div> ${mod.mods[i].name} (${mod.mods[i].count}x)</div>${mod.mods[i].description}</div>`
|
||||||
} else {
|
} else {
|
||||||
@@ -267,7 +267,7 @@ const build = {
|
|||||||
modID.classList.add("build-grid-disabled");
|
modID.classList.add("build-grid-disabled");
|
||||||
modID.onclick = null
|
modID.onclick = null
|
||||||
}
|
}
|
||||||
if (mod.mods[i].count > 0 && !isAllowed) {
|
if (mod.mods[i].count > 0) {
|
||||||
mod.removeMod(i)
|
mod.removeMod(i)
|
||||||
}
|
}
|
||||||
if (modID.classList.contains("build-mod-selected")) {
|
if (modID.classList.contains("build-mod-selected")) {
|
||||||
|
|||||||
Reference in New Issue
Block a user