Item structure

This commit is contained in:
sladecraven 2021-04-01 22:35:03 +02:00
parent cc46ce867e
commit e205ca186a
6 changed files with 74 additions and 60 deletions

View File

@ -11,7 +11,7 @@ export class VadentisActorSheet extends ActorSheet {
/** @override */ /** @override */
static get defaultOptions() { static get defaultOptions() {
return mergeObject(super.defaultOptions, { return mergeObject(super.defaultOptions, {
classes: ["sos", "sheet", "actor"], classes: ["vadentis", "sheet", "actor"],
template: "systems/foundryvtt-vadentis/templates/actor-sheet.html", template: "systems/foundryvtt-vadentis/templates/actor-sheet.html",
width: 640, width: 640,
height: 720, height: 720,
@ -25,8 +25,9 @@ export class VadentisActorSheet extends ActorSheet {
getData() { getData() {
let data = super.getData(); let data = super.getData();
this.actor.checkDeck(); data.stats = this.actor.stats;
data.combat = this.actor.combat;
data.magie = this.actor.magie;
return data; return data;
} }
@ -128,14 +129,6 @@ export class VadentisActorSheet extends ActorSheet {
} }
/* -------------------------------------------- */
async _onDrop(event) {
let toSuper = await SoSUtility.processItemDropEvent(this, event);
if ( toSuper) {
super._onDrop(event);
}
}
/* -------------------------------------------- */ /* -------------------------------------------- */
/** @override */ /** @override */
setPosition(options = {}) { setPosition(options = {}) {

View File

@ -32,12 +32,12 @@ export class VadentisActor extends Actor {
return actor; return actor;
} }
data.items = []; /*data.items = [];
let compendiumName = "foundryvtt-vadentis.competences"; let compendiumName = "foundryvtt-vadentis.competences";
if ( compendiumName ) { if ( compendiumName ) {
let skills = await SoSUtility.loadCompendium(compendiumName); let skills = await SoSUtility.loadCompendium(compendiumName);
data.items = data.items.concat( skills ); data.items = data.items.concat( skills );
} }*/
return super.create(data, options); return super.create(data, options);
} }

View File

@ -8,9 +8,9 @@
/* -------------------------------------------- */ /* -------------------------------------------- */
// Import Modules // Import Modules
import { VadentisActor } from "./actor.js"; import { VadentisActor } from "./vadentis-actor.js";
import { VadentisItemSheet } from "./item-sheet.js"; import { VadentisItemSheet } from "./vadentis-item-sheet.js";
import { VadentisActorSheet } from "./actor-sheet.js"; import { VadentisActorSheet } from "./vadentis-actor-sheet.js";
import { VadentisUtility } from "./vadentis-utility.js"; import { VadentisUtility } from "./vadentis-utility.js";
import { VadentisCombat } from "./vadentis-combat.js"; import { VadentisCombat } from "./vadentis-combat.js";
@ -48,7 +48,7 @@ Hooks.once("init", async function () {
/* -------------------------------------------- */ /* -------------------------------------------- */
// Register sheet application classes // Register sheet application classes
Actors.unregisterSheet("core", ActorSheet); Actors.unregisterSheet("core", ActorSheet);
Actors.registerSheet("foundryvtt-vadentis", VadentisActorSheet, { types: ["character"], makeDefault: true }); Actors.registerSheet("foundryvtt-vadentis", VadentisActorSheet, { types: ["personnage"], makeDefault: true });
Items.unregisterSheet("core", ItemSheet); Items.unregisterSheet("core", ItemSheet);
Items.registerSheet("foundryvtt-vadentis", VadentisItemSheet, { makeDefault: true }); Items.registerSheet("foundryvtt-vadentis", VadentisItemSheet, { makeDefault: true });

View File

@ -9,11 +9,18 @@ export class VadentisUtility extends Entity {
const templatePaths = [ const templatePaths = [
'systems/foundryvtt-vadentis/templates/actor-sheet.html', 'systems/foundryvtt-vadentis/templates/actor-sheet.html',
'systems/foundryvtt-vadentis/templates/item-sheet.html' 'systems/foundryvtt-vadentis/templates/item-sheet.html',
'systems/foundryvtt-vadentis/templates/score-option-list.html',
'systems/foundryvtt-vadentis/templates/editor-notes-gm.html'
] ]
return loadTemplates(templatePaths); return loadTemplates(templatePaths);
} }
/* -------------------------------------------- */
static registerChatCallbacks( ) {
}
/* -------------------------------------------- */ /* -------------------------------------------- */
static fillRange (start, end) { static fillRange (start, end) {
return Array(end - start + 1).fill().map((item, index) => start + index); return Array(end - start + 1).fill().map((item, index) => start + index);

View File

@ -2,13 +2,13 @@
"name": "foundryvtt-vadentis", "name": "foundryvtt-vadentis",
"title": "Vadentis", "title": "Vadentis",
"description": "Système Vadentis pour FoundryVTT", "description": "Système Vadentis pour FoundryVTT",
"version": "0.0.1", "version": "0.0.6",
"manifestPlusVersion": "1.0.0", "manifestPlusVersion": "1.0.0",
"minimumCoreVersion": "0.7.5", "minimumCoreVersion": "0.7.5",
"compatibleCoreVersion": "0.7.9", "compatibleCoreVersion": "0.7.9",
"templateVersion": 1, "templateVersion": 5,
"author": "Uberwald", "author": "Uberwald",
"esmodules": [ "module/vadentis-main.js" ], "esmodules": [ "modules/vadentis-main.js" ],
"styles": ["styles/simple.css"], "styles": ["styles/simple.css"],
"background" : "", "background" : "",
"media": [ "media": [

View File

@ -1,13 +1,9 @@
{ {
"Actor": { "Actor": {
"types": ["character"], "types": ["personnage"],
"templates": { "templates": {
"common": { "common": {
"stats": { "stats": {
"donnee": {
"label": "Données",
"list": []
},
"experience": { "experience": {
"total": 0, "total": 0,
"disponibe": 0, "disponibe": 0,
@ -27,17 +23,15 @@
"value": 0, "value": 0,
"max": 0, "max": 0,
"label": "Points d'Adrénaline" "label": "Points d'Adrénaline"
}, }
},
"combat": {
"force": { "force": {
"base": 0, "base": 0,
"malus": 0, "malus": 0,
"bonus": 0, "bonus": 0,
"label": "Force" "label": "Force"
}, },
"esquive": {
"value": 0,
"label": "Esquive"
},
"attaque": { "attaque": {
"base": 0, "base": 0,
"malus": 0, "malus": 0,
@ -50,6 +44,14 @@
"bonus": 0, "bonus": 0,
"label": "Défense" "label": "Défense"
}, },
"esquive": {
"base": 0,
"malus": 0,
"bonus": 0,
"label": "Esquive"
}
},
"magie": {
"matriseelementaire": { "matriseelementaire": {
"base": 0, "base": 0,
"malus": 0, "malus": 0,
@ -76,12 +78,36 @@
"age": 0 "age": 0
} }
}, },
"character": { "personnage": {
"templates": [ "background", "common" ] "templates": [ "background", "common" ]
} }
}, },
"Item": { "Item": {
"types": ["competence", "attribut", "technique", "sort", "arme", "tir", "armurebouclier", "equipement" ], "types": ["competence", "attribut", "technique", "sort", "devotion", "armecc", "tir", "armurebouclier", "equipement", "donnee", "eglise" ],
"templates": {
"sortcommun": {
"xp": 0,
"pe": 0,
"target": "",
"difficulty": 0,
"description": "",
"effect": "",
"critical": "",
"notes": "",
"damage": ""
},
"equipcommun": {
"description": "",
"enc": 0,
"cost": 0
}
},
"donnee": {
"description": ""
},
"eglise": {
"description": ""
},
"attribut": { "attribut": {
"effect": "", "effect": "",
"xp": 0, "xp": 0,
@ -95,32 +121,25 @@
"notes": "" "notes": ""
}, },
"sort": { "sort": {
"type": "", "donnee": "",
"datachurch": "", "templates": [ "sortcommun" ]
"xp": "", },
"pe": "", "devotion": {
"target": "", "eglise": "",
"difficulty": "", "templates": [ "sortcommun" ]
"description": "",
"effect": "",
"critical": "",
"notes": "",
"damage": ""
}, },
"competence": { "competence": {
"xp": "", "xp": 0,
"base": "", "base": 0,
"bonus": "", "bonus": 0,
"malus": "", "malus": 0,
"description": "" "description": ""
}, },
"arme": { "armecc": {
"type": "", "type": "",
"damage": "", "damage": "",
"criticaldamage": "", "criticaldamage": "",
"description": "", "templates": [ "equipcommun" ]
"enc": 0,
"cost": 0
}, },
"tir": { "tir": {
"type": "", "type": "",
@ -128,21 +147,16 @@
"criticaldamage": "", "criticaldamage": "",
"munition": "", "munition": "",
"distance": "", "distance": "",
"description": "", "templates": [ "equipcommun" ]
"enc": 0,
"cost": 0
}, },
"armurebouclier": { "armurebouclier": {
"type": "", "type": "",
"bonus": "", "bonus": "",
"malus": "", "malus": "",
"enc": 0, "templates": [ "equipcommun" ]
"cost": 0
}, },
"equipement": { "equipement": {
"description": "", "templates": [ "equipcommun" ]
"enc": 0,
"cost": 0
} }
} }
} }