Fiche de creature

This commit is contained in:
2023-12-02 09:03:58 +01:00
parent 68689add33
commit 5c889a5153
64 changed files with 519 additions and 201 deletions

View File

@@ -54,9 +54,12 @@ export class WastelandActorSheet extends ActorSheet {
metier: duplicate(this.actor.getMetier() || {}),
combat: this.actor.getCombatValues(),
config: duplicate(game.system.wasteland.config),
capacites: duplicate(this.actor.getCapacites()),
equipements: duplicate(this.actor.getEquipments()),
monnaies: duplicate(this.actor.getMonnaies()),
description: await TextEditor.enrichHTML(this.object.system.biodata.description, {async: true}),
comportement: await TextEditor.enrichHTML(this.object.system.biodata.comportement, {async: true}),
habitat: await TextEditor.enrichHTML(this.object.system.biodata.habitat, {async: true}),
options: this.options,
owner: this.document.isOwner,
editScore: this.options.editScore,

View File

@@ -37,11 +37,12 @@ export class WastelandActor extends Actor {
return actor;
}
const skills = await WastelandUtility.loadCompendium("fvtt-wasteland.skills")
if (data.type == 'personnage') {
const skills = await WastelandUtility.loadCompendium("fvtt-wasteland.skills")
data.items = skills.map(i => i.toObject())
}
if (data.type == 'pnj') {
if (data.type == 'creature') {
data.items = skills.filter(i=>i.name.toLowerCase().includes("mêlée")).map(i => i.toObject())
}
return super.create(data, options);
@@ -119,6 +120,9 @@ export class WastelandActor extends Actor {
getArtifex() {
return this.getItemSorted(["artifex"])
}
getCapacites() {
return this.getItemSorted(["capacite"])
}
getPouvoirs() {
return this.getItemSorted(["pouvoir"])
}

View File

@@ -0,0 +1,26 @@
/**
* Extend the basic ActorSheet with some very simple modifications
* @extends {ActorSheet}
*/
import { WastelandUtility } from "./wasteland-utility.js";
import { WastelandActorSheet } from "./wasteland-actor-sheet.js";
/* -------------------------------------------- */
export class WastelandCreatureSheet extends WastelandActorSheet {
/** @override */
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
classes: ["fvtt-wasteland", "sheet", "creature"],
template: "systems/fvtt-wasteland/templates/creature-sheet.html",
width: 640,
height: 720,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "stats" }],
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
editScore: false
});
}
}

View File

@@ -11,7 +11,7 @@
import { WastelandActor } from "./wasteland-actor.js";
import { WastelandItemSheet } from "./wasteland-item-sheet.js";
import { WastelandActorSheet } from "./wasteland-actor-sheet.js";
//import { WastelandNPCSheet } from "./wasteland-npc-sheet.js";
import { WastelandCreatureSheet } from "./wasteland-creature-sheet.js";
import { WastelandUtility } from "./wasteland-utility.js";
import { WastelandCombat } from "./wasteland-combat.js";
import { WastelandItem } from "./wasteland-item.js";
@@ -54,7 +54,7 @@ Hooks.once("init", async function () {
// Register sheet application classes
Actors.unregisterSheet("core", ActorSheet);
Actors.registerSheet("fvtt-wasteland", WastelandActorSheet, { types: ["personnage"], makeDefault: true })
//Actors.registerSheet("fvtt-wasteland", WastelandNPCSheet, { types: ["npc"], makeDefault: false });
Actors.registerSheet("fvtt-wasteland", WastelandCreatureSheet, { types: ["creature"], makeDefault: false });
Items.unregisterSheet("core", ItemSheet);
Items.registerSheet("fvtt-wasteland", WastelandItemSheet, { makeDefault: true })