Add falloff for weapons

This commit is contained in:
Cmdr McDonald
2017-01-14 09:52:31 +00:00
parent 792eda2572
commit 53137e0ae1
6 changed files with 35 additions and 12 deletions

View File

@@ -286,6 +286,20 @@ export default class Module {
return this._getModifiedValue('range');
}
/**
* Get the falloff for this module, taking in to account modifications
* @return {Number} the falloff of this module
*/
getFalloff() {
if (this.getModValue('fallofffromrange')) {
return this.getRange();
} else {
const falloff = this._getModifiedValue('falloff');
const range = this.getRange();
return (falloff > range ? range : falloff);
}
}
/**
* Get the range (in terms of seconds, for FSDI) for this module, taking in to account modifications
* @return {Number} the range of this module