Compare commits
6 Commits
fvtt-malef
...
fvtt-malef
Author | SHA1 | Date | |
---|---|---|---|
d647fcc35e | |||
342f9c2342 | |||
cd14db85cc | |||
ec06f0fdcb | |||
234bd44742 | |||
e0df1f1ff5 |
22
lang/fr.json
22
lang/fr.json
@ -1,13 +1,15 @@
|
||||
{
|
||||
"ACTOR": {
|
||||
"TypePersonnage": "Personnage"
|
||||
},
|
||||
"ITEM": {
|
||||
"TypeArme": "Arme",
|
||||
"TypeEquipement": "Equipement",
|
||||
"TypeTarot": "Tarot",
|
||||
"TypeElementbio": "Element Biographique",
|
||||
"TypeArchetype": "Archetype",
|
||||
"TypeSortilege": "Sortilège"
|
||||
"TYPES": {
|
||||
"Actor": {
|
||||
"personnage" : "Personnage"
|
||||
},
|
||||
"Item": {
|
||||
"arme" : "Arme",
|
||||
"equipement" : "Equipement",
|
||||
"tarot" : "Tarot",
|
||||
"elementbio" : "Elément Biographique",
|
||||
"archetype" : "Archetype",
|
||||
"sortilege" : "Sortilège"
|
||||
}
|
||||
}
|
||||
}
|
@ -6,12 +6,12 @@
|
||||
import { MaleficesUtility } from "./malefices-utility.js";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
export class MaleficesActorSheet extends ActorSheet {
|
||||
export class MaleficesActorSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
|
||||
/** @override */
|
||||
static get defaultOptions() {
|
||||
|
||||
return mergeObject(super.defaultOptions, {
|
||||
return foundry.utils.mergeObject(super.defaultOptions, {
|
||||
classes: ["fvtt-malefices", "sheet", "actor", "malefices-actor-sheet"],
|
||||
template: "systems/fvtt-malefices/templates/actors/actor-sheet.hbs",
|
||||
width: 640,
|
||||
@ -33,20 +33,20 @@ export class MaleficesActorSheet extends ActorSheet {
|
||||
name: this.actor.name,
|
||||
editable: this.isEditable,
|
||||
cssClass: this.isEditable ? "editable" : "locked",
|
||||
system: duplicate(this.object.system),
|
||||
system: foundry.utils.duplicate(this.object.system),
|
||||
limited: this.object.limited,
|
||||
armes: duplicate(this.actor.getArmes()),
|
||||
tarots: duplicate(this.actor.getTarots()),
|
||||
tarotsCache: duplicate(this.actor.getHiddenTarots()),
|
||||
archetype: duplicate(this.actor.getArchetype()),
|
||||
equipements: duplicate(this.actor.getEquipements()),
|
||||
subActors: duplicate(this.actor.getSubActors()),
|
||||
armes: foundry.utils.duplicate(this.actor.getArmes()),
|
||||
tarots: foundry.utils.duplicate(this.actor.getTarots()),
|
||||
tarotsCache: foundry.utils.duplicate(this.actor.getHiddenTarots()),
|
||||
archetype: foundry.utils.duplicate(this.actor.getArchetype()),
|
||||
equipements: foundry.utils.duplicate(this.actor.getEquipements()),
|
||||
subActors: foundry.utils.duplicate(this.actor.getSubActors()),
|
||||
phyMalus: this.actor.getPhysiqueMalus(),
|
||||
elementsbio: this.actor.getElementsBio(),
|
||||
sorts: this.actor.getSorts(),
|
||||
description: await TextEditor.enrichHTML(this.object.system.biodata.description, { async: true }),
|
||||
notes: await TextEditor.enrichHTML(this.object.system.biodata.notes, { async: true }),
|
||||
equipementlibre: await TextEditor.enrichHTML(this.object.system.equipementlibre, { async: true }),
|
||||
description: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.description, { async: true }),
|
||||
notes: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.notes, { async: true }),
|
||||
equipementlibre: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.equipementlibre, { async: true }),
|
||||
options: this.options,
|
||||
owner: this.document.isOwner,
|
||||
editScore: this.options.editScore,
|
||||
@ -66,10 +66,10 @@ export class MaleficesActorSheet extends ActorSheet {
|
||||
|
||||
// Everything below here is only needed if the sheet is editable
|
||||
if (!this.options.editable) return;
|
||||
|
||||
|
||||
html.bind("keydown", function(e) { // Ignore Enter in actores sheet
|
||||
if (e.keyCode === 13) return false;
|
||||
});
|
||||
});
|
||||
|
||||
// Update Inventory Item
|
||||
html.find('.item-edit').click(ev => {
|
||||
@ -87,14 +87,14 @@ export class MaleficesActorSheet extends ActorSheet {
|
||||
let dataType = $(ev.currentTarget).data("type")
|
||||
this.actor.createEmbeddedDocuments('Item', [{ name: "NewItem", type: dataType }], { renderSheet: true })
|
||||
})
|
||||
|
||||
|
||||
html.find('.subactor-edit').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
let actorId = li.data("actor-id");
|
||||
let actor = game.actors.get( actorId );
|
||||
actor.sheet.render(true);
|
||||
});
|
||||
|
||||
|
||||
html.find('.subactor-delete').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
let actorId = li.data("actor-id");
|
||||
@ -117,38 +117,38 @@ export class MaleficesActorSheet extends ActorSheet {
|
||||
const li = $(event.currentTarget).parents(".item")
|
||||
this.actor.incDecAmmo( li.data("item-id"), +1 )
|
||||
} );
|
||||
|
||||
|
||||
html.find('.roll-attribut').click((event) => {
|
||||
let attrKey = $(event.currentTarget).data("attr-key")
|
||||
this.actor.rollAttribut(attrKey)
|
||||
});
|
||||
});
|
||||
html.find('.roll-arme').click((event) => {
|
||||
const armeId = $(event.currentTarget).data("arme-id")
|
||||
this.actor.rollArme(armeId)
|
||||
});
|
||||
|
||||
|
||||
html.find('.lock-unlock-sheet').click((event) => {
|
||||
this.options.editScore = !this.options.editScore;
|
||||
this.render(true);
|
||||
});
|
||||
});
|
||||
html.find('.item-link a').click((event) => {
|
||||
const itemId = $(event.currentTarget).data("item-id");
|
||||
const item = this.actor.getOwnedItem(itemId);
|
||||
item.sheet.render(true);
|
||||
});
|
||||
});
|
||||
html.find('.item-equip').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
this.actor.equipItem( li.data("item-id") );
|
||||
this.render(true);
|
||||
this.render(true);
|
||||
});
|
||||
|
||||
html.find('.update-field').change(ev => {
|
||||
const fieldName = $(ev.currentTarget).data("field-name");
|
||||
let value = Number(ev.currentTarget.value);
|
||||
this.actor.update( { [`${fieldName}`]: value } );
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/* -------------------------------------------- */
|
||||
/** @override */
|
||||
setPosition(options = {}) {
|
||||
|
@ -29,7 +29,7 @@ export class MaleficesActor extends Actor {
|
||||
if (data instanceof Array) {
|
||||
return super.create(data, options);
|
||||
}
|
||||
// If the created actor has items (only applicable to duplicated actors) bypass the new actor creation logic
|
||||
// If the created actor has items (only applicable to foundry.utils.duplicated actors) bypass the new actor creation logic
|
||||
if (data.items) {
|
||||
let actor = super.create(data, options);
|
||||
return actor;
|
||||
@ -92,7 +92,7 @@ export class MaleficesActor extends Actor {
|
||||
return comp;
|
||||
}
|
||||
getArchetype() {
|
||||
let comp = duplicate(this.items.find(item => item.type == 'archetype') || {name: "Pas d'archetype"})
|
||||
let comp = foundry.utils.duplicate(this.items.find(item => item.type == 'archetype') || {name: "Pas d'archetype"})
|
||||
if (comp && comp.system) {
|
||||
comp.tarot = MaleficesUtility.getTarot(comp.system.lametutelaire)
|
||||
}
|
||||
@ -101,25 +101,25 @@ export class MaleficesActor extends Actor {
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
getElementsBio() {
|
||||
let comp = duplicate(this.items.filter(item => item.type == 'elementbio') || [])
|
||||
let comp = foundry.utils.duplicate(this.items.filter(item => item.type == 'elementbio') || [])
|
||||
MaleficesUtility.sortArrayObjectsByName(comp)
|
||||
return comp;
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
getTarots() {
|
||||
let comp = duplicate(this.items.filter(item => item.type == 'tarot' && !item.system.isgm) || [])
|
||||
let comp = foundry.utils.duplicate(this.items.filter(item => item.type == 'tarot' && !item.system.isgm) || [])
|
||||
MaleficesUtility.sortArrayObjectsByName(comp)
|
||||
return comp;
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
getHiddenTarots() {
|
||||
let comp = duplicate(this.items.filter(item => item.type == 'tarot' && item.system.isgm) || [])
|
||||
let comp = foundry.utils.duplicate(this.items.filter(item => item.type == 'tarot' && item.system.isgm) || [])
|
||||
MaleficesUtility.sortArrayObjectsByName(comp)
|
||||
return comp;
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
getArmes() {
|
||||
let comp = duplicate(this.items.filter(item => item.type == 'arme') || [])
|
||||
let comp = foundry.utils.duplicate(this.items.filter(item => item.type == 'arme') || [])
|
||||
MaleficesUtility.sortArrayObjectsByName(comp)
|
||||
return comp;
|
||||
}
|
||||
@ -127,7 +127,7 @@ export class MaleficesActor extends Actor {
|
||||
getItemById(id) {
|
||||
let item = this.items.find(item => item.id == id);
|
||||
if (item) {
|
||||
item = duplicate(item)
|
||||
item = foundry.utils.duplicate(item)
|
||||
}
|
||||
return item;
|
||||
}
|
||||
@ -173,7 +173,7 @@ export class MaleficesActor extends Actor {
|
||||
|
||||
/* ------------------------------------------- */
|
||||
async buildContainerTree() {
|
||||
let equipments = duplicate(this.items.filter(item => item.type == "equipment") || [])
|
||||
let equipments = foundry.utils.duplicate(this.items.filter(item => item.type == "equipment") || [])
|
||||
for (let equip1 of equipments) {
|
||||
if (equip1.system.iscontainer) {
|
||||
equip1.system.contents = []
|
||||
@ -238,13 +238,13 @@ export class MaleficesActor extends Actor {
|
||||
getSubActors() {
|
||||
let subActors = [];
|
||||
for (let id of this.system.subactors) {
|
||||
subActors.push(duplicate(game.actors.get(id)))
|
||||
subActors.push(foundry.utils.duplicate(game.actors.get(id)))
|
||||
}
|
||||
return subActors;
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
async addSubActor(subActorId) {
|
||||
let subActors = duplicate(this.system.subactors);
|
||||
let subActors = foundry.utils.duplicate(this.system.subactors);
|
||||
subActors.push(subActorId);
|
||||
await this.update({ 'system.subactors': subActors });
|
||||
}
|
||||
@ -291,7 +291,7 @@ export class MaleficesActor extends Actor {
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
incDecAttr(attrKey, value) {
|
||||
let attr = duplicate(this.system.attributs[attrKey])
|
||||
let attr = foundry.utils.duplicate(this.system.attributs[attrKey])
|
||||
attr.value += value
|
||||
this.update( { [`system.attributs.${attrKey}`]: attr})
|
||||
}
|
||||
@ -341,6 +341,7 @@ export class MaleficesActor extends Actor {
|
||||
rollData.isReroll = false
|
||||
rollData.confrontationDegre = 0
|
||||
rollData.confrontationModif = 0
|
||||
rollData.config = game.system.malefices.config
|
||||
|
||||
console.log("ROLLDATA", rollData)
|
||||
|
||||
@ -358,7 +359,7 @@ export class MaleficesActor extends Actor {
|
||||
rollAttribut(attrKey) {
|
||||
let attr = this.system.attributs[attrKey]
|
||||
let rollData = this.getCommonRollData()
|
||||
rollData.attr = duplicate(attr)
|
||||
rollData.attr = foundry.utils.duplicate(attr)
|
||||
rollData.mode = "attribut"
|
||||
rollData.title = attr.label
|
||||
rollData.img = this.getAtttributImage(attrKey)
|
||||
@ -369,12 +370,12 @@ export class MaleficesActor extends Actor {
|
||||
rollArme(weaponId) {
|
||||
let arme = this.items.get(weaponId)
|
||||
if (arme) {
|
||||
arme = duplicate(arme)
|
||||
arme = foundry.utils.duplicate(arme)
|
||||
let rollData = this.getCommonRollData()
|
||||
if (arme.system.armetype == "mainsnues" || arme.system.armetype == "epee") {
|
||||
rollData.attr = { label: "(Physique+Habilité)/2", value: Math.floor( (this.getPhysiqueMalus()+this.system.attributs.physique.value+this.system.attributs.habilite.value) / 2) }
|
||||
} else {
|
||||
rollData.attr = duplicate(this.system.attributs.habilite)
|
||||
rollData.attr = foundry.utils.duplicate(this.system.attributs.habilite)
|
||||
}
|
||||
rollData.mode = "arme"
|
||||
rollData.arme = arme
|
||||
|
@ -80,7 +80,7 @@ export class MaleficesCommands {
|
||||
console.log("===> Processing command")
|
||||
let command = commandsTable[name];
|
||||
path = path + name + " ";
|
||||
if (command && command.subTable) {
|
||||
if (command?.subTable) {
|
||||
if (params[0]) {
|
||||
return this._processCommand(command.subTable, params[0], params.slice(1), content, msg, path)
|
||||
}
|
||||
@ -89,7 +89,7 @@ export class MaleficesCommands {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (command && command.func) {
|
||||
if (command?.func) {
|
||||
const result = command.func(content, msg, params);
|
||||
if (result == false) {
|
||||
CrucibleCommands._chatAnswer(msg, command.descr);
|
||||
@ -115,7 +115,7 @@ export class MaleficesCommands {
|
||||
maxPlayerCard: 4,
|
||||
maxSecretCard: 1,
|
||||
cards: [],
|
||||
players: duplicate(game.users),
|
||||
players: foundry.utils.duplicate(game.users),
|
||||
secretCards: [],
|
||||
deck: MaleficesUtility.getTarots()
|
||||
}
|
||||
@ -140,7 +140,7 @@ export class MaleficesCommands {
|
||||
selectedCard.system.isgm = false
|
||||
selectedCard.value = (selectedCard.system.ispositif)? selectedCard.system.numericvalueup : selectedCard.system.numericvaluedown
|
||||
MaleficesUtility.createChatMessage(game.user.name, "", {
|
||||
content: await renderTemplate(`systems/fvtt-malefices/templates/chat/display-tarot-card.hbs`, selectedCard)
|
||||
content: await foundry.applications.handlebars.renderTemplates(`systems/fvtt-malefices/templates/chat/display-tarot-card.hbs`, selectedCard)
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -27,4 +27,41 @@ export const MALEFICES_CONFIG = {
|
||||
"epee": "Epée, sabre, javelot, etc",
|
||||
"mainsnues": "Mains Nues"
|
||||
},
|
||||
|
||||
confrontationDegreOptions :{
|
||||
"0": "0",
|
||||
"1": "1",
|
||||
"2": "2",
|
||||
"3": "3",
|
||||
"4": "4",
|
||||
"5": "5"
|
||||
},
|
||||
|
||||
confrontationModifOptions: {
|
||||
"-1": "-1",
|
||||
"0": "0",
|
||||
"1": "+1"
|
||||
},
|
||||
|
||||
bonusMalusPersoOptions: [
|
||||
{value: "-3", label: "-3"},
|
||||
{value: "-2", label: "-2"},
|
||||
{value: "-1", label: "-1"},
|
||||
{value: "0", label: "0"},
|
||||
{value: "+1", label: "+1"},
|
||||
{value: "+2", label: "+2"},
|
||||
{value: "+3", label: "+3"}
|
||||
],
|
||||
bonusMalusDefOptions: [
|
||||
{value: "-6", label: "-6 (réussite critique)"},
|
||||
{value: "-3", label: "-3 (réussite)"},
|
||||
{value: "0", label: "0 (echec ou pas d'esquive)"},
|
||||
{value: "+3", label: "+3 (echec critique)"}
|
||||
],
|
||||
bonusMalusPorteeOptions: [
|
||||
{value: "1", label: "+1 (Portée courte)"},
|
||||
{value: "0", label: "0 (Portée moyenne)"},
|
||||
{value: "-1", label: "-1 (Portée longue)"}
|
||||
]
|
||||
|
||||
}
|
@ -4,12 +4,12 @@ import { MaleficesUtility } from "./malefices-utility.js";
|
||||
* Extend the basic ItemSheet with some very simple modifications
|
||||
* @extends {ItemSheet}
|
||||
*/
|
||||
export class MaleficesItemSheet extends ItemSheet {
|
||||
export class MaleficesItemSheet extends foundry.appv1.sheets.ItemSheet {
|
||||
|
||||
/** @override */
|
||||
static get defaultOptions() {
|
||||
|
||||
return mergeObject(super.defaultOptions, {
|
||||
return foundry.utils.mergeObject(super.defaultOptions, {
|
||||
classes: ["fvtt-malefices", "sheet", "item"],
|
||||
template: "systems/fvtt-malefices/templates/item-sheet.hbs",
|
||||
dragDrop: [{ dragSelector: null, dropSelector: null }],
|
||||
@ -43,20 +43,20 @@ export class MaleficesItemSheet extends ItemSheet {
|
||||
name: this.object.name,
|
||||
editable: this.isEditable,
|
||||
cssClass: this.isEditable ? "editable" : "locked",
|
||||
system: duplicate(this.object.system),
|
||||
config: duplicate(game.system.malefices.config),
|
||||
system: foundry.utils.duplicate(this.object.system),
|
||||
config: foundry.utils.duplicate(game.system.malefices.config),
|
||||
limited: this.object.limited,
|
||||
options: this.options,
|
||||
owner: this.document.isOwner,
|
||||
description: await TextEditor.enrichHTML(this.object.system.description, { async: true }),
|
||||
notes: await TextEditor.enrichHTML(this.object.system.notes, { async: true }),
|
||||
description: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.description, { async: true }),
|
||||
notes: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.notes, { async: true }),
|
||||
isGM: game.user.isGM
|
||||
}
|
||||
|
||||
if ( this.object.type == "archetype") {
|
||||
formData.tarots = MaleficesUtility.getTarots()
|
||||
}
|
||||
|
||||
|
||||
this.options.editable = !(this.object.origin == "embeddedItem");
|
||||
console.log("ITEM DATA", formData, this);
|
||||
return formData;
|
||||
@ -76,7 +76,7 @@ export class MaleficesItemSheet extends ItemSheet {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
postItem() {
|
||||
let chatData = duplicate(this.item)
|
||||
let chatData = foundry.utils.duplicate(this.item)
|
||||
if (this.actor) {
|
||||
chatData.actor = { id: this.actor.id };
|
||||
}
|
||||
@ -102,7 +102,7 @@ export class MaleficesItemSheet extends ItemSheet {
|
||||
let levelIndex = Number($(ev.currentTarget).parents(".item").data("level-index"))
|
||||
let choiceIndex = Number($(ev.currentTarget).parents(".item").data("choice-index"))
|
||||
let featureId = $(ev.currentTarget).parents(".item").data("feature-id")
|
||||
|
||||
|
||||
let itemData = this.object.system.levels[levelIndex].choices[choiceIndex].features[featureId]
|
||||
|
||||
if (itemData.name != 'None') {
|
||||
|
@ -18,6 +18,7 @@ import { MaleficesItem } from "./malefices-item.js";
|
||||
import { MaleficesHotbar } from "./malefices-hotbar.js"
|
||||
import { MaleficesCharacterSummary } from "./malefices-summary-app.js"
|
||||
import { MALEFICES_CONFIG } from "./malefices-config.js"
|
||||
import { ClassCounter} from "https://www.uberwald.me/fvtt_appcount/count-class-ready.js"
|
||||
|
||||
/* -------------------------------------------- */
|
||||
/* Foundry VTT Initialization */
|
||||
@ -38,7 +39,7 @@ Hooks.once("init", async function () {
|
||||
MaleficesUtility.preloadHandlebarsTemplates();
|
||||
|
||||
/* -------------------------------------------- */
|
||||
// Set an initiative formula for the system
|
||||
// Set an initiative formula for the system
|
||||
CONFIG.Combat.initiative = {
|
||||
formula: "1d6",
|
||||
decimals: 1
|
||||
@ -57,12 +58,12 @@ Hooks.once("init", async function () {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
// Register sheet application classes
|
||||
Actors.unregisterSheet("core", ActorSheet);
|
||||
Actors.registerSheet("fvtt-malefices", MaleficesActorSheet, { types: ["personnage"], makeDefault: true });
|
||||
Actors.registerSheet("fvtt-malefices", MaleficesNPCSheet, { types: ["pnj"], makeDefault: false });
|
||||
foundry.documents.collections.Actors.unregisterSheet("core", foundry.appv1.sheets.ActorSheet);
|
||||
foundry.documents.collections.Actors.registerSheet("fvtt-malefices", MaleficesActorSheet, { types: ["personnage"], makeDefault: true });
|
||||
foundry.documents.collections.Actors.registerSheet("fvtt-malefices", MaleficesNPCSheet, { types: ["pnj"], makeDefault: false });
|
||||
|
||||
Items.unregisterSheet("core", ItemSheet);
|
||||
Items.registerSheet("fvtt-malefices", MaleficesItemSheet, { makeDefault: true });
|
||||
foundry.documents.collections.Items.unregisterSheet("core", foundry.appv1.sheets.ItemSheet);
|
||||
foundry.documents.collections.Items.registerSheet("fvtt-malefices", MaleficesItemSheet, { makeDefault: true });
|
||||
|
||||
MaleficesUtility.init()
|
||||
|
||||
@ -82,31 +83,6 @@ function welcomeMessage() {
|
||||
<p>Commandes : /tirage pour le tirage des tarots, /carte pour tirer une simple carte et /resume pour le résumé des PJs (MJ seulement)` });
|
||||
}
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
// 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)
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
/* Foundry VTT Initialization */
|
||||
@ -122,7 +98,7 @@ Hooks.once("ready", function () {
|
||||
});
|
||||
}
|
||||
|
||||
registerUsageCount('fvtt-malefices')
|
||||
ClassCounter.registerUsageCount();
|
||||
welcomeMessage();
|
||||
MaleficesUtility.ready()
|
||||
MaleficesCharacterSummary.ready()
|
||||
@ -143,4 +119,3 @@ Hooks.on("chatMessage", (html, content, msg) => {
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
|
@ -6,12 +6,12 @@
|
||||
import { MaleficesUtility } from "./malefices-utility.js";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
export class MaleficesNPCSheet extends ActorSheet {
|
||||
export class MaleficesNPCSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
|
||||
/** @override */
|
||||
static get defaultOptions() {
|
||||
|
||||
return mergeObject(super.defaultOptions, {
|
||||
return foundry.utils.mergeObject(super.defaultOptions, {
|
||||
classes: ["Malefices", "sheet", "actor"],
|
||||
template: "systems/fvtt-malefices/templates/npc-sheet.html",
|
||||
width: 640,
|
||||
@ -25,7 +25,7 @@ export class MaleficesNPCSheet extends ActorSheet {
|
||||
/* -------------------------------------------- */
|
||||
async getData() {
|
||||
const objectData = this.object.system
|
||||
let actorData = duplicate(objectData)
|
||||
let actorData = foundry.utils.duplicate(objectData)
|
||||
|
||||
let formData = {
|
||||
title: this.title,
|
||||
@ -38,16 +38,16 @@ export class MaleficesNPCSheet extends ActorSheet {
|
||||
data: actorData,
|
||||
limited: this.object.limited,
|
||||
skills: this.actor.getSkills( ),
|
||||
weapons: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getWeapons()) ),
|
||||
armors: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getArmors())),
|
||||
shields: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getShields())),
|
||||
spells: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getLore())),
|
||||
equipments: this.actor.checkAndPrepareEquipments(duplicate(this.actor.getEquipmentsOnly()) ),
|
||||
equippedWeapons: this.actor.checkAndPrepareEquipments(duplicate(this.actor.getEquippedWeapons()) ),
|
||||
weapons: this.actor.checkAndPrepareEquipments( foundry.utils.duplicate(this.actor.getWeapons()) ),
|
||||
armors: this.actor.checkAndPrepareEquipments( foundry.utils.duplicate(this.actor.getArmors())),
|
||||
shields: this.actor.checkAndPrepareEquipments( foundry.utils.duplicate(this.actor.getShields())),
|
||||
spells: this.actor.checkAndPrepareEquipments( foundry.utils.duplicate(this.actor.getLore())),
|
||||
equipments: this.actor.checkAndPrepareEquipments(foundry.utils.duplicate(this.actor.getEquipmentsOnly()) ),
|
||||
equippedWeapons: this.actor.checkAndPrepareEquipments(foundry.utils.duplicate(this.actor.getEquippedWeapons()) ),
|
||||
equippedArmor: this.actor.getEquippedArmor(),
|
||||
equippedShield: this.actor.getEquippedShield(),
|
||||
subActors: duplicate(this.actor.getSubActors()),
|
||||
moneys: duplicate(this.actor.getMoneys()),
|
||||
subActors: foundry.utils.duplicate(this.actor.getSubActors()),
|
||||
moneys: foundry.utils.duplicate(this.actor.getMoneys()),
|
||||
encCapacity: this.actor.getEncumbranceCapacity(),
|
||||
saveRolls: this.actor.getSaveRoll(),
|
||||
conditions: this.actor.getConditions(),
|
||||
@ -71,10 +71,10 @@ export class MaleficesNPCSheet extends ActorSheet {
|
||||
|
||||
// Everything below here is only needed if the sheet is editable
|
||||
if (!this.options.editable) return;
|
||||
|
||||
|
||||
html.bind("keydown", function(e) { // Ignore Enter in actores sheet
|
||||
if (e.keyCode === 13) return false;
|
||||
});
|
||||
});
|
||||
|
||||
// Update Inventory Item
|
||||
html.find('.item-edit').click(ev => {
|
||||
@ -92,17 +92,17 @@ export class MaleficesNPCSheet extends ActorSheet {
|
||||
let dataType = $(ev.currentTarget).data("type")
|
||||
this.actor.createEmbeddedDocuments('Item', [{ name: "NewItem", type: dataType }], { renderSheet: true })
|
||||
})
|
||||
|
||||
|
||||
html.find('.equip-activate').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item")
|
||||
let itemId = li.data("item-id")
|
||||
this.actor.equipActivate( itemId)
|
||||
});
|
||||
});
|
||||
html.find('.equip-deactivate').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item")
|
||||
let itemId = li.data("item-id")
|
||||
this.actor.equipDeactivate( itemId)
|
||||
});
|
||||
});
|
||||
|
||||
html.find('.subactor-edit').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
@ -110,7 +110,7 @@ export class MaleficesNPCSheet extends ActorSheet {
|
||||
let actor = game.actors.get( actorId );
|
||||
actor.sheet.render(true);
|
||||
});
|
||||
|
||||
|
||||
html.find('.subactor-delete').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
let actorId = li.data("actor-id");
|
||||
@ -133,7 +133,7 @@ export class MaleficesNPCSheet extends ActorSheet {
|
||||
const li = $(event.currentTarget).parents(".item")
|
||||
this.actor.incDecAmmo( li.data("item-id"), +1 )
|
||||
} );
|
||||
|
||||
|
||||
html.find('.roll-ability').click((event) => {
|
||||
const abilityKey = $(event.currentTarget).data("ability-key");
|
||||
this.actor.rollAbility(abilityKey);
|
||||
@ -142,7 +142,7 @@ export class MaleficesNPCSheet extends ActorSheet {
|
||||
const li = $(event.currentTarget).parents(".item")
|
||||
const skillId = li.data("item-id")
|
||||
this.actor.rollSkill(skillId)
|
||||
});
|
||||
});
|
||||
|
||||
html.find('.roll-weapon').click((event) => {
|
||||
const li = $(event.currentTarget).parents(".item");
|
||||
@ -163,28 +163,28 @@ export class MaleficesNPCSheet extends ActorSheet {
|
||||
const saveKey = $(event.currentTarget).data("save-key")
|
||||
this.actor.rollSave(saveKey)
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
html.find('.lock-unlock-sheet').click((event) => {
|
||||
this.options.editScore = !this.options.editScore;
|
||||
this.render(true);
|
||||
});
|
||||
});
|
||||
html.find('.item-link a').click((event) => {
|
||||
const itemId = $(event.currentTarget).data("item-id");
|
||||
const item = this.actor.getOwnedItem(itemId);
|
||||
item.sheet.render(true);
|
||||
});
|
||||
});
|
||||
html.find('.item-equip').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
this.actor.equipItem( li.data("item-id") );
|
||||
this.render(true);
|
||||
this.render(true);
|
||||
});
|
||||
|
||||
html.find('.update-field').change(ev => {
|
||||
const fieldName = $(ev.currentTarget).data("field-name");
|
||||
let value = Number(ev.currentTarget.value);
|
||||
this.actor.update( { [`${fieldName}`]: value } );
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
@ -7,10 +7,10 @@ export class MaleficesRollDialog extends Dialog {
|
||||
|
||||
let options = { classes: ["MaleficesDialog"], width: 540, height: 'fit-content', 'z-index': 99999 }
|
||||
let html
|
||||
if (rollData.attr && rollData.attr.iscard) {
|
||||
html = await renderTemplate('systems/fvtt-malefices/templates/dialogs/confrontation-dialog.hbs', rollData);
|
||||
if (rollData?.attr?.iscard) {
|
||||
html = await foundry.applications.handlebars.renderTemplate('systems/fvtt-malefices/templates/dialogs/confrontation-dialog.hbs', rollData);
|
||||
} else {
|
||||
html = await renderTemplate('systems/fvtt-malefices/templates/dialogs/roll-dialog-generic.hbs', rollData);
|
||||
html = await foundry.applications.handlebars.renderTemplate('systems/fvtt-malefices/templates/dialogs/roll-dialog-generic.hbs', rollData);
|
||||
}
|
||||
|
||||
return new MaleficesRollDialog(actor, rollData, html, options);
|
||||
@ -18,7 +18,7 @@ export class MaleficesRollDialog extends Dialog {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
constructor(actor, rollData, html, options, close = undefined) {
|
||||
let isCard = rollData.attr && rollData.attr.iscard
|
||||
let isCard = rollData?.attr?.iscard
|
||||
let conf = {
|
||||
title: (isCard) ? "Jet" : "Tirage",
|
||||
content: html,
|
||||
@ -45,7 +45,7 @@ export class MaleficesRollDialog extends Dialog {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
roll() {
|
||||
let isCard = this.rollData.attr && this.rollData.attr.iscard
|
||||
let isCard = this.rollData?.attr?.iscard
|
||||
if (isCard) {
|
||||
MaleficesUtility.tirageConfrontationMalefices(this.rollData)
|
||||
} else {
|
||||
@ -64,7 +64,6 @@ export class MaleficesRollDialog extends Dialog {
|
||||
activateListeners(html) {
|
||||
super.activateListeners(html);
|
||||
|
||||
var dialog = this;
|
||||
function onLoad() {
|
||||
}
|
||||
$(function () { onLoad(); });
|
||||
@ -87,6 +86,6 @@ export class MaleficesRollDialog extends Dialog {
|
||||
html.find('#confrontationModif').change((event) => {
|
||||
this.rollData.confrontationModif = Number(event.currentTarget.value)
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -43,7 +43,7 @@ export class MaleficesCharacterSummary extends Application {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static get defaultOptions() {
|
||||
return mergeObject(super.defaultOptions, {
|
||||
return foundry.utils.mergeObject(super.defaultOptions, {
|
||||
template: "systems/fvtt-malefices/templates/dialogs/character-summary.hbs",
|
||||
popOut: true,
|
||||
resizable: true,
|
||||
|
@ -6,7 +6,7 @@ export class MaleficesTirageTarotDialog extends Dialog {
|
||||
static async create(actor, tirageData) {
|
||||
|
||||
let options = { classes: ["MaleficesDialog"], width: 720, height: 740, 'z-index': 99999 };
|
||||
let html = await renderTemplate('systems/fvtt-malefices/templates/dialogs/tirage-tarot-dialog.hbs', tirageData);
|
||||
let html = await foundry.applications.handlebars.renderTemplate('systems/fvtt-malefices/templates/dialogs/tirage-tarot-dialog.hbs', tirageData);
|
||||
|
||||
return new MaleficesTirageTarotDialog(actor, tirageData, html, options);
|
||||
}
|
||||
@ -36,7 +36,7 @@ export class MaleficesTirageTarotDialog extends Dialog {
|
||||
async sendCardRequest() {
|
||||
this.tirageData.state = 'waiting-user-card'
|
||||
let msg = await MaleficesUtility.createChatMessage(this.tirageData.user.name, "useronly", {
|
||||
content: await renderTemplate(`systems/fvtt-malefices/templates/chat/request-tarot-card.hbs`, this.tirageData)
|
||||
content: await renderTemplate(`systems/fvtt-malefices/templates/chat/request-tarot-card.hbs`, this.tirageData)
|
||||
})
|
||||
//msg.setFlag("world", "tirage-data", this.tirageData)
|
||||
console.log("MSG IS", msg)
|
||||
@ -50,7 +50,7 @@ export class MaleficesTirageTarotDialog extends Dialog {
|
||||
if ( selectedCard.system.isdualside) { // Cas des cartes pouvant avoir 2 sens
|
||||
selectedCard.system.ispositif = (Math.random() > 0.5)
|
||||
}
|
||||
console.log("CARD SELECTED:", selectedCard)
|
||||
console.log("CARD SELECTED:", selectedCard)
|
||||
// Cas spécial de la Roue de la Fortune
|
||||
if ( selectedCard.name.toLowerCase().includes("fortune")) {
|
||||
this.tirageData.maxPlayerCard += 1
|
||||
@ -63,7 +63,7 @@ export class MaleficesTirageTarotDialog extends Dialog {
|
||||
}
|
||||
}
|
||||
this.tirageData.deck = newList
|
||||
|
||||
|
||||
return selectedCard
|
||||
}
|
||||
|
||||
@ -74,9 +74,9 @@ export class MaleficesTirageTarotDialog extends Dialog {
|
||||
let selectedCard = this.drawCard()
|
||||
selectedCard.system.isgm = false
|
||||
await MaleficesUtility.createChatMessage(this.tirageData.user.name, "gmroll", {
|
||||
content: await renderTemplate(`systems/fvtt-malefices/templates/chat/display-tarot-card.hbs`, selectedCard)
|
||||
content: await renderTemplate(`systems/fvtt-malefices/templates/chat/display-tarot-card.hbs`, selectedCard)
|
||||
})
|
||||
if (this.tirageData.cards[0].name == "???") {
|
||||
if (this.tirageData.cards[0].name == "???") {
|
||||
this.tirageData.cards.shift()
|
||||
}
|
||||
this.tirageData.cards.push(selectedCard)
|
||||
@ -87,14 +87,14 @@ export class MaleficesTirageTarotDialog extends Dialog {
|
||||
let selectedCard = this.drawCard()
|
||||
selectedCard.system.isgm = true
|
||||
await MaleficesUtility.createChatMessage(this.tirageData.user.name, "blindroll", {
|
||||
content: await renderTemplate(`systems/fvtt-malefices/templates/chat/display-tarot-card.hbs`, selectedCard)
|
||||
content: await foundry.applications.handlebars.renderTemplate(`systems/fvtt-malefices/templates/chat/display-tarot-card.hbs`, selectedCard)
|
||||
})
|
||||
if (this.tirageData.secretCards[0].name == "???") {
|
||||
if (this.tirageData.secretCards[0].name == "???") {
|
||||
this.tirageData.secretCards.shift()
|
||||
}
|
||||
this.tirageData.secretCards.push(selectedCard)
|
||||
}
|
||||
this.tirageData.actors = duplicate(game.actors)
|
||||
this.tirageData.actors = foundry.utils.duplicate(game.actors)
|
||||
this.tirageData.state = 'attribute-to-actor'
|
||||
}else {
|
||||
this.sendCardRequest()
|
||||
@ -124,7 +124,7 @@ export class MaleficesTirageTarotDialog extends Dialog {
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
async refreshDialog() {
|
||||
const content = await renderTemplate("systems/fvtt-malefices/templates/dialogs/tirage-tarot-dialog.hbs", this.tirageData)
|
||||
const content = await foundry.applications.handlebars.renderTemplate("systems/fvtt-malefices/templates/dialogs/tirage-tarot-dialog.hbs", this.tirageData)
|
||||
this.data.content = content
|
||||
this.render(true)
|
||||
}
|
||||
@ -133,7 +133,7 @@ export class MaleficesTirageTarotDialog extends Dialog {
|
||||
activateListeners(html) {
|
||||
super.activateListeners(html);
|
||||
|
||||
var dialog = this;
|
||||
let dialog = this;
|
||||
function onLoad() {
|
||||
}
|
||||
$(function () { onLoad(); });
|
||||
@ -150,6 +150,6 @@ export class MaleficesTirageTarotDialog extends Dialog {
|
||||
dialog.attributeToActor(actorId)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -43,6 +43,14 @@ export class MaleficesUtility {
|
||||
Handlebars.registerHelper('add', function (a, b) {
|
||||
return parseInt(a) + parseInt(b);
|
||||
})
|
||||
// Handle v12 removal of this helper
|
||||
Handlebars.registerHelper('select', function (selected, options) {
|
||||
const escapedValue = RegExp.escape(Handlebars.escapeExpression(selected));
|
||||
const rgx = new RegExp(' value=[\"\']' + escapedValue + '[\"\']');
|
||||
const html = options.fn(this);
|
||||
return html.replace(rgx, "$& selected");
|
||||
});
|
||||
|
||||
|
||||
game.settings.register("world", "character-summary-data", {
|
||||
name: "character-summary-data",
|
||||
@ -65,10 +73,10 @@ export class MaleficesUtility {
|
||||
|
||||
/*-------------------------------------------- */
|
||||
static getTarots() {
|
||||
return duplicate(this.tarots)
|
||||
return foundry.utils.duplicate(this.tarots)
|
||||
}
|
||||
static getTarot(tId) {
|
||||
return this.tarots.find(t => t._id == tId)
|
||||
return this.tarots.find(t => t._id == tId)
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -99,14 +107,14 @@ export class MaleficesUtility {
|
||||
if (game.user.isGM) {
|
||||
game.system.malefices.currentTirage.addCard(msgId)
|
||||
} else {
|
||||
game.socket.emit( "system.fvtt-malefices", {name: "msg-draw-card", data: {msgId: msgId}})
|
||||
game.socket.emit("system.fvtt-malefices", { name: "msg-draw-card", data: { msgId: msgId } })
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async chatListeners(html) {
|
||||
|
||||
html.on("click", '.roll-destin', event => {
|
||||
$(html).on("click", '.roll-destin', event => {
|
||||
let messageId = MaleficesUtility.findChatMessageId(event.currentTarget)
|
||||
let message = game.messages.get(messageId)
|
||||
let rollData = message.getFlag("world", "rolldata")
|
||||
@ -115,11 +123,11 @@ export class MaleficesUtility {
|
||||
rollData.isReroll = true
|
||||
this.rollMalefices(rollData)
|
||||
})
|
||||
html.on("click", '.draw-tarot-card', event => {
|
||||
$(html).on("click", '.draw-tarot-card', event => {
|
||||
let messageId = MaleficesUtility.findChatMessageId(event.currentTarget)
|
||||
this.drawDeckCard(messageId)
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -130,7 +138,7 @@ export class MaleficesUtility {
|
||||
'systems/fvtt-malefices/templates/items/partial-item-nav.hbs',
|
||||
'systems/fvtt-malefices/templates/items/partial-item-description.hbs'
|
||||
]
|
||||
return loadTemplates(templatePaths);
|
||||
return foundry.applications.handlebars.loadTemplates(templatePaths);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -196,7 +204,7 @@ export class MaleficesUtility {
|
||||
|
||||
let id = rollData.rollId
|
||||
let oldRollData = this.rollDataStore[id] || {}
|
||||
let newRollData = mergeObject(oldRollData, rollData)
|
||||
let newRollData = foundry.utils.mergeObject(oldRollData, rollData)
|
||||
this.rollDataStore[id] = newRollData
|
||||
}
|
||||
|
||||
@ -204,7 +212,7 @@ export class MaleficesUtility {
|
||||
static async onSocketMesssage(msg) {
|
||||
console.log("SOCKET MESSAGE", msg.name)
|
||||
if (msg.name == "msg-draw-card") {
|
||||
if ( game.user.isGM && game.system.malefices.currentTirage) {
|
||||
if (game.user.isGM && game.system.malefices.currentTirage) {
|
||||
game.system.malefices.currentTirage.addCard(msg.data.msgId)
|
||||
}
|
||||
}
|
||||
@ -271,71 +279,79 @@ export class MaleficesUtility {
|
||||
/* -------------------------------------------- */
|
||||
static processSpecialCard(actor, rollData) {
|
||||
if (rollData.selectedCard.name.toLowerCase().includes("archange")) {
|
||||
let actorCard = actor.items.find( c => c.type =="tarot" && c.name.toLowerCase().includes("archange"))
|
||||
let actorCard = actor.items.find(c => c.type == "tarot" && c.name.toLowerCase().includes("archange"))
|
||||
if (actorCard) {
|
||||
MaleficesUtility.createChatMessage(actor.name, "gmroll", {
|
||||
content: `Conséquence supplémentaire ! <br>L'Archange : ${actor.name} gagne 1 point de Spiritualité.` })
|
||||
content: `Conséquence supplémentaire ! <br>L'Archange : ${actor.name} gagne 1 point de Spiritualité.`
|
||||
})
|
||||
actor.incDecAttr("spiritualite", 1)
|
||||
}
|
||||
}
|
||||
if (rollData.selectedCard.name.toLowerCase().includes("vicaire")) {
|
||||
let actorCard = actor.items.find( c => c.type =="tarot" && c.name.toLowerCase().includes("vicaire"))
|
||||
let actorCard = actor.items.find(c => c.type == "tarot" && c.name.toLowerCase().includes("vicaire"))
|
||||
if (actorCard) {
|
||||
MaleficesUtility.createChatMessage(actor.name, "blindroll", {
|
||||
content: `Conséquence supplémentaire ! <br>Le Vicaire : ${actor.name} vient de gagner 1 point en Pratique de la Magie Blanche (MPMB, secret).` })
|
||||
content: `Conséquence supplémentaire ! <br>Le Vicaire : ${actor.name} vient de gagner 1 point en Pratique de la Magie Blanche (MPMB, secret).`
|
||||
})
|
||||
actor.incDecMPMB(1)
|
||||
}
|
||||
}
|
||||
if (rollData.selectedCard.name.toLowerCase().includes("chance")) {
|
||||
let actorCard = actor.items.find( c => c.type =="tarot" && c.name.toLowerCase().includes("chance"))
|
||||
let actorCard = actor.items.find(c => c.type == "tarot" && c.name.toLowerCase().includes("chance"))
|
||||
if (actorCard) {
|
||||
MaleficesUtility.createChatMessage(actor.name, "gmroll", {
|
||||
content: `Conséquence supplémentaire ! <br>La Chance : ${actor.name} a gagné 1 point de Destin.` })
|
||||
content: `Conséquence supplémentaire ! <br>La Chance : ${actor.name} a gagné 1 point de Destin.`
|
||||
})
|
||||
actor.incDecDestin(1)
|
||||
}
|
||||
}
|
||||
if (rollData.selectedCard.name.toLowerCase().includes("mort")) {
|
||||
let actorCard = actor.items.find( c => c.type =="tarot" && c.name.toLowerCase().includes("mort"))
|
||||
let actorCard = actor.items.find(c => c.type == "tarot" && c.name.toLowerCase().includes("mort"))
|
||||
if (actorCard) {
|
||||
MaleficesUtility.createChatMessage(actor.name, "gmroll", {
|
||||
content: `Conséquence supplémentaire ! <br>La Mort : ${actor.name} est pétrifié par la peur.` })
|
||||
content: `Conséquence supplémentaire ! <br>La Mort : ${actor.name} est pétrifié par la peur.`
|
||||
})
|
||||
actor.incDecDestin(1)
|
||||
}
|
||||
}
|
||||
if (rollData.selectedCard.name.toLowerCase().includes("diable")) {
|
||||
let actorCard = actor.items.find( c => c.type =="tarot" && c.name.toLowerCase().includes("diable"))
|
||||
let actorCard = actor.items.find(c => c.type == "tarot" && c.name.toLowerCase().includes("diable"))
|
||||
if (actorCard) {
|
||||
MaleficesUtility.createChatMessage(actor.name, "gmroll", {
|
||||
content: `Conséquence supplémentaire ! <br>Le Diable : ${actor.name} gagne 1 point de Rationnalité.` })
|
||||
content: `Conséquence supplémentaire ! <br>Le Diable : ${actor.name} gagne 1 point de Rationnalité.`
|
||||
})
|
||||
actor.incDecAttr("rationnalite", 1)
|
||||
}
|
||||
}
|
||||
if (rollData.selectedCard.name.toLowerCase().includes("lune noire")) {
|
||||
let actorCard = actor.items.find( c => c.type =="tarot" && c.name.toLowerCase().includes("lune noire"))
|
||||
let actorCard = actor.items.find(c => c.type == "tarot" && c.name.toLowerCase().includes("lune noire"))
|
||||
if (actorCard) {
|
||||
MaleficesUtility.createChatMessage(actor.name, "blindroll", {
|
||||
content: `Conséquence supplémentaire ! <br>La Lune Noire : ${actor.name} vient de gagner 1 point de Fluide (secret).` })
|
||||
content: `Conséquence supplémentaire ! <br>La Lune Noire : ${actor.name} vient de gagner 1 point de Fluide (secret).`
|
||||
})
|
||||
actor.incDecFluide(1)
|
||||
}
|
||||
}
|
||||
if (rollData.selectedCard.name.toLowerCase().includes("grand livre")) {
|
||||
let actorCard = actor.items.find( c => c.type =="tarot" && c.name.toLowerCase().includes("grand livre"))
|
||||
let actorCard = actor.items.find(c => c.type == "tarot" && c.name.toLowerCase().includes("grand livre"))
|
||||
if (actorCard) {
|
||||
MaleficesUtility.createChatMessage(actor.name, "blindroll", {
|
||||
content: `Conséquence supplémentaire ! <br>La Lune Noire : ${actor.name} vient de gagner 1 point de Fluide (secret).` })
|
||||
content: `Conséquence supplémentaire ! <br>La Lune Noire : ${actor.name} vient de gagner 1 point de Fluide (secret).`
|
||||
})
|
||||
actor.incDecFluide(1)
|
||||
}
|
||||
}
|
||||
if (rollData.selectedCard.name.toLowerCase().includes("sorcier")) {
|
||||
let actorCard = actor.items.find( c => c.type =="tarot" && c.name.toLowerCase().includes("sorcier"))
|
||||
let actorCard = actor.items.find(c => c.type == "tarot" && c.name.toLowerCase().includes("sorcier"))
|
||||
if (actorCard) {
|
||||
MaleficesUtility.createChatMessage(actor.name, "blindroll", {
|
||||
content: `Conséquence supplémentaire ! <br>Le Vicaire : ${actor.name} vient de gagner 1 point en Pratique de la Magie Noire (MPMN, secret).` })
|
||||
content: `Conséquence supplémentaire ! <br>Le Vicaire : ${actor.name} vient de gagner 1 point en Pratique de la Magie Noire (MPMN, secret).`
|
||||
})
|
||||
actor.incDecMPMN(1)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static computeResults(rollData) {
|
||||
@ -362,30 +378,30 @@ export class MaleficesUtility {
|
||||
rollData.target = rollData.attr.value - rollData.confrontationDegre + rollData.confrontationModif
|
||||
|
||||
let deck = this.getTarots()
|
||||
let index = Math.round(Math.random() * (deck.length-1))
|
||||
let index = Math.round(Math.random() * (deck.length - 1))
|
||||
let selectedCard = deck[index]
|
||||
selectedCard.system.ispositif = (Math.random() > 0.5)
|
||||
selectedCard.value = (selectedCard.system.ispositif)? selectedCard.system.numericvalueup : selectedCard.system.numericvaluedown
|
||||
selectedCard.value = (selectedCard.system.ispositif) ? selectedCard.system.numericvalueup : selectedCard.system.numericvaluedown
|
||||
rollData.total = selectedCard.value
|
||||
rollData.selectedCard = selectedCard
|
||||
await MaleficesUtility.createChatMessage(actor.name, "gmroll", {
|
||||
content: await renderTemplate(`systems/fvtt-malefices/templates/chat/display-tarot-card.hbs`, selectedCard)
|
||||
content: await renderTemplate(`systems/fvtt-malefices/templates/chat/display-tarot-card.hbs`, selectedCard)
|
||||
})
|
||||
|
||||
this.computeResults(rollData)
|
||||
|
||||
if (rollData.isSuccess) {
|
||||
rollData.gainAttr = Math.ceil(rollData.confrontationDegre/2) + ((rollData.isCritical ) ? 1 : 0)
|
||||
actor.incDecAttr(rollData.attr.abbrev, rollData.gainAttr )
|
||||
rollData.gainAttr = Math.ceil(rollData.confrontationDegre / 2) + ((rollData.isCritical) ? 1 : 0)
|
||||
actor.incDecAttr(rollData.attr.abbrev, rollData.gainAttr)
|
||||
} else {
|
||||
rollData.gainAttr = rollData.confrontationDegre
|
||||
actor.incDecAttr(rollData.attr.abbrev, -rollData.gainAttr )
|
||||
actor.incDecAttr(rollData.attr.abbrev, -rollData.gainAttr)
|
||||
}
|
||||
|
||||
await MaleficesUtility.createChatMessage(actor.name, "gmroll", {
|
||||
content: await renderTemplate(`systems/fvtt-malefices/templates/chat/chat-confrontation-result.hbs`, rollData)
|
||||
content: await renderTemplate(`systems/fvtt-malefices/templates/chat/chat-confrontation-result.hbs`, rollData)
|
||||
})
|
||||
this.processSpecialCard(actor, rollData)
|
||||
this.processSpecialCard(actor, rollData)
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
static async rollMalefices(rollData) {
|
||||
@ -402,15 +418,15 @@ export class MaleficesUtility {
|
||||
|
||||
// Performs roll
|
||||
console.log("Roll formula", diceFormula)
|
||||
let myRoll = new Roll(diceFormula).roll({ async: false })
|
||||
let myRoll = await new Roll(diceFormula).roll()
|
||||
await this.showDiceSoNice(myRoll, game.settings.get("core", "rollMode"))
|
||||
rollData.roll = duplicate(myRoll)
|
||||
rollData.roll = foundry.utils.duplicate(myRoll)
|
||||
rollData.total = myRoll.total
|
||||
|
||||
this.computeResults(rollData)
|
||||
|
||||
let msg = await this.createChatWithRollMode(rollData.alias, {
|
||||
content: await renderTemplate(`systems/fvtt-malefices/templates/chat/chat-generic-result.hbs`, rollData)
|
||||
content: await foundry.applications.handlebars.renderTemplate(`systems/fvtt-malefices/templates/chat/chat-generic-result.hbs`, rollData)
|
||||
})
|
||||
msg.setFlag("world", "rolldata", rollData)
|
||||
if (rollData.mode == "initiative") {
|
||||
@ -462,7 +478,7 @@ export class MaleficesUtility {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static blindMessageToGM(chatOptions) {
|
||||
let chatGM = duplicate(chatOptions);
|
||||
let chatGM = foundry.utils.duplicate(chatOptions);
|
||||
chatGM.whisper = this.getUsers(user => user.isGM);
|
||||
chatGM.content = "Blinde message of " + game.user.name + "<br>" + chatOptions.content;
|
||||
console.log("blindMessageToGM", chatGM);
|
||||
@ -512,7 +528,7 @@ export class MaleficesUtility {
|
||||
/* -------------------------------------------- */
|
||||
static getBasicRollData() {
|
||||
let rollData = {
|
||||
rollId: randomID(16),
|
||||
rollId: foundry.utils.randomID(16),
|
||||
bonusMalusPerso: 0,
|
||||
bonusMalusSituation: 0,
|
||||
bonusMalusDef: 0,
|
||||
|
Binary file not shown.
BIN
packs/malefices-archetypes/000035.log
Normal file
BIN
packs/malefices-archetypes/000035.log
Normal file
Binary file not shown.
@ -1 +1 @@
|
||||
MANIFEST-000002
|
||||
MANIFEST-000034
|
||||
|
@ -1,5 +1,3 @@
|
||||
2023/10/24-22:56:59.069067 7f688bfff6c0 Delete type=3 #1
|
||||
2023/10/24-23:14:50.933686 7f660b7ef6c0 Level-0 table #5: started
|
||||
2023/10/24-23:14:50.938288 7f660b7ef6c0 Level-0 table #5: 49972 bytes OK
|
||||
2023/10/24-23:14:50.946150 7f660b7ef6c0 Delete type=0 #3
|
||||
2023/10/24-23:14:50.965618 7f660b7ef6c0 Manual compaction at level-0 from '!items!2HWSdXDSFei9KC6y' @ 72057594037927935 : 1 .. '!items!xtYE2kVIfNtrXSoU' @ 0 : 0; will stop at (end)
|
||||
2025/05/01-00:13:13.266834 7efc4dffb6c0 Recovering log #31
|
||||
2025/05/01-00:13:13.321299 7efc4dffb6c0 Delete type=3 #29
|
||||
2025/05/01-00:13:13.321436 7efc4dffb6c0 Delete type=0 #31
|
||||
|
14
packs/malefices-archetypes/LOG.old
Normal file
14
packs/malefices-archetypes/LOG.old
Normal file
@ -0,0 +1,14 @@
|
||||
2024/11/29-17:51:13.272607 7f11d37fe6c0 Recovering log #28
|
||||
2024/11/29-17:51:13.282971 7f11d37fe6c0 Delete type=0 #28
|
||||
2024/11/29-17:51:13.283067 7f11d37fe6c0 Delete type=3 #27
|
||||
2024/11/29-17:51:44.217520 7f11d27fc6c0 Level-0 table #32: started
|
||||
2024/11/29-17:51:44.221106 7f11d27fc6c0 Level-0 table #32: 50651 bytes OK
|
||||
2024/11/29-17:51:44.227128 7f11d27fc6c0 Delete type=0 #30
|
||||
2024/11/29-17:51:44.256008 7f11d27fc6c0 Manual compaction at level-0 from '!items!2HWSdXDSFei9KC6y' @ 72057594037927935 : 1 .. '!items!xtYE2kVIfNtrXSoU' @ 0 : 0; will stop at '!items!xtYE2kVIfNtrXSoU' @ 46 : 1
|
||||
2024/11/29-17:51:44.256025 7f11d27fc6c0 Compacting 2@0 + 0@1 files
|
||||
2024/11/29-17:51:44.260729 7f11d27fc6c0 Generated table #33@0: 23 keys, 50651 bytes
|
||||
2024/11/29-17:51:44.260747 7f11d27fc6c0 Compacted 2@0 + 0@1 files => 50651 bytes
|
||||
2024/11/29-17:51:44.266718 7f11d27fc6c0 compacted to: files[ 0 1 0 0 0 0 0 ]
|
||||
2024/11/29-17:51:44.266853 7f11d27fc6c0 Delete type=2 #22
|
||||
2024/11/29-17:51:44.267043 7f11d27fc6c0 Delete type=2 #32
|
||||
2024/11/29-17:51:44.297135 7f11d27fc6c0 Manual compaction at level-0 from '!items!xtYE2kVIfNtrXSoU' @ 46 : 1 .. '!items!xtYE2kVIfNtrXSoU' @ 0 : 0; will stop at (end)
|
Binary file not shown.
BIN
packs/malefices-archetypes/MANIFEST-000034
Normal file
BIN
packs/malefices-archetypes/MANIFEST-000034
Normal file
Binary file not shown.
BIN
packs/malefices-archetypes/lost/MANIFEST-000023
Normal file
BIN
packs/malefices-archetypes/lost/MANIFEST-000023
Normal file
Binary file not shown.
Binary file not shown.
BIN
packs/malefices-armes/000033.ldb
Normal file
BIN
packs/malefices-armes/000033.ldb
Normal file
Binary file not shown.
BIN
packs/malefices-armes/000035.log
Normal file
BIN
packs/malefices-armes/000035.log
Normal file
Binary file not shown.
@ -1 +1 @@
|
||||
MANIFEST-000002
|
||||
MANIFEST-000034
|
||||
|
@ -1,5 +1,3 @@
|
||||
2023/10/24-22:56:59.028963 7f68a0df86c0 Delete type=3 #1
|
||||
2023/10/24-23:14:50.922783 7f660b7ef6c0 Level-0 table #5: started
|
||||
2023/10/24-23:14:50.926620 7f660b7ef6c0 Level-0 table #5: 1991 bytes OK
|
||||
2023/10/24-23:14:50.933356 7f660b7ef6c0 Delete type=0 #3
|
||||
2023/10/24-23:14:50.957490 7f660b7ef6c0 Manual compaction at level-0 from '!items!5J6qIaWdnhEGMAXJ' @ 72057594037927935 : 1 .. '!items!nkRQU81L1gWOfaeo' @ 0 : 0; will stop at (end)
|
||||
2025/05/01-00:13:13.203817 7efc4effd6c0 Recovering log #31
|
||||
2025/05/01-00:13:13.258580 7efc4effd6c0 Delete type=3 #29
|
||||
2025/05/01-00:13:13.258656 7efc4effd6c0 Delete type=0 #31
|
||||
|
14
packs/malefices-armes/LOG.old
Normal file
14
packs/malefices-armes/LOG.old
Normal file
@ -0,0 +1,14 @@
|
||||
2024/11/29-17:51:13.259713 7f11d2ffd6c0 Recovering log #28
|
||||
2024/11/29-17:51:13.269307 7f11d2ffd6c0 Delete type=0 #28
|
||||
2024/11/29-17:51:13.269361 7f11d2ffd6c0 Delete type=3 #27
|
||||
2024/11/29-17:51:44.227241 7f11d27fc6c0 Level-0 table #32: started
|
||||
2024/11/29-17:51:44.230288 7f11d27fc6c0 Level-0 table #32: 2091 bytes OK
|
||||
2024/11/29-17:51:44.237280 7f11d27fc6c0 Delete type=0 #30
|
||||
2024/11/29-17:51:44.267165 7f11d27fc6c0 Manual compaction at level-0 from '!items!5J6qIaWdnhEGMAXJ' @ 72057594037927935 : 1 .. '!items!nkRQU81L1gWOfaeo' @ 0 : 0; will stop at '!items!nkRQU81L1gWOfaeo' @ 18 : 1
|
||||
2024/11/29-17:51:44.267179 7f11d27fc6c0 Compacting 2@0 + 0@1 files
|
||||
2024/11/29-17:51:44.270390 7f11d27fc6c0 Generated table #33@0: 9 keys, 2091 bytes
|
||||
2024/11/29-17:51:44.270401 7f11d27fc6c0 Compacted 2@0 + 0@1 files => 2091 bytes
|
||||
2024/11/29-17:51:44.276181 7f11d27fc6c0 compacted to: files[ 0 1 0 0 0 0 0 ]
|
||||
2024/11/29-17:51:44.276330 7f11d27fc6c0 Delete type=2 #22
|
||||
2024/11/29-17:51:44.276569 7f11d27fc6c0 Delete type=2 #32
|
||||
2024/11/29-17:51:44.297146 7f11d27fc6c0 Manual compaction at level-0 from '!items!nkRQU81L1gWOfaeo' @ 18 : 1 .. '!items!nkRQU81L1gWOfaeo' @ 0 : 0; will stop at (end)
|
Binary file not shown.
BIN
packs/malefices-armes/MANIFEST-000034
Normal file
BIN
packs/malefices-armes/MANIFEST-000034
Normal file
Binary file not shown.
BIN
packs/malefices-armes/lost/MANIFEST-000023
Normal file
BIN
packs/malefices-armes/lost/MANIFEST-000023
Normal file
Binary file not shown.
Binary file not shown.
BIN
packs/malefices-macros/000033.ldb
Normal file
BIN
packs/malefices-macros/000033.ldb
Normal file
Binary file not shown.
BIN
packs/malefices-macros/000035.log
Normal file
BIN
packs/malefices-macros/000035.log
Normal file
Binary file not shown.
@ -1 +1 @@
|
||||
MANIFEST-000002
|
||||
MANIFEST-000034
|
||||
|
@ -1,5 +1,3 @@
|
||||
2023/10/24-22:56:59.116622 7f68a0df86c0 Delete type=3 #1
|
||||
2023/10/24-23:14:50.946390 7f660b7ef6c0 Level-0 table #5: started
|
||||
2023/10/24-23:14:50.949887 7f660b7ef6c0 Level-0 table #5: 803 bytes OK
|
||||
2023/10/24-23:14:50.956586 7f660b7ef6c0 Delete type=0 #3
|
||||
2023/10/24-23:14:50.965669 7f660b7ef6c0 Manual compaction at level-0 from '!macros!ESV4er8Hy6liMOC3' @ 72057594037927935 : 1 .. '!macros!zDPgmHiwNxBWhoYz' @ 0 : 0; will stop at (end)
|
||||
2025/05/01-00:13:13.328666 7efc4f7fe6c0 Recovering log #31
|
||||
2025/05/01-00:13:13.380625 7efc4f7fe6c0 Delete type=3 #29
|
||||
2025/05/01-00:13:13.380738 7efc4f7fe6c0 Delete type=0 #31
|
||||
|
14
packs/malefices-macros/LOG.old
Normal file
14
packs/malefices-macros/LOG.old
Normal file
@ -0,0 +1,14 @@
|
||||
2024/11/29-17:51:13.287438 7f11d3fff6c0 Recovering log #28
|
||||
2024/11/29-17:51:13.297962 7f11d3fff6c0 Delete type=0 #28
|
||||
2024/11/29-17:51:13.298081 7f11d3fff6c0 Delete type=3 #27
|
||||
2024/11/29-17:51:44.237485 7f11d27fc6c0 Level-0 table #32: started
|
||||
2024/11/29-17:51:44.240689 7f11d27fc6c0 Level-0 table #32: 851 bytes OK
|
||||
2024/11/29-17:51:44.246485 7f11d27fc6c0 Delete type=0 #30
|
||||
2024/11/29-17:51:44.276713 7f11d27fc6c0 Manual compaction at level-0 from '!macros!ESV4er8Hy6liMOC3' @ 72057594037927935 : 1 .. '!macros!zDPgmHiwNxBWhoYz' @ 0 : 0; will stop at '!macros!zDPgmHiwNxBWhoYz' @ 6 : 1
|
||||
2024/11/29-17:51:44.276731 7f11d27fc6c0 Compacting 2@0 + 0@1 files
|
||||
2024/11/29-17:51:44.280157 7f11d27fc6c0 Generated table #33@0: 3 keys, 851 bytes
|
||||
2024/11/29-17:51:44.280180 7f11d27fc6c0 Compacted 2@0 + 0@1 files => 851 bytes
|
||||
2024/11/29-17:51:44.287399 7f11d27fc6c0 compacted to: files[ 0 1 0 0 0 0 0 ]
|
||||
2024/11/29-17:51:44.287547 7f11d27fc6c0 Delete type=2 #22
|
||||
2024/11/29-17:51:44.287718 7f11d27fc6c0 Delete type=2 #32
|
||||
2024/11/29-17:51:44.297154 7f11d27fc6c0 Manual compaction at level-0 from '!macros!zDPgmHiwNxBWhoYz' @ 6 : 1 .. '!macros!zDPgmHiwNxBWhoYz' @ 0 : 0; will stop at (end)
|
Binary file not shown.
BIN
packs/malefices-macros/MANIFEST-000034
Normal file
BIN
packs/malefices-macros/MANIFEST-000034
Normal file
Binary file not shown.
0
packs/malefices-macros/lost/000024.log
Normal file
0
packs/malefices-macros/lost/000024.log
Normal file
0
packs/malefices-macros/lost/000025.log
Normal file
0
packs/malefices-macros/lost/000025.log
Normal file
BIN
packs/malefices-macros/lost/MANIFEST-000023
Normal file
BIN
packs/malefices-macros/lost/MANIFEST-000023
Normal file
Binary file not shown.
Binary file not shown.
BIN
packs/malefices-tarots/000033.ldb
Normal file
BIN
packs/malefices-tarots/000033.ldb
Normal file
Binary file not shown.
BIN
packs/malefices-tarots/000035.log
Normal file
BIN
packs/malefices-tarots/000035.log
Normal file
Binary file not shown.
@ -1 +1 @@
|
||||
MANIFEST-000002
|
||||
MANIFEST-000034
|
||||
|
@ -1,5 +1,3 @@
|
||||
2023/10/24-22:56:58.978401 7f688bfff6c0 Delete type=3 #1
|
||||
2023/10/24-23:14:50.900132 7f660b7ef6c0 Level-0 table #5: started
|
||||
2023/10/24-23:14:50.904356 7f660b7ef6c0 Level-0 table #5: 3817 bytes OK
|
||||
2023/10/24-23:14:50.911636 7f660b7ef6c0 Delete type=0 #3
|
||||
2023/10/24-23:14:50.922754 7f660b7ef6c0 Manual compaction at level-0 from '!items!1DRKmbzGzbCRCswc' @ 72057594037927935 : 1 .. '!items!zbGGMEQFdwVdlKAf' @ 0 : 0; will stop at (end)
|
||||
2025/05/01-00:13:13.144691 7efc4e7fc6c0 Recovering log #31
|
||||
2025/05/01-00:13:13.196169 7efc4e7fc6c0 Delete type=3 #29
|
||||
2025/05/01-00:13:13.196332 7efc4e7fc6c0 Delete type=0 #31
|
||||
|
14
packs/malefices-tarots/LOG.old
Normal file
14
packs/malefices-tarots/LOG.old
Normal file
@ -0,0 +1,14 @@
|
||||
2024/11/29-17:51:13.246162 7f11d8ffa6c0 Recovering log #28
|
||||
2024/11/29-17:51:13.256519 7f11d8ffa6c0 Delete type=0 #28
|
||||
2024/11/29-17:51:13.256622 7f11d8ffa6c0 Delete type=3 #27
|
||||
2024/11/29-17:51:44.246559 7f11d27fc6c0 Level-0 table #32: started
|
||||
2024/11/29-17:51:44.249606 7f11d27fc6c0 Level-0 table #32: 4001 bytes OK
|
||||
2024/11/29-17:51:44.255805 7f11d27fc6c0 Delete type=0 #30
|
||||
2024/11/29-17:51:44.287848 7f11d27fc6c0 Manual compaction at level-0 from '!items!1DRKmbzGzbCRCswc' @ 72057594037927935 : 1 .. '!items!zbGGMEQFdwVdlKAf' @ 0 : 0; will stop at '!items!zbGGMEQFdwVdlKAf' @ 44 : 1
|
||||
2024/11/29-17:51:44.287866 7f11d27fc6c0 Compacting 2@0 + 0@1 files
|
||||
2024/11/29-17:51:44.291002 7f11d27fc6c0 Generated table #33@0: 22 keys, 4001 bytes
|
||||
2024/11/29-17:51:44.291025 7f11d27fc6c0 Compacted 2@0 + 0@1 files => 4001 bytes
|
||||
2024/11/29-17:51:44.296891 7f11d27fc6c0 compacted to: files[ 0 1 0 0 0 0 0 ]
|
||||
2024/11/29-17:51:44.296997 7f11d27fc6c0 Delete type=2 #22
|
||||
2024/11/29-17:51:44.297082 7f11d27fc6c0 Delete type=2 #32
|
||||
2024/11/29-17:51:44.297163 7f11d27fc6c0 Manual compaction at level-0 from '!items!zbGGMEQFdwVdlKAf' @ 44 : 1 .. '!items!zbGGMEQFdwVdlKAf' @ 0 : 0; will stop at (end)
|
Binary file not shown.
BIN
packs/malefices-tarots/MANIFEST-000034
Normal file
BIN
packs/malefices-tarots/MANIFEST-000034
Normal file
Binary file not shown.
0
packs/malefices-tarots/lost/000024.log
Normal file
0
packs/malefices-tarots/lost/000024.log
Normal file
0
packs/malefices-tarots/lost/000025.log
Normal file
0
packs/malefices-tarots/lost/000025.log
Normal file
BIN
packs/malefices-tarots/lost/MANIFEST-000023
Normal file
BIN
packs/malefices-tarots/lost/MANIFEST-000023
Normal file
Binary file not shown.
@ -27,7 +27,7 @@
|
||||
--actor-label-font-weight: 700;
|
||||
--actor-label-color: #464331c4;
|
||||
|
||||
/* =================== 2. DEBUGGING HIGHLIGHTERS ============ */
|
||||
/* =================== 2. DEBUGGING HIGHLIGHTERS ============ */
|
||||
--debug-background-color-red: #ff000054;
|
||||
--debug-background-color-blue: #1d00ff54;
|
||||
--debug-background-color-green: #54ff0054;
|
||||
@ -58,7 +58,7 @@ font-size: 0.8rem;
|
||||
|
||||
.window-header{
|
||||
background: rgba(0,0,0,0.75);
|
||||
}
|
||||
}
|
||||
|
||||
.window-app.sheet .window-content {
|
||||
margin: 0;
|
||||
@ -465,7 +465,7 @@ section.sheet-body{padding: 0.25rem 0.5rem;}
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.malefices-actor-sheet nav.sheet-tabs {
|
||||
nav.sheet-tabs {
|
||||
font-size: 1.2rem;
|
||||
font-weight: bold;
|
||||
height: 3rem;
|
||||
@ -481,11 +481,23 @@ section.sheet-body{padding: 0.25rem 0.5rem;}
|
||||
color:beige;
|
||||
}
|
||||
|
||||
/* background: rgb(245,245,240) url("../images/ui/fond4.webp") repeat left top;*/
|
||||
/* Dice tray specific overrides */
|
||||
.dice-tray button svg * {
|
||||
fill: #6d5923 !important;
|
||||
}
|
||||
.dice-tray input[type="text"] {
|
||||
color: #6d5923 !important;
|
||||
}
|
||||
.dice-tray button {
|
||||
color: #6d5923 !important;
|
||||
}
|
||||
|
||||
nav.sheet-tabs .item {
|
||||
position: relative;
|
||||
padding: 0 0.25rem;
|
||||
color:beige;
|
||||
margin-top: 4px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
nav.sheet-tabs .item:after {
|
||||
@ -726,7 +738,7 @@ ul, li {
|
||||
|
||||
/* ======================================== */
|
||||
.tokenhudext {
|
||||
display: flex;
|
||||
display: flex;
|
||||
flex: 0 !important;
|
||||
font-weight: 600;
|
||||
}
|
||||
@ -782,7 +794,7 @@ ul, li {
|
||||
.skill-label {
|
||||
font-size: 0.7rem;
|
||||
}
|
||||
.skill-good-checkbox {
|
||||
.skill-good-checkbox {
|
||||
max-height: 10px;
|
||||
max-width: 10px;
|
||||
}
|
||||
@ -820,7 +832,7 @@ ul, li {
|
||||
.sidebar-tab .directory-list .entity {
|
||||
border-top: 1px dashed rgba(0,0,0,0.25);
|
||||
border-bottom: 0 none;
|
||||
padding: 0.25rem 0;
|
||||
padding: 0.25rem 0;
|
||||
}
|
||||
|
||||
.sidebar-tab .directory-list .entity:hover {
|
||||
@ -834,10 +846,10 @@ ul, li {
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.chat-message .message-header .flavor-text, .chat-message .message-header .whisper-to {
|
||||
.chat-message .message-header .flavor-text, .chat-message .message-header .whisper-to {
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
.chat-result-text,
|
||||
@ -1005,7 +1017,7 @@ ul, li {
|
||||
border-radius: 0px;
|
||||
}
|
||||
|
||||
#hotbar .bar-controls {
|
||||
#hotbar .bar-controls {
|
||||
background: rgba(30, 25, 20, 1);
|
||||
border: 1px solid rgba(72, 46, 28, 1);
|
||||
}
|
||||
@ -1065,7 +1077,7 @@ ul, li {
|
||||
top: 1px;
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
|
||||
|
||||
/* Fade in tooltip */
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
@ -1171,7 +1183,7 @@ ul, li {
|
||||
height: 60px;
|
||||
}
|
||||
|
||||
.dice-cell {
|
||||
.dice-cell {
|
||||
padding-left: 12px;
|
||||
padding-right: 12px;
|
||||
width: 60px;
|
||||
@ -1297,7 +1309,7 @@ ul, li {
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
.item-filler {
|
||||
flex-grow: 6;
|
||||
flex-grow: 6;
|
||||
flex-shrink: 7;
|
||||
}
|
||||
.item-controls-fixed {
|
||||
@ -1308,7 +1320,7 @@ ul, li {
|
||||
font-weight: bold;
|
||||
}
|
||||
.flexrow-no-expand {
|
||||
flex-grow: 0;
|
||||
flex-grow: 0;
|
||||
}
|
||||
.item-input-small {
|
||||
max-width: 16px;
|
||||
|
51
system.json
51
system.json
@ -3,8 +3,10 @@
|
||||
"esmodules": [
|
||||
"modules/malefices-main.js"
|
||||
],
|
||||
"gridDistance": 1,
|
||||
"gridUnits": "u",
|
||||
"grid": {
|
||||
"distance": 2,
|
||||
"units": "m"
|
||||
},
|
||||
"languages": [
|
||||
{
|
||||
"lang": "fr",
|
||||
@ -24,45 +26,56 @@
|
||||
"type": "Item",
|
||||
"label": "Tarots",
|
||||
"name": "malefices-tarots",
|
||||
"path": "packs/malefices-tarots.db",
|
||||
"path": "packs/malefices-tarots",
|
||||
"system": "fvtt-malefices",
|
||||
"private": false,
|
||||
"flags": {}
|
||||
"flags": {},
|
||||
"ownership": {
|
||||
"PLAYER": "OBSERVER",
|
||||
"ASSISTANT": "OWNER"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Item",
|
||||
"label": "Armes",
|
||||
"name": "malefices-armes",
|
||||
"path": "packs/malefices-armes.db",
|
||||
"path": "packs/malefices-armes",
|
||||
"system": "fvtt-malefices",
|
||||
"private": false,
|
||||
"flags": {}
|
||||
"flags": {},
|
||||
"ownership": {
|
||||
"PLAYER": "OBSERVER",
|
||||
"ASSISTANT": "OWNER"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Item",
|
||||
"label": "Archetypes",
|
||||
"name": "malefices-archetypes",
|
||||
"path": "packs/malefices-archetypes.db",
|
||||
"path": "packs/malefices-archetypes",
|
||||
"system": "fvtt-malefices",
|
||||
"private": false,
|
||||
"flags": {}
|
||||
"flags": {},
|
||||
"ownership": {
|
||||
"PLAYER": "OBSERVER",
|
||||
"ASSISTANT": "OWNER"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Macro",
|
||||
"label": "Macros",
|
||||
"name": "malefices-macros",
|
||||
"path": "packs/malefices-macros.db",
|
||||
"path": "packs/malefices-macros",
|
||||
"system": "fvtt-malefices",
|
||||
"private": false,
|
||||
"flags": {}
|
||||
"flags": {},
|
||||
"ownership": {
|
||||
"PLAYER": "OBSERVER",
|
||||
"ASSISTANT": "OWNER"
|
||||
}
|
||||
}
|
||||
],
|
||||
"license": "LICENSE.txt",
|
||||
"manifest": "https://www.uberwald.me/gitea/public/fvtt-malefices/raw/branch/master/system.json",
|
||||
"compatibility": {
|
||||
"minimum": "10",
|
||||
"verified": "11",
|
||||
"maximum": "11"
|
||||
"minimum": "13",
|
||||
"verified": "13"
|
||||
},
|
||||
"id": "fvtt-malefices",
|
||||
"primaryTokenAttribute": "secondary.health",
|
||||
@ -73,7 +86,7 @@
|
||||
],
|
||||
"title": "Maléfices, le Jeu de Rôle",
|
||||
"url": "https://www.uberwald.me/gitea/public/fvtt-malefices",
|
||||
"version": "11.0.1",
|
||||
"download": "https://www.uberwald.me/gitea/public/fvtt-malefices/archive/fvtt-malefices-v11.0.1.zip",
|
||||
"version": "13.0.0",
|
||||
"download": "https://www.uberwald.me/gitea/public/fvtt-malefices/archive/fvtt-malefices-v13.0.0.zip",
|
||||
"background": "systems/fvtt-malefices/images/ui/malefice_welcome_page.webp"
|
||||
}
|
@ -8,7 +8,7 @@
|
||||
<div class="profile-img-container">
|
||||
<img class="profile-img" src="{{img}}" data-edit="img" title="{{name}}" />
|
||||
</div>
|
||||
|
||||
|
||||
<div class="flexcol">
|
||||
<h1 class="charname margin-right"><input name="name" type="text" value="{{name}}" placeholder="Name" /></h1>
|
||||
|
||||
@ -45,7 +45,7 @@
|
||||
|
||||
{{!-- Skills Tab --}}
|
||||
<div class="tab main" data-group="primary" data-tab="main">
|
||||
|
||||
|
||||
|
||||
<div class="grid grid-2col">
|
||||
<div>
|
||||
@ -68,12 +68,12 @@
|
||||
<input type="text" class="item-field-label-short" name="system.attributs.{{key}}.value" value="{{attr.value}}" data-dtype="Number"/>
|
||||
{{#if attr.hasmax}}
|
||||
<input type="text" class="item-field-label-short" name="system.attributs.{{key}}.max" value="{{attr.max}}" data-dtype="Number"/>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{#if (eq key "physique")}}
|
||||
{{#if @root.phyMalus}}
|
||||
({{@root.phyMalus}})
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</li>
|
||||
{{/each}}
|
||||
|
||||
@ -81,7 +81,7 @@
|
||||
<span class="item-field-label-long">Points de Destin</span>
|
||||
<input type="text" class="item-field-label-short" name="system.pointdestin" value="{{system.pointdestin}}" data-dtype="Number"/>
|
||||
</li>
|
||||
|
||||
|
||||
{{#if isGM}}
|
||||
<li class="item flexrow list-item">
|
||||
<span class="item-field-label-long">Fluide (MJ)</span>
|
||||
@ -171,7 +171,7 @@
|
||||
<label class="item-field-label-medium">Critique</label>
|
||||
</span>
|
||||
<div class="item-controls item-controls-fixed">
|
||||
<a class="item-control item-add" data-type="weapon" title="Create Item"><i class="fas fa-plus"></i></a>
|
||||
<a class="item-control item-add" data-type="arme" title="Créer une arme"><i class="fas fa-plus"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{#each armes as |arme key|}}
|
||||
@ -201,7 +201,7 @@
|
||||
</span>
|
||||
<div class="item-filler"> </div>
|
||||
<div class="item-controls item-controls-fixed">
|
||||
<a class="item-control item-add" data-type="equipment" title="Create Item"><i class="fas fa-plus"></i></a>
|
||||
<a class="item-control item-add" data-type="equipement" title="Créer un équipement"><i class="fas fa-plus"></i></a>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
@ -229,7 +229,7 @@
|
||||
</span>
|
||||
<div class="item-filler"> </div>
|
||||
<div class="item-controls item-controls-fixed">
|
||||
<a class="item-control item-add" data-type="equipment" title="Create Item"><i class="fas fa-plus"></i></a>
|
||||
<a class="item-control item-add" data-type="sortilege" title="Créer un Sortilège"><i class="fas fa-plus"></i></a>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
@ -320,7 +320,7 @@
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<ul>
|
||||
<li class="item flexrow">
|
||||
<label class="generic-label">Position vis-à-vis du fantastique</label>
|
||||
@ -339,7 +339,7 @@
|
||||
<label class="item-field-label-medium">Sens</label>
|
||||
</span>
|
||||
<div class="item-controls item-controls-fixed">
|
||||
<a class="item-control item-add" data-type="tarot" title="Create Item"><i class="fas fa-plus"></i></a>
|
||||
<a class="item-control item-add" data-type="tarot" title="Créer une lame de tarot"><i class="fas fa-plus"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{#each tarots as |tarot key|}}
|
||||
@ -368,7 +368,7 @@
|
||||
<label class="item-field-label-medium">Sens</label>
|
||||
</span>
|
||||
<div class="item-controls item-controls-fixed">
|
||||
<a class="item-control item-add" data-type="tarot" title="Create Item"><i class="fas fa-plus"></i></a>
|
||||
<a class="item-control item-add" data-type="tarot" title="Créer une lame de Tarot (secret)"><i class="fas fa-plus"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{#each tarotsCache as |tarot key|}}
|
||||
|
@ -28,7 +28,7 @@
|
||||
{{#if isSuccess}}
|
||||
<li><label class="chat-result-text chat-result-success ">Réussite !</label> Votre {{attr.label}} augmente de {{gainAttr}} points.</li>
|
||||
{{else}}
|
||||
<li><label class="chat-result-text chat-result-success ">Echec !</label> Votre {{attr.label}} diminue de {{gainAttr}} points.</li>
|
||||
<li><label class="chat-result-text chat-result-failure ">Echec !</label> Votre {{attr.label}} diminue de {{gainAttr}} points.</li>
|
||||
{{/if}}
|
||||
|
||||
</ul>
|
||||
|
@ -18,25 +18,14 @@
|
||||
<div class="flexrow">
|
||||
<span class="roll-dialog-label">Degré de la confrontation : </span>
|
||||
<select id="confrontationDegre" name="confrontationDegre">
|
||||
{{#select confrontationDegre}}
|
||||
<option value="0">0</option>
|
||||
<option value="1">1</option>
|
||||
<option value="2">2</option>
|
||||
<option value="3">3</option>
|
||||
<option value="4">4</option>
|
||||
<option value="5">5</option>
|
||||
{{/select}}
|
||||
{{selectOptions config.confrontationDegreOptions selected=confrontationDegre}}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="flexrow">
|
||||
<span class="roll-dialog-label">Modificateur de confrontation : </span>
|
||||
<select id="confrontationModif" name="confrontationModif">
|
||||
{{#select confrontationModif}}
|
||||
<option value="-1">-1</option>
|
||||
<option value="0">0</option>
|
||||
<option value="1">+1</option>
|
||||
{{/select}}
|
||||
{{selectOptions config.confrontationModifOptions selected=confrontationModif}}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
</header>
|
||||
|
||||
<div class="flexcol">
|
||||
|
||||
|
||||
{{#if attr}}
|
||||
<div class="flexrow">
|
||||
<span class="roll-dialog-label">{{attr.label}} : </span>
|
||||
@ -17,11 +17,11 @@
|
||||
{{#if phyMalus}}
|
||||
({{phyMalus}})
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
|
||||
<div class="flexcol">
|
||||
<span class="roll-dialog-label">Rappel des élements biographiques : </span>
|
||||
<ul class="ul-level1 item-list alternate-list">
|
||||
@ -36,55 +36,30 @@
|
||||
<div class="flexrow">
|
||||
<span class="roll-dialog-label">Bonus/Malus biographique : </span>
|
||||
<select id="bonusMalusPerso" name="bonusMalusPerso">
|
||||
{{#select bonusMalusPerso}}
|
||||
<option value="-3">-3</option>
|
||||
<option value="-2">-2</option>
|
||||
<option value="-1">-1</option>
|
||||
<option value="0">0</option>
|
||||
<option value="1">+1</option>
|
||||
<option value="2">+2</option>
|
||||
<option value="3">+3</option>
|
||||
{{/select}}
|
||||
</select>
|
||||
{{selectOptions config.bonusMalusPersoOptions selected=bonusMalusPerso valueAttr="value" labelAttr="label"}}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="flexrow">
|
||||
<span class="roll-dialog-label">Bonus/Malus de situation : </span>
|
||||
<select id="bonusMalusSituation" name="bonusMalusSituation">
|
||||
{{#select bonusMalusSituation}}
|
||||
<option value="-3">-3</option>
|
||||
<option value="-2">-2</option>
|
||||
<option value="-1">-1</option>
|
||||
<option value="0">0</option>
|
||||
<option value="1">+1</option>
|
||||
<option value="2">+2</option>
|
||||
<option value="3">+3</option>
|
||||
{{/select}}
|
||||
</select>
|
||||
{{selectOptions config.bonusMalusPersoOptions selected=bonusMalusSituation valueAttr="value" labelAttr="label"}}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
{{#if arme}}
|
||||
<div class="flexrow">
|
||||
<span class="roll-dialog-label">Défense : </span>
|
||||
<select id="bonusMalusDef" name="bonusMalusDef">
|
||||
{{#select bonusMalusDef}}
|
||||
<option value="-3">-6 (réussite critique)</option>
|
||||
<option value="-3">-3 (réussite)</option>
|
||||
<option value="0">0 (echec ou pas d'esquive)</option>
|
||||
<option value="3">+3 (echec critique)</option>
|
||||
{{/select}}
|
||||
</select>
|
||||
{{selectOptions config.bonusMalusDefOptions selected=bonusMalusDef valueAttr="value" labelAttr="label"}}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="flexrow">
|
||||
<span class="roll-dialog-label">Portée : </span>
|
||||
<select id="bonusMalusPortee" name="bonusMalusPortee">
|
||||
{{#select bonusMalusPortee}}
|
||||
<option value="1">+1 (Portée courte)</option>
|
||||
<option value="0">0 (Portée moyenne)</option>
|
||||
<option value="-1">-1 (Portée longue)</option>
|
||||
{{/select}}
|
||||
</select>
|
||||
{{selectOptions config.bonusMalusPorteeOptions selected=bonusMalusPortee valueAttr="value" labelAttr="label"}}
|
||||
</select>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
|
@ -20,12 +20,8 @@
|
||||
<ul>
|
||||
<li class="flexrow">
|
||||
<label class="item-field-label-long">Lame tutélaire</label>
|
||||
<select class="item-field-label-long" type="text" name="system.lametutelaire" value="{{system.lametutelaire}}" data-dtype="String">
|
||||
{{#select system.lametutelaire}}
|
||||
{{#each tarots as |carte key| }}
|
||||
<option value="{{carte._id}}">{{carte.name}}</option>
|
||||
{{/each}}
|
||||
{{/select}}
|
||||
<select class="item-field-label-long" type="text" name="system.lametutelaire" data-dtype="String">
|
||||
{{selectOptions tarots selected=system.lametutelaire nameAttr="_id" labelAttr="name"}}
|
||||
</select>
|
||||
</li>
|
||||
|
||||
|
@ -22,11 +22,7 @@
|
||||
<li class="flexrow">
|
||||
<label class="item-field-label-long">Type d'arme</label>
|
||||
<select class="item-field-label-long" type="text" name="system.armetype" value="{{system.armetype}}" data-dtype="String">
|
||||
{{#select system.armetype}}
|
||||
{{#each config.armeTypes as |type key| }}
|
||||
<option value="{{key}}">{{type}}</option>
|
||||
{{/each}}
|
||||
{{/select}}
|
||||
{{selectOptions config.armeTypes selected=system.armetype}}
|
||||
</select>
|
||||
</li>
|
||||
|
||||
|
@ -26,11 +26,7 @@
|
||||
<li class="flexrow">
|
||||
<label class="item-field-label-long">Type </label>
|
||||
<select class="item-field-label-long" type="text" name="system.tarottype" value="{{system.tarottype}}" data-dtype="String">
|
||||
{{#select system.tarottype}}
|
||||
{{#each config.tarotType as |type key| }}
|
||||
<option value="{{key}}">{{type}}</option>
|
||||
{{/each}}
|
||||
{{/select}}
|
||||
{{selectOptions config.tarotType selected=system.tarottype}}
|
||||
</select>
|
||||
</li>
|
||||
|
||||
|
Reference in New Issue
Block a user