Merge branch 'Actor-get-items-from-world' into character-generator

This commit is contained in:
Melon-PieldeSapo
2024-12-16 16:12:04 +01:00
4 changed files with 6 additions and 7 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
import {fromIdUuid} from "../mosh.js";
import { fromIdUuid } from "../mosh";
/**
* Extend the base Actor entity by defining a custom roll data structure which is ideal for the Simple system.
@@ -3065,7 +3065,7 @@ export class MothershipActor extends Actor {
let flavorText = ``;
let chatId = (game.release.generation >= 12 ? foundry.utils.randomID(): randomID())
//get item data
let itemData = await fromIdUuid(itemId,{type: "Item"});
let itemData = await fromIdUuid(itemId,{type:"Item"});
//add or increase the count of the item, depending on type, if the actor has it
if (this.items.getName(itemData.name)) {
//if this is an item, increase the count
+1 -1
View File
@@ -1,4 +1,4 @@
import {fromIdUuid} from "../mosh.js";
import { fromIdUuid } from "../mosh";
/**
* Extend the basic ActorSheet with some very simple modifications
+2 -2
View File
@@ -986,9 +986,9 @@ export async function fromIdUuid(id_uuid, options={}){
//it is a world item.
switch (type) {
case "RollTable":
return await game.tables.filter(i=> i.id == id_uuid)[0];;
return game.tables.filter(i=> i.id == id_uuid)[0];
case "Item":
return await game.items.filter(i=> i.id == id_uuid)[0];;
return game.items.filter(i=> i.id == id_uuid)[0];
default:
//type is not defined, and we could not find it in a compendium,
//now we search all world elements.
+1 -2
View File
@@ -1,5 +1,4 @@
import {fromIdUuid} from "../mosh.js";
import { fromIdUuid } from "../mosh";
export class DLShipMegaDamage extends FormApplication {
static get defaultOptions() {
const options = super.defaultOptions;