mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-09 14:45:35 +00:00
Add falloff for weapons
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user