working on giving custom mods requirements (in progress, buggy)

This commit is contained in:
landgreen
2020-02-16 14:28:56 -08:00
parent be45c4d5d3
commit 32733909ab
7 changed files with 262 additions and 156 deletions

View File

@@ -940,13 +940,14 @@ const mobs = {
if (b.isModLowHealthDmg) dmg *= (3 / (2 + mech.health)) //up to 50% dmg at zero player health
// if (b.isModFarAwayDmg) dmg *= 1 + Math.sqrt(Math.max(1000, Math.min(3500, this.distanceToPlayer())) - 1000) * 0.01 //up to 50% dmg at max range of 3500
if (b.isModEnergyLoss) dmg *= 1.5;
if (b.isModFarAwayDmg) 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 (b.modEnergySiphon && dmg !== Infinity) mech.fieldMeter += Math.min(this.health, dmg) * b.modEnergySiphon
if (b.modHealthDrain && dmg !== Infinity) mech.addHealth(Math.min(this.health, dmg) * b.modHealthDrain)
this.health -= dmg
//this.fill = this.color + this.health + ')';
this.onDamage(dmg); //custom damage effects
if (this.health < b.mobDieAtHealth && this.alive) this.death();
if (this.health < b.modMobDieAtHealth && this.alive) this.death();
}
},
onDamage() {