missile rework

fixed some math on laser tech: diffraction grating and slow light propagation
  they were giving too much damage

flechettes are slightly improved in: ammo, damage, fire rate

tech - MIRV can now stack up to 9 bonus missiles
removed tech - recursive missiles
tech: cruise missile - 50% larger size, but travels 50% slower
tech: missileBot - requires gun: missiles
This commit is contained in:
landgreen
2020-12-29 18:56:16 -08:00
parent 0d70e3918d
commit 9f019b9988
10 changed files with 334 additions and 217 deletions

View File

@@ -53,7 +53,7 @@ const powerUps = {
powerUps.tech.banishLog.push(powerUps.tech.choiceLog[powerUps.tech.choiceLog.length - 1 - i])
}
}
simulation.makeTextLog(`${Math.max(0,powerUps.tech.lastTotalChoices - powerUps.tech.banishLog.length)} estimated <strong class='color-m'>tech</strong> choices remaining`)
simulation.makeTextLog(`powerUps.tech.length: ${Math.max(0,powerUps.tech.lastTotalChoices - powerUps.tech.banishLog.length)}`)
}
}
if (tech.manyWorlds && powerUps.reroll.rerolls === 0) {
@@ -127,7 +127,8 @@ const powerUps = {
powerUps.tech.banishLog.push(powerUps.tech.choiceLog[powerUps.tech.choiceLog.length - 1 - i])
}
}
simulation.makeTextLog(`${Math.max(0,powerUps.tech.lastTotalChoices - powerUps.tech.banishLog.length)} estimated <strong class='color-m'>tech</strong> choices remaining`)
// simulation.makeTextLog(`${Math.max(0,powerUps.tech.lastTotalChoices - powerUps.tech.banishLog.length)} estimated <strong class='color-m'>tech</strong> choices remaining`)
simulation.makeTextLog(`powerUps.tech.length: ${Math.max(0,powerUps.tech.lastTotalChoices - powerUps.tech.banishLog.length)}`)
}
powerUps[type].effect();
},
@@ -168,26 +169,23 @@ const powerUps = {
return 17;
},
effect() {
//give ammo to all guns in inventory
if (tech.isAmmoForGun && b.inventory.length > 0) {
if (tech.isAmmoForGun && b.inventory.length > 0 && b.activeGun) {
const target = b.guns[b.activeGun]
const ammoAdded = Math.ceil(Math.random() * target.ammoPack) + Math.ceil(Math.random() * target.ammoPack)
target.ammo += ammoAdded
// simulation.makeTextLog(`<div class='circle gun'></div> &nbsp; ${ammoAdded} ammo added`, 300)
simulation.makeTextLog(`${target.name}.<span class='color-gun'>ammo</span> <span class='color-symbol'>+=</span> ${ammoAdded}
<br>${target.ammo}`)
} else {
let text = '';
if (target.ammo !== Infinity) {
const ammoAdded = Math.ceil(Math.random() * target.ammoPack) + Math.ceil(Math.random() * target.ammoPack)
target.ammo += ammoAdded
simulation.makeTextLog(`${target.name}.<span class='color-gun'>ammo</span> <span class='color-symbol'>+=</span> ${ammoAdded}`)
}
} else { //give ammo to all guns in inventory
for (let i = 0, len = b.inventory.length; i < len; i++) {
const target = b.guns[b.inventory[i]]
if (target.ammo !== Infinity) {
const ammoAdded = Math.ceil(Math.random() * target.ammoPack)
target.ammo += ammoAdded
if (i !== 0) text += "<br>"
text += `${target.name}.<span class='color-gun'>ammo</span> <span class='color-symbol'>+=</span> ${ammoAdded}`
simulation.makeTextLog(`${target.name}.<span class='color-gun'>ammo</span> <span class='color-symbol'>+=</span> ${ammoAdded}`)
}
}
simulation.makeTextLog(text)
}
simulation.updateGunHUD();
}
@@ -375,7 +373,8 @@ const powerUps = {
for (let i = 0, len = tech.tech.length; i < len; i++) {
if (tech.tech[i].name === "erase") powerUps.ejectTech(i)
}
simulation.makeTextLog(`No <strong class='color-m'>tech</strong> left<br>erased <strong class='color-m'>tech</strong> have been recovered`)
// simulation.makeTextLog(`No <strong class='color-m'>tech</strong> left<br>erased <strong class='color-m'>tech</strong> have been recovered`)
simulation.makeTextLog(`powerUps.tech.length: ${Math.max(0,powerUps.tech.lastTotalChoices - powerUps.tech.banishLog.length)}`)
powerUps.spawn(mech.pos.x, mech.pos.y, "tech");
powerUps.endDraft("tech");
} else {