Arme sheet ready
This commit is contained in:
		| @@ -3,7 +3,7 @@ | |||||||
| import { TeDeumUtility } from "../common/tedeum-utility.js"; | import { TeDeumUtility } from "../common/tedeum-utility.js"; | ||||||
|  |  | ||||||
| /* -------------------------------------------- */ | /* -------------------------------------------- */ | ||||||
| export class EcrymeCommands { | export class TeDeumCommands { | ||||||
|  |  | ||||||
|   static init() { |   static init() { | ||||||
|     if (!game.system.tedeum.commands) { |     if (!game.system.tedeum.commands) { | ||||||
|   | |||||||
| @@ -1,25 +1,36 @@ | |||||||
| export const SYSTEM_ID = "fvtt-te-deum"; | export const SYSTEM_ID = "fvtt-te-deum"; | ||||||
|  |  | ||||||
|  | export const __BONUS_DEGATS = [{}, { label: "1d4", value: -2 }, { label: "1d6", value: -1 }, { label: "1d8", value: 0 }, | ||||||
|  | { label: "1d10", value: 1 }, { label: "1d12", value: 2 }, { label: "1d20", value: 3 }] | ||||||
|  | export const __MAX_ARMURES_LOURDES = [{}, { value: 1 }, { value: 3 }, { value: 5 }, | ||||||
|  | { value: 7 }, { value: 9 }, { value: 11 }] | ||||||
|  | export const __EFFORT = [{}, { value: 1 }, { value: 2 }, { value: 3 }, | ||||||
|  |   { value: 4 }, { value: 5 }, { value: 6 }] | ||||||
|  | export const __ACTIONS_PAR_TOUR = [{}, { value: 1 }, { value: 2 }, { value: 2 }, | ||||||
|  |     { value: 3 }, { value: 3 }, { value: 4 }] | ||||||
|  | export const __COUT_XP = [{}, { value: 10 }, { value: 10 }, { value: 10 }, | ||||||
|  |       { value: 10 }, { value: 30 }, { value: 50 }] | ||||||
|  |      | ||||||
| export const LOCALISATION = { | export const LOCALISATION = { | ||||||
|   "pieddroit":{ label: "Pied Droit", value: 1, id :"pieddroit", nbArmure: 1 }, |   "pieddroit": { label: "Pied Droit", value: 1, id: "pieddroit", nbArmure: 1 }, | ||||||
|   "jambedroite": { label: "Jambe Droite", value: 1, id :"jambedroite", nbArmure: 1 }, |   "jambedroite": { label: "Jambe Droite", value: 1, id: "jambedroite", nbArmure: 1 }, | ||||||
|   "jambegauche": { label: "Jambe Gauche", value: 1, id :"jambegauche", nbArmure: 1 }, |   "jambegauche": { label: "Jambe Gauche", value: 1, id: "jambegauche", nbArmure: 1 }, | ||||||
|   "piedgauche":{ label: "Pied Gauche", value: 1, id :"piedgauche", nbArmure: 1 }, |   "piedgauche": { label: "Pied Gauche", value: 1, id: "piedgauche", nbArmure: 1 }, | ||||||
|   "piedgauche":{ label: "Pied Gauche", value: 1, id :"piedgauche", nbArmure: 1 }, |   "piedgauche": { label: "Pied Gauche", value: 1, id: "piedgauche", nbArmure: 1 }, | ||||||
|   "maindroite":{ label: "Main Droite", value: 1, id :"maindroite", nbArmure: 1 }, |   "maindroite": { label: "Main Droite", value: 1, id: "maindroite", nbArmure: 1 }, | ||||||
|   "maingauche":{ label: "Main Gauche", value: 1, id :"maingauche", nbArmure: 1 }, |   "maingauche": { label: "Main Gauche", value: 1, id: "maingauche", nbArmure: 1 }, | ||||||
|   "brasdroit":{ label: "Bras Droit", value: 1, id :"brasdroit", nbArmure: 2 }, |   "brasdroit": { label: "Bras Droit", value: 1, id: "brasdroit", nbArmure: 2 }, | ||||||
|   "brasgauche":{ label: "Bras Gauche", value: 1, id :"brasgauche", nbArmure: 2 }, |   "brasgauche": { label: "Bras Gauche", value: 1, id: "brasgauche", nbArmure: 2 }, | ||||||
|   "corps":{ label: "Corps", value: 1, id :"corps", nbArmure: 2 }, |   "corps": { label: "Corps", value: 1, id: "corps", nbArmure: 2 }, | ||||||
|   "tete":{ label: "Tête", value: 1, id :"tete", nbArmure: 2 }, |   "tete": { label: "Tête", value: 1, id: "tete", nbArmure: 2 }, | ||||||
| } | } | ||||||
|  |  | ||||||
| export const ARME_SPECIFICITE = { | export const ARME_SPECIFICITE = { | ||||||
|   "encombrante": { label: "Encombrante", id :"encombrante" }, |   "encombrante": { label: "Encombrante", id: "encombrante" }, | ||||||
|   "maintiendistance": { label: "Maintien à distance", id :"maintiendistance" }, |   "maintiendistance": { label: "Maintien à distance", id: "maintiendistance" }, | ||||||
|   "treslongue": { label: "Très longue", id :"treslongue" }, |   "treslongue": { label: "Très longue", id: "treslongue" }, | ||||||
|   "coupassomant": { label: "Coup assomant", id :"coupassomant" }, |   "coupassomant": { label: "Coup assomant", id: "coupassomant" }, | ||||||
|   "peutlancer": { label: "Peut être lancée", id :"peutlancer" }, |   "peutlancer": { label: "Peut être lancée", id: "peutlancer" }, | ||||||
| } | } | ||||||
|  |  | ||||||
| export const TEDEUM_CONFIG = { | export const TEDEUM_CONFIG = { | ||||||
| @@ -42,9 +53,18 @@ export const TEDEUM_CONFIG = { | |||||||
|     sensibilite: { id: "sensibilite", value: 1, label: "Sensibilité" }, |     sensibilite: { id: "sensibilite", value: 1, label: "Sensibilité" }, | ||||||
|     entregent: { id: "entregent", value: 1, label: "Entregent" }, |     entregent: { id: "entregent", value: 1, label: "Entregent" }, | ||||||
|     complexion: { id: "complexion", value: 1, label: "Complexion" }, |     complexion: { id: "complexion", value: 1, label: "Complexion" }, | ||||||
|     puissance: { id:"puissance", value: 1, label: "Puissance" }, |     puissance: { id: "puissance", value: 1, label: "Puissance" }, | ||||||
|     adresse: { id: "adresse", value: 1, label: "Adresse" }, |     adresse: { id: "adresse", value: 1, label: "Adresse" }, | ||||||
|   }, |   }, | ||||||
|  |   providence: [ | ||||||
|  |     {labelM: "Brebis égarée", labelF: "Brebis égarée",value: 0, diceValue: "0"}, | ||||||
|  |     {labelM: "Pauvre pêcheur", labelF: "Pauvre pêcheresse",value: 1, diceValue: "d4"}, | ||||||
|  |     {labelM: "Fils prodigue", labelF: "Fille prodigue",value: 2, diceValue: "d6"}, | ||||||
|  |     {labelM: "Bon samaritain", labelF: "Bon samaritain",value: 3, diceValue: "d8"}, | ||||||
|  |     {labelM: "Animé par la grâce", labelF: "Animée par la grâce",value: 4, diceValue: "d10"}, | ||||||
|  |     {labelM: "Oint du Seigneur", labelF: "Ointe du Seigneur",value: 5, diceValue: "d12"}, | ||||||
|  |     {labelM: "Dans la main de Dieu", labelF: "Dans la main de Dieu",value: 6, diceValue: "d20"}, | ||||||
|  |   ], | ||||||
|   localisation: { |   localisation: { | ||||||
|     1: LOCALISATION.pieddroit, |     1: LOCALISATION.pieddroit, | ||||||
|     2: LOCALISATION.piedgauche, |     2: LOCALISATION.piedgauche, | ||||||
| @@ -66,14 +86,23 @@ export const TEDEUM_CONFIG = { | |||||||
|     18: LOCALISATION.tete, |     18: LOCALISATION.tete, | ||||||
|     19: LOCALISATION.tete, |     19: LOCALISATION.tete, | ||||||
|     20: LOCALISATION.tete |     20: LOCALISATION.tete | ||||||
|  |   }, | ||||||
|  |   armeTypes: { | ||||||
|  |     "melee": { label: "Mêlée", value: "melee" }, | ||||||
|  |     "tir": { label: "Tir", value: "tir" } | ||||||
|   }, |   }, | ||||||
|     difficulte: { |     difficulte: { | ||||||
|     routine: {label: "Routine", value: 3}, |     routine: { label: "Routine", value: 3 }, | ||||||
|     facile: {label: "Facile", value: 5}, |     facile: { label: "Facile", value: 5 }, | ||||||
|     pardefaut: {label: "Par Défaut", value: 7}, |     pardefaut: { label: "Par Défaut", value: 7 }, | ||||||
|     malaise: {label: "Malaisé", value: 9}, |     malaise: { label: "Malaisé", value: 9 }, | ||||||
|     difficile: {label: "difficile", value:11}, |     difficile: { label: "difficile", value: 11 }, | ||||||
|     perilleux: {label: "Perilleux", value:13}, |     perilleux: { label: "Perilleux", value: 13 }, | ||||||
|     desespere: {label: "Désespéré", value:15} |     desespere: { label: "Désespéré", value: 15 } | ||||||
|  |   }, | ||||||
|  |   monnaie: { | ||||||
|  |     denier: { label: "Deniers", value: 1 }, | ||||||
|  |     sol: { label: "Sols", value: 10 }, | ||||||
|  |     livre: { label: "Livres", value: 100 } | ||||||
|   } |   } | ||||||
| } | } | ||||||
| @@ -6,7 +6,7 @@ export class TeDeumUtility { | |||||||
|   /* -------------------------------------------- */ |   /* -------------------------------------------- */ | ||||||
|   static async init() { |   static async init() { | ||||||
|     Hooks.on('renderChatLog', (log, html, data) => TeDeumUtility.chatListeners(html)); |     Hooks.on('renderChatLog', (log, html, data) => TeDeumUtility.chatListeners(html)); | ||||||
|     Hooks.on("getChatLogEntryContext", (html, options) => TeDeumUtility.chatMenuManager(html, options)); |     //Hooks.on("getChatLogEntryContext", (html, options) => TeDeumUtility.chatMenuManager(html, options)); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   /* -------------------------------------------- */ |   /* -------------------------------------------- */ | ||||||
| @@ -117,6 +117,7 @@ export class TeDeumUtility { | |||||||
|   /* -------------------------------------------- */ |   /* -------------------------------------------- */ | ||||||
|   static async preloadHandlebarsTemplates() { |   static async preloadHandlebarsTemplates() { | ||||||
|      |      | ||||||
|  |     console.log("PRELOAD >>>>>") | ||||||
|     const templatePaths = [ |     const templatePaths = [ | ||||||
|       'systems/fvtt-te-deum/templates/actors/editor-notes-gm.hbs', |       'systems/fvtt-te-deum/templates/actors/editor-notes-gm.hbs', | ||||||
|       'systems/fvtt-te-deum/templates/items/partial-item-nav.hbs', |       'systems/fvtt-te-deum/templates/items/partial-item-nav.hbs', | ||||||
|   | |||||||
| @@ -1,11 +1,13 @@ | |||||||
| export default class TeDeumArmeSchema extends foundry.abstract.TypeDataModel { | export  class TeDeumArmeSchema extends foundry.abstract.TypeDataModel { | ||||||
|   static defineSchema() { |   static defineSchema() { | ||||||
|     const fields = foundry.data.fields; |     const fields = foundry.data.fields; | ||||||
|     const requiredInteger = { required: true, nullable: false, integer: true }; |     const requiredInteger = { required: true, nullable: false, integer: true }; | ||||||
|     const schema = {}; |     const schema = {}; | ||||||
|  |  | ||||||
|  |     schema.typeArme = new fields.StringField({required: true, choices: ["melee", "tir"], initial: "melee"}); | ||||||
|  |  | ||||||
|     schema.specificites = new fields.SchemaField( |     schema.specificites = new fields.SchemaField( | ||||||
|       Object.values((ARME_SPECIFICITE)).reduce((obj, spec) => { |       Object.values((game.system.tedeum.ARME_SPECIFICITE)).reduce((obj, spec) => { | ||||||
|         obj[spec.id] = new fields.SchemaField({ |         obj[spec.id] = new fields.SchemaField({ | ||||||
|           hasSpec: new fields.BooleanField({initial: false}), |           hasSpec: new fields.BooleanField({initial: false}), | ||||||
|         }); |         }); | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| export default class TeDeumArmureSchema extends foundry.abstract.TypeDataModel { | export class TeDeumArmureSchema extends foundry.abstract.TypeDataModel { | ||||||
|   static defineSchema() { |   static defineSchema() { | ||||||
|     const fields = foundry.data.fields; |     const fields = foundry.data.fields; | ||||||
|     const requiredInteger = { required: true, nullable: false, integer: true }; |     const requiredInteger = { required: true, nullable: false, integer: true }; | ||||||
| @@ -6,7 +6,7 @@ export default class TeDeumArmureSchema extends foundry.abstract.TypeDataModel { | |||||||
|  |  | ||||||
|     schema.localisation = new fields.SchemaField( |     schema.localisation = new fields.SchemaField( | ||||||
|       Object.values(LOCALISATION).reduce((obj, loc) => { |       Object.values(LOCALISATION).reduce((obj, loc) => { | ||||||
|         obj[loc.id] =new fields.SchemaField({ |         obj[loc.id] = new fields.SchemaField({ | ||||||
|           protege: new fields.BooleanField({initial: false}),          |           protege: new fields.BooleanField({initial: false}),          | ||||||
|         }); |         }); | ||||||
|         return obj; |         return obj; | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| export default class TeDeumCompetenceSchema extends foundry.abstract.TypeDataModel { | export class TeDeumCompetenceSchema extends foundry.abstract.TypeDataModel { | ||||||
|   static defineSchema() { |   static defineSchema() { | ||||||
|     const fields = foundry.data.fields; |     const fields = foundry.data.fields; | ||||||
|     const requiredInteger = { required: true, nullable: false, integer: true }; |     const requiredInteger = { required: true, nullable: false, integer: true }; | ||||||
|   | |||||||
							
								
								
									
										12
									
								
								modules/data/tedeum-schema-debouche.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								modules/data/tedeum-schema-debouche.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | |||||||
|  | export class TeDeumDeboucheSchema extends foundry.abstract.TypeDataModel { | ||||||
|  |   static defineSchema() { | ||||||
|  |     const fields = foundry.data.fields; | ||||||
|  |     const requiredInteger = { required: true, nullable: false, integer: true }; | ||||||
|  |     const schema = {}; | ||||||
|  |  | ||||||
|  |     schema.cagnotteMultiplier = new fields.NumberField({ ...requiredInteger, initial: 1, min: 1 }); | ||||||
|  |     schema.description = new fields.HTMLField({ required: true, blank: true }); | ||||||
|  |  | ||||||
|  |     return schema; | ||||||
|  |   } | ||||||
|  | } | ||||||
							
								
								
									
										11
									
								
								modules/data/tedeum-schema-education.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								modules/data/tedeum-schema-education.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | |||||||
|  | export class TeDeumEducationSchema extends foundry.abstract.TypeDataModel { | ||||||
|  |   static defineSchema() { | ||||||
|  |     const fields = foundry.data.fields; | ||||||
|  |     const requiredInteger = { required: true, nullable: false, integer: true }; | ||||||
|  |     const schema = {}; | ||||||
|  |  | ||||||
|  |     schema.description = new fields.HTMLField({ required: true, blank: true }); | ||||||
|  |  | ||||||
|  |     return schema; | ||||||
|  |   } | ||||||
|  | } | ||||||
| @@ -1,4 +1,4 @@ | |||||||
| export default class TeDeumArmureSchema extends foundry.abstract.TypeDataModel { | export class TeDeumEquipementSchema extends foundry.abstract.TypeDataModel { | ||||||
|   static defineSchema() { |   static defineSchema() { | ||||||
|     const fields = foundry.data.fields; |     const fields = foundry.data.fields; | ||||||
|     const requiredInteger = { required: true, nullable: false, integer: true }; |     const requiredInteger = { required: true, nullable: false, integer: true }; | ||||||
|   | |||||||
							
								
								
									
										15
									
								
								modules/data/tedeum-schema-origine.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								modules/data/tedeum-schema-origine.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,15 @@ | |||||||
|  | export class TeDeumOrigineSchema extends foundry.abstract.TypeDataModel { | ||||||
|  |   static defineSchema() { | ||||||
|  |     const fields = foundry.data.fields; | ||||||
|  |     const requiredInteger = { required: true, nullable: false, integer: true }; | ||||||
|  |     const schema = {}; | ||||||
|  |  | ||||||
|  |     schema.bonus1 = new fields.StringField({ required: true, blank: false, initial: "entregent" }); | ||||||
|  |     schema.bonus2 = new fields.StringField({ required: true, blank: false, initial: "entregent" }); | ||||||
|  |     schema.cagnotte = new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }); | ||||||
|  |     schema.monnaie = new fields.StringField({ required: true, blank: false, initial: "denier" }); | ||||||
|  |     schema.description = new fields.HTMLField({ required: true, blank: true }); | ||||||
|  |  | ||||||
|  |     return schema; | ||||||
|  |   } | ||||||
|  | } | ||||||
| @@ -1,4 +1,4 @@ | |||||||
| export default class TeDeumPJSchema extends foundry.abstract.TypeDataModel { | export class TeDeumPJSchema extends foundry.abstract.TypeDataModel { | ||||||
|   static defineSchema() { |   static defineSchema() { | ||||||
|     const fields = foundry.data.fields; |     const fields = foundry.data.fields; | ||||||
|     const requiredInteger = { required: true, nullable: false, integer: true }; |     const requiredInteger = { required: true, nullable: false, integer: true }; | ||||||
| @@ -14,6 +14,13 @@ export default class TeDeumPJSchema extends foundry.abstract.TypeDataModel { | |||||||
|       }, {}) |       }, {}) | ||||||
|     ); |     ); | ||||||
|  |  | ||||||
|  |     schema.providence = new fields.SchemaField({ | ||||||
|  |       value: new fields.NumberField({ ...requiredInteger, initial: 1, min: 0 }), | ||||||
|  |     }); | ||||||
|  |     schema.bienveillance = new fields.SchemaField({ | ||||||
|  |       value: new fields.NumberField({ ...requiredInteger, initial: 10, min: 0 }), | ||||||
|  |     }); | ||||||
|  |  | ||||||
|     schema.localisation = new fields.SchemaField( |     schema.localisation = new fields.SchemaField( | ||||||
|       Object.values(LOCALISATION).reduce((obj, loc) => { |       Object.values(LOCALISATION).reduce((obj, loc) => { | ||||||
|         obj[loc.id] =new fields.SchemaField({ |         obj[loc.id] =new fields.SchemaField({ | ||||||
| @@ -33,7 +40,7 @@ export default class TeDeumPJSchema extends foundry.abstract.TypeDataModel { | |||||||
|     schema.description = new fields.HTMLField({required: true, blank: true}); |     schema.description = new fields.HTMLField({required: true, blank: true}); | ||||||
|     schema.connaissances = new fields.HTMLField({required: true, blank: true}); |     schema.connaissances = new fields.HTMLField({required: true, blank: true}); | ||||||
|     schema.vetements = new fields.HTMLField({required: true, blank: true}); |     schema.vetements = new fields.HTMLField({required: true, blank: true}); | ||||||
|     schema.genre = new fields.StringField({ required: false, blank: true, initial: undefined }); |     schema.genre = new fields.StringField({required: true, choices: ["Homme", "Femme"], initial: "Femme"}); | ||||||
|     schema.age = new fields.StringField({ required: false, blank: true, initial: undefined }); |     schema.age = new fields.StringField({ required: false, blank: true, initial: undefined }); | ||||||
|     schema.origine = new fields.StringField({ required: false, blank: true, initial: undefined }); |     schema.origine = new fields.StringField({ required: false, blank: true, initial: undefined }); | ||||||
|     schema.charges = new fields.StringField({ required: false, blank: true, initial: undefined }); |     schema.charges = new fields.StringField({ required: false, blank: true, initial: undefined }); | ||||||
|   | |||||||
| @@ -32,19 +32,6 @@ export class TeDeumItemSheet extends ItemSheet { | |||||||
|     return buttons |     return buttons | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   /* -------------------------------------------- */ |  | ||||||
|   /** @override */ |  | ||||||
|   setPosition(options = {}) { |  | ||||||
|     const position = super.setPosition(options); |  | ||||||
|     const sheetBody = this.element.find(".sheet-body"); |  | ||||||
|     const bodyHeight = position.height - 192; |  | ||||||
|     sheetBody.css("height", bodyHeight); |  | ||||||
|     if (this.item.type.includes('weapon')) { |  | ||||||
|       position.width = 640; |  | ||||||
|     } |  | ||||||
|     return position; |  | ||||||
|   } |  | ||||||
|  |  | ||||||
|   /* -------------------------------------------- */ |   /* -------------------------------------------- */ | ||||||
|   async getData() { |   async getData() { | ||||||
|  |  | ||||||
|   | |||||||
| @@ -9,19 +9,26 @@ | |||||||
| /* -------------------------------------------- */ | /* -------------------------------------------- */ | ||||||
| // Import Modules | // Import Modules | ||||||
| import { TeDeumActor } from "./actors/tedeum-actor.js"; | import { TeDeumActor } from "./actors/tedeum-actor.js"; | ||||||
| import { TeDeumItemSheet } from "./items/tedeum-item-sheet.js"; |  | ||||||
| import { TeDeumActorPJSheet } from "./actors/tedeum-actor-sheet.js"; | import { TeDeumActorPJSheet } from "./actors/tedeum-actor-sheet.js"; | ||||||
| import { TeDeumPJSchema } from "./common/tedeum-schema-pj.js"; |  | ||||||
| import { TeDeumArmeSchema } from "./common/tedeum-schema-arme.js"; |  | ||||||
| import { TeDeumArmureSchema } from "./common/tedeum-schema-armure.js"; |  | ||||||
| import { TeDeumCompetenceSchema } from "./common/tedeum-schema-competence.js"; |  | ||||||
| import { TeDeumEquipementSchema } from "./common/tedeum-schema-equipement.js"; |  | ||||||
| import { TeDeumUtility } from "./common/tedeum-utility.js"; |  | ||||||
| import { TeDeumCombat } from "./app/tedeum-combat.js"; |  | ||||||
| import { TeDeumItem } from "./items/tedeum-item.js"; |  | ||||||
| import { TeDeumHotbar } from "./app/tedeum-hotbar.js" |  | ||||||
| import { TEDEUM_CONFIG } from "./common/tedeum-config.js" |  | ||||||
|  |  | ||||||
|  | import { TeDeumPJSchema } from "./data/tedeum-schema-pj.js"; | ||||||
|  | import { TeDeumArmeSchema } from "./data/tedeum-schema-arme.js"; | ||||||
|  | import { TeDeumArmureSchema } from "./data/tedeum-schema-armure.js"; | ||||||
|  | import { TeDeumCompetenceSchema } from "./data/tedeum-schema-competence.js"; | ||||||
|  | import { TeDeumEquipementSchema } from "./data/tedeum-schema-equipement.js"; | ||||||
|  | import { TeDeumOrigineSchema } from "./data/tedeum-schema-origine.js"; | ||||||
|  | import { TeDeumEducationSchema } from "./data/tedeum-schema-education.js"; | ||||||
|  | import { TeDeumDeboucheSchema } from "./data/tedeum-schema-debouche.js"; | ||||||
|  |  | ||||||
|  | import { TeDeumItem } from "./items/tedeum-item.js"; | ||||||
|  | import { TeDeumItemSheet } from "./items/tedeum-item-sheet.js"; | ||||||
|  |  | ||||||
|  | import { TeDeumHotbar } from "./app/tedeum-hotbar.js" | ||||||
|  | import { TeDeumCombat } from "./app/tedeum-combat.js"; | ||||||
|  |  | ||||||
|  | import { TeDeumUtility } from "./common/tedeum-utility.js"; | ||||||
|  | import { TEDEUM_CONFIG, LOCALISATION, ARME_SPECIFICITE} from "./common/tedeum-config.js"; | ||||||
|  | import { ClassCounter} from "https://www.uberwald.me/fvtt_appcount/count-class-ready.js"; | ||||||
| /* -------------------------------------------- */ | /* -------------------------------------------- */ | ||||||
| /*  Foundry VTT Initialization                  */ | /*  Foundry VTT Initialization                  */ | ||||||
| /* -------------------------------------------- */ | /* -------------------------------------------- */ | ||||||
| @@ -33,26 +40,26 @@ Hooks.once("init", async function () { | |||||||
|  |  | ||||||
|   game.system.tedeum = { |   game.system.tedeum = { | ||||||
|     config: TEDEUM_CONFIG, |     config: TEDEUM_CONFIG, | ||||||
|  |     LOCALISATION: LOCALISATION, | ||||||
|  |     ARME_SPECIFICITE: ARME_SPECIFICITE, | ||||||
|     TeDeumHotbar |     TeDeumHotbar | ||||||
|   } |   } | ||||||
|  |   console.log(`Initializing TeDeum RPG 2`); | ||||||
|  |  | ||||||
|   /* -------------------------------------------- */ |  | ||||||
|   // preload handlebars templates |   // preload handlebars templates | ||||||
|   TeDeumUtility.preloadHandlebarsTemplates(); |   TeDeumUtility.preloadHandlebarsTemplates(); | ||||||
|  |  | ||||||
|   /* -------------------------------------------- */ |  | ||||||
|   // Set an initiative formula for the system  |   // Set an initiative formula for the system  | ||||||
|   CONFIG.Combat.initiative = { |   CONFIG.Combat.initiative = { | ||||||
|     formula: "1d6", |     formula: "1d6", | ||||||
|     decimals: 1 |     decimals: 1 | ||||||
|   }; |   }; | ||||||
|  |  | ||||||
|   /* -------------------------------------------- */ |   game.socket.on("system.fvtt-te-deum", data => { | ||||||
|   game.socket.on("system.fvtt-tedeum", data => { |  | ||||||
|     TeDeumUtility.onSocketMesssage(data) |     TeDeumUtility.onSocketMesssage(data) | ||||||
|   }); |   }); | ||||||
|  |  | ||||||
|   CONFIG.Combat.documentClass = TeDeumCombat |   //CONFIG.Combat.documentClass = TeDeumCombat | ||||||
|   CONFIG.Actor.documentClass = TeDeumActor; |   CONFIG.Actor.documentClass = TeDeumActor; | ||||||
|   CONFIG.Item.documentClass = TeDeumItem |   CONFIG.Item.documentClass = TeDeumItem | ||||||
|   CONFIG.Actor.dataModels = { |   CONFIG.Actor.dataModels = { | ||||||
| @@ -64,14 +71,19 @@ Hooks.once("init", async function () { | |||||||
|     competence: TeDeumCompetenceSchema, |     competence: TeDeumCompetenceSchema, | ||||||
|     equipement: TeDeumEquipementSchema, |     equipement: TeDeumEquipementSchema, | ||||||
|     armure: TeDeumArmureSchema, |     armure: TeDeumArmureSchema, | ||||||
|  |     origine: TeDeumOrigineSchema, | ||||||
|  |     education: TeDeumEducationSchema, | ||||||
|  |     debouche: TeDeumDeboucheSchema, | ||||||
|   }; |   }; | ||||||
|    |    | ||||||
|  |   console.log("TeDeum RPG | Ready"); | ||||||
|  |  | ||||||
|   Actors.unregisterSheet("core", ActorSheet); |   Actors.unregisterSheet("core", ActorSheet); | ||||||
|   Actors.registerSheet(SYSTEM_ID, TeDeumActorPJSheet, { types: ["pj"], makeDefault: true }); |   Actors.registerSheet("fvtt-te-deum", TeDeumActorPJSheet, { types: ["pj"], makeDefault: true }); | ||||||
|   Actors.registerSheet(SYSTEM_ID, TeDeumActorPJSheet, { types: ["pnj"], makeDefault: true }); |   Actors.registerSheet("fvtt-te-deum", TeDeumActorPJSheet, { types: ["pnj"], makeDefault: true }); | ||||||
|    |    | ||||||
|   Items.unregisterSheet("core", ItemSheet); |   Items.unregisterSheet("core", ItemSheet); | ||||||
|   Items.registerSheet(SYSTEM_ID, TeDeumItemSheet, { makeDefault: true }); |   Items.registerSheet("fvtt-te-deum", TeDeumItemSheet, { types: ["arme"], makeDefault: true }); | ||||||
|  |  | ||||||
|   TeDeumUtility.init()  |   TeDeumUtility.init()  | ||||||
| }); | }); | ||||||
| @@ -83,33 +95,7 @@ function welcomeMessage() { | |||||||
|       user: game.user.id, |       user: game.user.id, | ||||||
|       whisper: [game.user.id], |       whisper: [game.user.id], | ||||||
|       content: `<div id="welcome-message-tedeum"><span class="rdd-roll-part"> |       content: `<div id="welcome-message-tedeum"><span class="rdd-roll-part"> | ||||||
|       <strong>Bienvenu dans TeDeum !</strong>` }); |       <strong>Bienvenu dans Te Deum Pour Un Massacre !</strong>` }); | ||||||
|   } |  | ||||||
| } |  | ||||||
|  |  | ||||||
| /* -------------------------------------------- */ |  | ||||||
| // Register world usage statistics |  | ||||||
| function registerUsageCount(registerKey) { |  | ||||||
|   if (game.user.isGM) { |  | ||||||
|     game.settings.register(registerKey, "world-key", { |  | ||||||
|       name: "Unique world key", |  | ||||||
|       scope: "world", |  | ||||||
|       config: false, |  | ||||||
|       default: "", |  | ||||||
|       type: String |  | ||||||
|     }); |  | ||||||
|  |  | ||||||
|     let worldKey = game.settings.get(registerKey, "world-key") |  | ||||||
|     if (worldKey == undefined || worldKey == "") { |  | ||||||
|       worldKey = randomID(32) |  | ||||||
|       game.settings.set(registerKey, "world-key", worldKey) |  | ||||||
|     } |  | ||||||
|     // Simple API counter |  | ||||||
|     let regURL = `https://www.uberwald.me/fvtt_appcount/count.php?name="${registerKey}"&worldKey="${worldKey}"&version="${game.release.generation}.${game.release.build}"&system="${game.system.id}"&systemversion="${game.system.version}"` |  | ||||||
|     //$.ajaxSetup({ |  | ||||||
|     //headers: { 'Access-Control-Allow-Origin': '*' } |  | ||||||
|     //}) |  | ||||||
|     $.ajax(regURL) |  | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -127,9 +113,10 @@ Hooks.once("ready", function () { | |||||||
|     }); |     }); | ||||||
|   } |   } | ||||||
|    |    | ||||||
|   registerUsageCount(game.system.id) |   console.log("YEADEAE"); | ||||||
|  |   ClassCounter.registerUsageCount(); | ||||||
|   welcomeMessage(); |   welcomeMessage(); | ||||||
|   TeDeumUtility.ready() |   TeDeumUtility.ready(); | ||||||
|  |  | ||||||
| }) | }) | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										0
									
								
								packs/equipment/000032.log
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								packs/equipment/000032.log
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										1
									
								
								packs/equipment/CURRENT
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								packs/equipment/CURRENT
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1 @@ | |||||||
|  | MANIFEST-000030 | ||||||
							
								
								
									
										0
									
								
								packs/equipment/LOCK
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								packs/equipment/LOCK
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										7
									
								
								packs/equipment/LOG
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								packs/equipment/LOG
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | |||||||
|  | 2024/02/19-21:26:30.030455 7fc68ee006c0 Recovering log #28 | ||||||
|  | 2024/02/19-21:26:30.041661 7fc68ee006c0 Delete type=3 #26 | ||||||
|  | 2024/02/19-21:26:30.042288 7fc68ee006c0 Delete type=0 #28 | ||||||
|  | 2024/02/19-22:02:32.194497 7fc68d0006c0 Level-0 table #33: started | ||||||
|  | 2024/02/19-22:02:32.194586 7fc68d0006c0 Level-0 table #33: 0 bytes OK | ||||||
|  | 2024/02/19-22:02:32.236476 7fc68d0006c0 Delete type=0 #31 | ||||||
|  | 2024/02/19-22:02:32.286376 7fc68d0006c0 Manual compaction at level-0 from 'undefined' @ 72057594037927935 : 1 .. 'undefined' @ 0 : 0; will stop at (end) | ||||||
							
								
								
									
										7
									
								
								packs/equipment/LOG.old
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								packs/equipment/LOG.old
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | |||||||
|  | 2024/02/19-21:20:44.806918 7fc68ee006c0 Recovering log #24 | ||||||
|  | 2024/02/19-21:20:44.818366 7fc68ee006c0 Delete type=3 #22 | ||||||
|  | 2024/02/19-21:20:44.818471 7fc68ee006c0 Delete type=0 #24 | ||||||
|  | 2024/02/19-21:26:26.162483 7fc68d0006c0 Level-0 table #29: started | ||||||
|  | 2024/02/19-21:26:26.162535 7fc68d0006c0 Level-0 table #29: 0 bytes OK | ||||||
|  | 2024/02/19-21:26:26.169669 7fc68d0006c0 Delete type=0 #27 | ||||||
|  | 2024/02/19-21:26:26.169948 7fc68d0006c0 Manual compaction at level-0 from 'undefined' @ 72057594037927935 : 1 .. 'undefined' @ 0 : 0; will stop at (end) | ||||||
							
								
								
									
										
											BIN
										
									
								
								packs/equipment/MANIFEST-000030
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								packs/equipment/MANIFEST-000030
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										10
									
								
								system.json
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								system.json
									
									
									
									
									
								
							| @@ -25,7 +25,7 @@ | |||||||
|       "type": "Item", |       "type": "Item", | ||||||
|       "name": "equipment", |       "name": "equipment", | ||||||
|       "path": "packs/equipment", |       "path": "packs/equipment", | ||||||
|       "system": "fvtt-ecryme", |       "system": "fvtt-te-deum", | ||||||
|       "flags": {}, |       "flags": {}, | ||||||
|       "ownership": { |       "ownership": { | ||||||
|         "PLAYER": "OBSERVER", |         "PLAYER": "OBSERVER", | ||||||
| @@ -36,10 +36,10 @@ | |||||||
|   "license": "LICENSE.txt", |   "license": "LICENSE.txt", | ||||||
|   "manifest": "https://www.uberwald.me/gitea/public/fvtt-te-deum/raw/branch/master/system.json", |   "manifest": "https://www.uberwald.me/gitea/public/fvtt-te-deum/raw/branch/master/system.json", | ||||||
|   "compatibility": { |   "compatibility": { | ||||||
|     "minimum": "10", |     "minimum": "11", | ||||||
|     "verified": "11" |     "verified": "11" | ||||||
|   }, |   }, | ||||||
|   "id": "fvtt-tedeum", |   "id": "fvtt-te-deum", | ||||||
|   "primaryTokenAttribute": "secondary.health", |   "primaryTokenAttribute": "secondary.health", | ||||||
|   "secondaryTokenAttribute": "secondary.delirium", |   "secondaryTokenAttribute": "secondary.delirium", | ||||||
|   "socket": true, |   "socket": true, | ||||||
| @@ -49,8 +49,8 @@ | |||||||
|   "relationships": { |   "relationships": { | ||||||
|   }, |   }, | ||||||
|   "title": "Te Deum pour Un Massacre, le Jeu de Rôles", |   "title": "Te Deum pour Un Massacre, le Jeu de Rôles", | ||||||
|   "url": "https://www.uberwald.me/gitea/public/fvtt-tedeum", |   "url": "https://www.uberwald.me/gitea/public/fvtt-te-deum", | ||||||
|   "version": "11.0.0", |   "version": "11.0.0", | ||||||
|   "download": "https://www.uberwald.me/gitea/public/fvtt-tedeum/archive/fvtt-tedeum-v11.0.0.zip", |   "download": "https://www.uberwald.me/gitea/public/fvtt-te-deum/archive/fvtt-te-deum-v11.0.0.zip", | ||||||
|   "background": "" |   "background": "" | ||||||
| } | } | ||||||
| @@ -5,10 +5,13 @@ | |||||||
|     "pnj": {} |     "pnj": {} | ||||||
|   }, |   }, | ||||||
|   "Item": { |   "Item": { | ||||||
|     "types": ["arme", "competence", "armure", "equipement"], |     "types": ["arme", "competence", "armure", "equipement", "origine", "education", "debouche"], | ||||||
|     "arme": {}, |     "arme": {}, | ||||||
|     "competence": {}, |     "competence": {}, | ||||||
|     "armure": {}, |     "armure": {}, | ||||||
|     "equipement": {} |     "equipement": {}, | ||||||
|  |     "origine": {}, | ||||||
|  |     "education": {}, | ||||||
|  |     "debouche": {} | ||||||
|   } |   } | ||||||
| } | } | ||||||
							
								
								
									
										34
									
								
								templates/items/item-arme-sheet.hbs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								templates/items/item-arme-sheet.hbs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,34 @@ | |||||||
|  | <form class="{{cssClass}}" autocomplete="off"> | ||||||
|  |   <header class="sheet-header"> | ||||||
|  |       <img class="item-sheet-img" src="{{img}}" data-edit="img" title="{{name}}"/> | ||||||
|  |       <div class="header-fields"> | ||||||
|  |           <h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1> | ||||||
|  |       </div> | ||||||
|  |   </header> | ||||||
|  |    | ||||||
|  |   {{> systems/fvtt-te-deum/templates/items/partial-item-nav.hbs}} | ||||||
|  |  | ||||||
|  |  | ||||||
|  |   {{!-- Sheet Body --}} | ||||||
|  |   <section class="sheet-body"> | ||||||
|  |  | ||||||
|  |     {{> systems/fvtt-te-deum/templates/items/partial-item-description.hbs}} | ||||||
|  |      | ||||||
|  |     <div class="tab details" data-group="primary" data-tab="details"> | ||||||
|  |  | ||||||
|  |       <div class="tab" data-group="primary"> | ||||||
|  |         <ul> | ||||||
|  |  | ||||||
|  |           <li class="flexrow"> | ||||||
|  |             <label class="item-name-label-long">Type d'arme</label> | ||||||
|  |             <select name="system.typeArme"> | ||||||
|  |               {{selectOptions config.armeTypes selected=system.typeArme labelAttr="label" blank=""}} | ||||||
|  |             </select> | ||||||
|  |           </li> | ||||||
|  |  | ||||||
|  |         </ul> | ||||||
|  |     </div> | ||||||
|  |   </div> | ||||||
|  |  | ||||||
|  |   </section> | ||||||
|  | </form> | ||||||
| @@ -1,45 +0,0 @@ | |||||||
| <form class="{{cssClass}}" autocomplete="off"> |  | ||||||
|   <header class="sheet-header"> |  | ||||||
|       <img class="item-sheet-img" src="{{img}}" data-edit="img" title="{{name}}"/> |  | ||||||
|       <div class="header-fields"> |  | ||||||
|           <h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1> |  | ||||||
|       </div> |  | ||||||
|   </header> |  | ||||||
|    |  | ||||||
|   {{> systems/fvtt-ecryme/templates/items/partial-item-nav.hbs}} |  | ||||||
|  |  | ||||||
|  |  | ||||||
|   {{!-- Sheet Body --}} |  | ||||||
|   <section class="sheet-body"> |  | ||||||
|  |  | ||||||
|     {{> systems/fvtt-ecryme/templates/items/partial-item-description.hbs}} |  | ||||||
|      |  | ||||||
|     <div class="tab details" data-group="primary" data-tab="details"> |  | ||||||
|  |  | ||||||
|       <div class="tab" data-group="primary"> |  | ||||||
|         <ul> |  | ||||||
|  |  | ||||||
|           <li class="flexrow"> |  | ||||||
|             <label class="item-name-label-long">{{localize "ECRY.ui.weapontype"}}</label> |  | ||||||
|             <select class="item-field-label-medium" type="text" name="system.weapontype" value="{{system.weapontype}}" data-dtype="String"> |  | ||||||
|               {{#select system.weapontype}} |  | ||||||
|                 {{#each config.weaponTypes as |type key| }} |  | ||||||
|                 <option value="{{key}}">{{localize type}}</option> |  | ||||||
|                 {{/each}} |  | ||||||
|               {{/select}} |  | ||||||
|             </select>  |  | ||||||
|           </li> |  | ||||||
|  |  | ||||||
|           <li class="flexrow"> |  | ||||||
|             <label class="item-name-label-long">{{localize "ECRY.ui.effect"}}</label> |  | ||||||
|             <input type="text" class="item-field-label-short" name="system.effect" value="{{system.effect}}" data-dtype="Number"/>           |  | ||||||
|           </li> |  | ||||||
|        |  | ||||||
|           {{> systems/fvtt-ecryme/templates/items/partial-item-equipment.hbs}} |  | ||||||
|  |  | ||||||
|         </ul> |  | ||||||
|     </div> |  | ||||||
|   </div> |  | ||||||
|  |  | ||||||
|   </section> |  | ||||||
| </form> |  | ||||||
		Reference in New Issue
	
	Block a user