electrostatic induction

tech: electrostatic induction - foam bullets are attracted to nearby mobs

portals on perplex map, now remove blocks that fall in
new community map! coliseum by iNoobBoi

a few more tech can be refunded properly
nonRefundable tech don't show up in the list of tech you have
This commit is contained in:
landgreen
2021-03-13 06:22:05 -08:00
parent 3d04e61a04
commit 862a0ae9d0
10 changed files with 396 additions and 193 deletions

View File

@@ -630,6 +630,23 @@ const powerUps = {
m.fieldCDcycle = m.cycle + 30; //disable field so you can't pick up the ejected tech
}
},
removeRandomTech() {
const have = [] //find which tech you have
for (let i = 0; i < tech.tech.length; i++) {
if (tech.tech[i].count > 0) have.push(i)
}
if (have.length) {
const choose = have[Math.floor(Math.random() * have.length)]
simulation.makeTextLog(`<span class='color-var'>tech</span>.remove("<span class='color-text'>${tech.tech[choose].name}</span>")`)
const totalRemoved = tech.tech[choose].count
tech.tech[choose].count = 0;
tech.tech[choose].remove(); // remove a random tech form the list of tech you have
tech.tech[choose].isLost = true
simulation.updateTechHUD();
return totalRemoved
}
return 0
},
directSpawn(x, y, target, moving = true, mode = null, size = powerUps[target].size()) {
let index = powerUp.length;
target = powerUps[target];