modules/ageSystemItem.js
// Returns owned Focus Item entity used to activate this item - false otherwise
Returns owned Focus Item entity used to activate this item - false otherwise
Returns owned Focus Item entity used to activate this item - false otherwise
_ownerFocusEntity() {
        const itemData = this.data;
        const data = itemData.data;
        const owner = this.actor;
        if (data.useFocus === null || data.useFocus === "" || this.isOwned === false || owner === null) {
            return null;
        };
        const ownerFoci = owner.data.items.filter(a => a.type === "focus");
        const expectedFocus = data.useFocus.toLowerCase();
        const validFocus = ownerFoci.filter(c => c.name.toLowerCase() === expectedFocus);
        if (validFocus.length < 1) {
            return data.useFocus;
        } else {
            const id = validFocus[0]._id;
            return this.actor.getOwnedItem(id);
        };    
    }
_ownerFocusEntity ( ) { const itemData = this . data ; const data = itemData . data ; const owner = this . actor ; if ( data . useFocus === null || data . useFocus === "" || this . isOwned === false || owner === null ) { return null ; } ; const ownerFoci = owner . data . items . filter ( a => a . type === "focus" ) ; const expectedFocus = data . useFocus . toLowerCase ( ) ; const validFocus = ownerFoci . filter ( c => c . name . toLowerCase ( ) === expectedFocus ) ; if ( validFocus . length < 1 ) { return data . useFocus ; } else { const id = validFocus [ 0 ] . _id ; return this . actor . getOwnedItem ( id ) ; } ; }
Returns owned Focus Item entity used to activate this item - false otherwise
Returns owned Focus Item entity used to activate this item - false otherwise