src/scripts/Status.js
// adds a modifier to a Stat or replaces it
adds a modifier to a Stat or replaces it
adds a modifier to a Stat or replaces it
addModifier(toId, modData) {
        let _stat = this.get(toId);
        let _oldMods = _stat.data.modifier;
        let _x=-1;
        for(let i=0;i<_oldMods.length;i++){
            if(_oldMods[i].id===modData.id) _x=i;
        }
        if(_x>=0) _oldMods.splice(_x,1);
        _oldMods.push(modData);
        window.gm.pushLog(_stat.Calc().msg);
    }
addModifier ( toId , modData ) { let _stat = this . get ( toId ) ; let _oldMods = _stat . data . modifier ; let _x = - 1 ; for ( let i = 0 ; i < _oldMods . length ; i ++ ) { if ( _oldMods [ i ] . id === modData . id ) _x = i ; } if ( _x >= 0 ) _oldMods . splice ( _x , 1 ) ; _oldMods . push ( modData ) ; window . gm . pushLog ( _stat . Calc ( ) . msg ) ; }
adds a modifier to a Stat or replaces it
adds a modifier to a Stat or replaces it