lore chapters: 3,4

2 more lore chapters (5 total now)
entering testing mode makes a sound now

reduced the requirements and frequency for many tech so that they may show up in "less optimal" situations
  I hope this will increase build variety and also give more value to making good tech choices
countless bug fixes and wording fixes

mobs have a new trait mob[i].damageReduction
This commit is contained in:
landgreen
2021-07-21 07:01:46 -07:00
parent d50cd540fa
commit 34d295cf48
11 changed files with 503 additions and 247 deletions

View File

@@ -226,6 +226,7 @@ const mobs = {
alive: true,
index: i,
health: tech.mobSpawnWithHealth,
damageReduction: 1,
showHealthBar: true,
accelMag: 0.001 * simulation.accelScale,
cd: 0, //game cycle when cooldown will be over
@@ -1015,12 +1016,12 @@ const mobs = {
dmg *= tech.damageFromTech()
//mobs specific damage changes
if (tech.isFarAwayDmg) dmg *= 1 + Math.sqrt(Math.max(500, Math.min(3000, this.distanceToPlayer())) - 500) * 0.0067 //up to 50% dmg at max range of 3500
if (this.shield) dmg *= 0.075
if (this.isBoss) dmg *= 0.25
// if (this.shield) dmg *= 0.075
// if (this.isBoss) dmg *= 0.25
dmg *= this.damageReduction
//energy and heal drain should be calculated after damage boosts
if (tech.energySiphon && dmg !== Infinity && this.isDropPowerUp && m.immuneCycle < m.cycle) m.energy += Math.min(this.health, dmg) * tech.energySiphon
if (tech.healthDrain && dmg !== Infinity && this.isDropPowerUp) {
m.addHealth(Math.min(this.health, dmg) * tech.healthDrain)
if (m.health > m.maxHealth) m.health = m.maxHealth