mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-09 22:55:35 +00:00
Use modifiers when calculating regen rates
This commit is contained in:
@@ -29,7 +29,7 @@ export default class Module {
|
|||||||
/**
|
/**
|
||||||
* Get a value for a given modification
|
* Get a value for a given modification
|
||||||
* @param {Number} name The name of the modification
|
* @param {Number} name The name of the modification
|
||||||
* @return {Number} The value of the modification, as a decimal value from -1 to 1
|
* @return {Number} The value of the modification, as a decimal value where 1 is 100%
|
||||||
*/
|
*/
|
||||||
getModValue(name) {
|
getModValue(name) {
|
||||||
return this.mods && this.mods[name] ? this.mods[name] / 10000 : null;
|
return this.mods && this.mods[name] ? this.mods[name] / 10000 : null;
|
||||||
@@ -38,7 +38,7 @@ export default class Module {
|
|||||||
/**
|
/**
|
||||||
* Set a value for a given modification ID
|
* Set a value for a given modification ID
|
||||||
* @param {Number} name The name of the modification
|
* @param {Number} name The name of the modification
|
||||||
* @param {Number} value The value of the modification, as a decimal value from -1 to 1
|
* @param {Number} value The value of the modification, as a decimal value where 1 is 100%
|
||||||
*/
|
*/
|
||||||
setModValue(name, value) {
|
setModValue(name, value) {
|
||||||
if (value == null || value == 0) {
|
if (value == null || value == 0) {
|
||||||
|
|||||||
@@ -212,8 +212,10 @@ export default class Ship {
|
|||||||
*/
|
*/
|
||||||
calcShieldRecovery() {
|
calcShieldRecovery() {
|
||||||
if (this.shieldStrength && this.sgSlot) {
|
if (this.shieldStrength && this.sgSlot) {
|
||||||
|
let brokenRegenRate = 1 + this.sgSlot.m.getModValue('brokenregen');
|
||||||
|
console.log('Broken regen rate is ' + brokenRegenRate);
|
||||||
// 50% of shield strength / recovery recharge rate + 15 second delay before recharge starts
|
// 50% of shield strength / recovery recharge rate + 15 second delay before recharge starts
|
||||||
return ((this.shieldStrength / 2) / this.sgSlot.m.recover) + 15;
|
return ((this.shieldStrength / 2) / (this.sgSlot.m.recover * brokenRegenRate)) + 15;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -226,8 +228,9 @@ export default class Ship {
|
|||||||
*/
|
*/
|
||||||
calcShieldRecharge() {
|
calcShieldRecharge() {
|
||||||
if (this.shieldStrength && this.sgSlot) {
|
if (this.shieldStrength && this.sgSlot) {
|
||||||
|
let regenRate = 1 + this.sgSlot.m.getModValue('regen');
|
||||||
// 50% -> 100% recharge time, Bi-Weave shields charge at 1.8 MJ/s
|
// 50% -> 100% recharge time, Bi-Weave shields charge at 1.8 MJ/s
|
||||||
return (this.shieldStrength / 2) / (this.sgSlot.m.grp == 'bsg' ? 1.8 : 1);
|
return (this.shieldStrength / 2) / ((this.sgSlot.m.grp == 'bsg' ? 1.8 : 1) * regenRate);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user