Added properties antagonists (ex : Sacred remove Unholy on drop).
This commit is contained in:
@@ -136,7 +136,12 @@ export class ItemSheetL5r5e extends ItemSheet {
|
||||
|
||||
// Check item type and subtype
|
||||
let item = await game.l5r5e.HelpersL5r5e.getDragnDropTargetObject(event);
|
||||
if (!item || item.documentName !== "Item" || this.item.type === "property") {
|
||||
if (!item || item.documentName !== "Item") {
|
||||
return;
|
||||
}
|
||||
|
||||
// If we are a property, the child id need to be different to parent
|
||||
if (this.item.type === "property" && this.item.id === item.data._id) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -173,6 +178,14 @@ export class ItemSheetL5r5e extends ItemSheet {
|
||||
|
||||
this.document.data.data.properties.push({ id: item.id, name: item.name });
|
||||
|
||||
// This props remove others ?
|
||||
if (Array.isArray(item.data.data.properties) && item.data.data.properties.length > 0) {
|
||||
const idsToRemove = item.data.data.properties.map((e) => e.id);
|
||||
this.document.data.data.properties = this.document.data.data.properties.filter(
|
||||
(p) => !idsToRemove.includes(p.id)
|
||||
);
|
||||
}
|
||||
|
||||
this.document.update({
|
||||
data: {
|
||||
properties: this.document.data.data.properties,
|
||||
|
||||
@@ -14,11 +14,4 @@ export class PropertySheetL5r5e extends ItemSheetL5r5e {
|
||||
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }],
|
||||
});
|
||||
}
|
||||
// TODO Some properties cancel others :
|
||||
// Concealable and Cumbersome
|
||||
// Ceremonial and Mundane
|
||||
// Damaged and Durable
|
||||
// Resplendent and Subtle
|
||||
// Subtle and Wargear
|
||||
// Sacred and Unholy
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user