shape change fix powers and skill issue
This commit is contained in:
parent
5c9556471e
commit
4ffed673db
@ -802,8 +802,11 @@ export class ActorFolderEffect extends PowerEffect {
|
||||
adds[documentType] = [];
|
||||
updates[documentType] = [];
|
||||
for (const newDocKey in newDocs[documentType]) {
|
||||
const newDoc = newDocs[documentType][newDocKey];
|
||||
const newDoc = newDocs[documentType][newDocKey].toObject();
|
||||
const oldDoc = collection.find((doc) => this.#documentFinder(documentType, doc, newDoc));
|
||||
if (newDoc.type === 'power' && newDoc?.system?.choiceSets?.length > 0) {
|
||||
newDoc.system.choiceSets = [];
|
||||
}
|
||||
if (oldDoc) {
|
||||
const _id = oldDoc.id;
|
||||
updates[documentType].push({ ...newDoc, _id });
|
||||
|
||||
@ -119,12 +119,9 @@ export class ShapeChangeEffect extends ActorFolderEffect {
|
||||
for (const item of this.target.actor.items.filter(
|
||||
(i) =>
|
||||
(i.type === 'skill' && ['smarts', 'spirit'].includes(i.system.attribute)) ||
|
||||
['edge', 'hindrance', 'action'].includes(i.type),
|
||||
['power', 'edge', 'hindrance', 'action'].includes(i.type),
|
||||
)) {
|
||||
const doc = deepClone(await this.target.actor.getEmbeddedDocument('Item', item.id));
|
||||
if (doc.type === 'power' && doc?.system?.choiceSets?.length > 0 && !doc.system.choiceSets[0].choice) {
|
||||
doc.system.choiceSets[0].choice = 1;
|
||||
}
|
||||
const doc = await this.target.actor.getEmbeddedDocument('Item', item.id);
|
||||
this.data.embeddedUpdates.Item[item.name] = doc;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user