|
@@ -808,10 +808,10 @@ class PlayerCharacter implements Character{
|
|
|
//#region Drugs
|
|
|
_drugs = new setup.Drugs();
|
|
|
|
|
|
- get drugsActiveEffects(){return this._drugs.activeEffects}
|
|
|
+ get drugsActiveEffects():{[key: string]:Effect}{return this._drugs.activeEffects}
|
|
|
get drugsActiveEffectIds(){return this._drugs.activeEffectIds}
|
|
|
drugsDeteriorate(minutes){return this._drugs.deteriorate(minutes)}
|
|
|
- drugVolInc(drugId, inc){return this._drugs.volInc(drugId, inc)}
|
|
|
+ drugVolInc(drugId:string, inc:number){return this._drugs.volInc(drugId, inc)}
|
|
|
drugVolSet(drugId,v){return this._drugs.volSet(drugId, v)}
|
|
|
drugVol(drugId){return this._drugs.vol(drugId)}
|
|
|
|
|
@@ -2155,10 +2155,17 @@ class PlayerCharacter implements Character{
|
|
|
return Object.keys(this.#activeEffects());
|
|
|
}
|
|
|
|
|
|
- #activeEffects(fields:string[]=[]):{[key: string]:any}{
|
|
|
- let result = {};
|
|
|
+ #activeEffects(fields:string[]=[]):{[key: string]:Effect}{
|
|
|
+ let result:{[key: string]:Effect} = {};
|
|
|
const time = State.variables.time;
|
|
|
|
|
|
+ for(const [effectid,effect] of Object.entries(this.drugsActiveEffects)){
|
|
|
+ if(fields.length && !Object.keys(effect).includesAny(fields))
|
|
|
+ continue;
|
|
|
+ result[effectid] = effect;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
for(const [effectid,effectData] of Object.entries(this._effects)){
|
|
|
if(effectData.expiration === undefined)
|
|
|
continue;
|
|
@@ -2191,7 +2198,6 @@ class PlayerCharacter implements Character{
|
|
|
result[effectid] = effect;
|
|
|
}
|
|
|
|
|
|
- result = Object.assign({},this.drugsActiveEffects,result);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
@@ -2307,7 +2313,7 @@ class PlayerCharacter implements Character{
|
|
|
* @param {string} effectId
|
|
|
* @returns {boolean}
|
|
|
*/
|
|
|
- effectIsActive(effectId){
|
|
|
+ effectIsActive(effectId:string):boolean{
|
|
|
return (effectId in this.#activeEffects());
|
|
|
}
|
|
|
|