Ajout/rework

This commit is contained in:
LeRatierBretonnien 2023-04-28 09:39:18 +02:00
parent ec4223085c
commit b9978545d2
13 changed files with 66 additions and 558 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -35,15 +35,10 @@ export class EcrymeActorSheet extends ActorSheet {
cssClass: this.isEditable ? "editable" : "locked", cssClass: this.isEditable ? "editable" : "locked",
system: duplicate(this.object.system), system: duplicate(this.object.system),
limited: this.object.limited, limited: this.object.limited,
armes: duplicate(this.actor.getArmes()), weapons: duplicate(this.actor.getWeapons()),
tarots: duplicate(this.actor.getTarots()),
tarotsCache: duplicate(this.actor.getHiddenTarots()),
archetype: duplicate(this.actor.getArchetype()), archetype: duplicate(this.actor.getArchetype()),
equipements: duplicate(this.actor.getEquipements()), equipements: duplicate(this.actor.getEquipements()),
subActors: duplicate(this.actor.getSubActors()), subActors: duplicate(this.actor.getSubActors()),
phyMalus: this.actor.getPhysiqueMalus(),
elementsbio: this.actor.getElementsBio(),
sorts: this.actor.getSorts(),
description: await TextEditor.enrichHTML(this.object.system.description, { async: true }), description: await TextEditor.enrichHTML(this.object.system.description, { async: true }),
notes: await TextEditor.enrichHTML(this.object.system.notes, { async: true }), notes: await TextEditor.enrichHTML(this.object.system.notes, { async: true }),
equipementlibre: await TextEditor.enrichHTML(this.object.system.equipementlibre, { async: true }), equipementlibre: await TextEditor.enrichHTML(this.object.system.equipementlibre, { async: true }),
@ -109,20 +104,11 @@ export class EcrymeActorSheet extends ActorSheet {
this.actor.incDecQuantity( li.data("item-id"), +1 ); this.actor.incDecQuantity( li.data("item-id"), +1 );
} ); } );
html.find('.ammo-minus').click(event => { html.find('.roll-skill').click((event) => {
const li = $(event.currentTarget).parents(".item")
this.actor.incDecAmmo( li.data("item-id"), -1 );
} );
html.find('.ammo-plus').click(event => {
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") let attrKey = $(event.currentTarget).data("attr-key")
this.actor.rollAttribut(attrKey) this.actor.rollAttribut(attrKey)
}); });
html.find('.roll-arme').click((event) => { html.find('.roll-weapon').click((event) => {
const armeId = $(event.currentTarget).data("arme-id") const armeId = $(event.currentTarget).data("arme-id")
this.actor.rollArme(armeId) this.actor.rollArme(armeId)
}); });
@ -131,17 +117,11 @@ export class EcrymeActorSheet extends ActorSheet {
this.options.editScore = !this.options.editScore; this.options.editScore = !this.options.editScore;
this.render(true); 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 => { html.find('.item-equip').click(ev => {
const li = $(ev.currentTarget).parents(".item"); const li = $(ev.currentTarget).parents(".item");
this.actor.equipItem( li.data("item-id") ); this.actor.equipItem( li.data("item-id") );
this.render(true); this.render(true);
}); });
html.find('.update-field').change(ev => { html.find('.update-field').change(ev => {
const fieldName = $(ev.currentTarget).data("field-name"); const fieldName = $(ev.currentTarget).data("field-name");
let value = Number(ev.currentTarget.value); let value = Number(ev.currentTarget.value);

View File

@ -75,22 +75,12 @@ export class EcrymeActor extends Actor {
super._preUpdate(changed, options, user); super._preUpdate(changed, options, user);
} }
/*_onUpdateEmbeddedDocuments( embeddedName, ...args ) {
this.rebuildSkills()
super._onUpdateEmbeddedDocuments(embeddedName, ...args)
}*/
/* -------------------------------------------- */ /* -------------------------------------------- */
getMoneys() { getMoneys() {
let comp = this.items.filter(item => item.type == 'money'); let comp = this.items.filter(item => item.type == 'money');
EcrymeUtility.sortArrayObjectsByName(comp) EcrymeUtility.sortArrayObjectsByName(comp)
return comp; return comp;
} }
getSorts() {
let comp = this.items.filter(item => item.type == 'sortilege');
EcrymeUtility.sortArrayObjectsByName(comp)
return comp;
}
getArchetype() { getArchetype() {
let comp = duplicate(this.items.find(item => item.type == 'archetype') || {name: "Pas d'archetype"}) let comp = duplicate(this.items.find(item => item.type == 'archetype') || {name: "Pas d'archetype"})
if (comp && comp.system) { if (comp && comp.system) {
@ -100,26 +90,8 @@ export class EcrymeActor extends Actor {
return comp; return comp;
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
getElementsBio() { getWeapons() {
let comp = duplicate(this.items.filter(item => item.type == 'elementbio') || []) let comp = duplicate(this.items.filter(item => item.type == 'weapon') || [])
EcrymeUtility.sortArrayObjectsByName(comp)
return comp;
}
/* -------------------------------------------- */
getTarots() {
let comp = duplicate(this.items.filter(item => item.type == 'tarot' && !item.system.isgm) || [])
EcrymeUtility.sortArrayObjectsByName(comp)
return comp;
}
/* -------------------------------------------- */
getHiddenTarots() {
let comp = duplicate(this.items.filter(item => item.type == 'tarot' && item.system.isgm) || [])
EcrymeUtility.sortArrayObjectsByName(comp)
return comp;
}
/* -------------------------------------------- */
getArmes() {
let comp = duplicate(this.items.filter(item => item.type == 'arme') || [])
EcrymeUtility.sortArrayObjectsByName(comp) EcrymeUtility.sortArrayObjectsByName(comp)
return comp; return comp;
} }
@ -155,17 +127,6 @@ export class EcrymeActor extends Actor {
} }
} }
/* -------------------------------------------- */
compareName(a, b) {
if (a.name < b.name) {
return -1;
}
if (a.name > b.name) {
return 1;
}
return 0;
}
/* ------------------------------------------- */ /* ------------------------------------------- */
getEquipements() { getEquipements() {
return this.items.filter(item => item.type == 'equipement') return this.items.filter(item => item.type == 'equipement')
@ -272,29 +233,7 @@ export class EcrymeActor extends Actor {
await this.createEmbeddedDocuments('Item', [newItem]); await this.createEmbeddedDocuments('Item', [newItem]);
} }
} }
/* -------------------------------------------- */
incDecFluide(value) {
let fluide = this.system.fluide + value
this.update( {'system.fluide': fluide} )
}
incDecDestin(value) {
let destin = this.system.pointdestin + value
this.update( {'system.pointdestin': destin} )
}
incDecMPMB(value) {
let mpmb = this.system.mpmb + value
this.update( {'system.mpmb': mpmb} )
}
incDecMPMN(value) {
let mpmn = this.system.mpmn + value
this.update( {'system.mpmn': mpmn} )
}
/* -------------------------------------------- */
incDecAttr(attrKey, value) {
let attr = duplicate(this.system.attributs[attrKey])
attr.value += value
this.update( { [`system.attributs.${attrKey}`]: attr})
}
/* -------------------------------------------- */ /* -------------------------------------------- */
async incDecQuantity(objetId, incDec = 0) { async incDecQuantity(objetId, incDec = 0) {
let objetQ = this.items.get(objetId) let objetQ = this.items.get(objetId)
@ -305,81 +244,48 @@ export class EcrymeActor extends Actor {
} }
} }
} }
/* -------------------------------------------- */
async incDecAmmo(objetId, incDec = 0) {
let objetQ = this.items.get(objetId)
if (objetQ) {
let newQ = objetQ.system.ammocurrent + incDec;
if (newQ >= 0 && newQ <= objetQ.system.ammomax) {
const updated = await this.updateEmbeddedDocuments('Item', [{ _id: objetQ.id, 'system.ammocurrent': newQ }]); // pdates one EmbeddedEntity
}
}
}
/* -------------------------------------------- */
getAtttributImage( attrKey) {
return `systems/fvtt-ecryme/images/icons/${attrKey}.webp`
}
/* -------------------------------------------- */
incDecDestin( value) {
let newValue = Math.max( this.system.pointdestin + value, 0)
this.update( {'system.pointdestin': newValue})
}
/* -------------------------------------------- */ /* -------------------------------------------- */
getCommonRollData() { getCommonRollData() {
let rollData = EcrymeUtility.getBasicRollData() let rollData = EcrymeUtility.getBasicRollData()
rollData.alias = this.name rollData.alias = this.name
rollData.actorImg = this.img rollData.actorImg = this.img
rollData.actorId = this.id rollData.actorId = this.id
rollData.img = this.img rollData.img = this.img
rollData.phyMalus = this.getPhysiqueMalus()
rollData.elementsbio = this.getElementsBio()
rollData.destin = this.system.pointdestin
rollData.isReroll = false rollData.isReroll = false
rollData.confrontationDegre = 0
rollData.confrontationModif = 0
console.log("ROLLDATA", rollData) console.log("ROLLDATA", rollData)
return rollData return rollData
} }
/* -------------------------------------------- */
getPhysiqueMalus() {
if ( this.system.attributs.constitution.value <= 8) {
return -(9 - this.system.attributs.constitution.value)
}
return 0
}
/* -------------------------------------------- */ /* -------------------------------------------- */
rollAttribut(attrKey) { rollSkill(attrKey, skillKey) {
let attr = this.system.attributs[attrKey] let skill = this.system.skills[attrKey].skilllist[skillKey]
let rollData = this.getCommonRollData() let rollData = this.getCommonRollData()
rollData.attr = duplicate(attr) rollData.skill = duplicate(skill)
rollData.mode = "attribut" rollData.mode = "skill"
rollData.title = attr.label rollData.title = game.i18n.localize(skill.name)
rollData.img = this.getAtttributImage(attrKey) rollData.img = skill.img
this.startRoll(rollData) this.startRoll(rollData)
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
rollArme(weaponId) { rollWeapon(weaponId) {
let arme = this.items.get(weaponId) let weapon = this.items.get(weaponId)
if (arme) { if (weapon) {
arme = duplicate(arme) weapon = duplicate(weapon)
let rollData = this.getCommonRollData() let rollData = this.getCommonRollData()
if (arme.system.armetype == "mainsnues" || arme.system.armetype == "epee") { if (weapon.system.armetype == "mainsnues" || weapon.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) } rollData.attr = { label: "(Physique+Habilité)/2", value: Math.floor( (this.getPhysiqueMalus()+this.system.attributs.physique.value+this.system.attributs.habilite.value) / 2) }
} else { } else {
rollData.attr = duplicate(this.system.attributs.habilite) rollData.attr = duplicate(this.system.attributs.habilite)
} }
rollData.mode = "arme" rollData.mode = "weapon"
rollData.arme = arme rollData.weapon = weapon
rollData.img = arme.img rollData.img = weapon.img
rollData.title = arme.name rollData.title = weapon.name
this.startRoll(rollData) this.startRoll(rollData)
} else { } else {
ui.notifications.warn("Impossible de trouver l'arme concernée ") ui.notifications.warn("Impossible de trouver l'arme concernée ")

View File

@ -1,207 +0,0 @@
/**
* Extend the basic ActorSheet with some very simple modifications
* @extends {ActorSheet}
*/
import { EcrymeUtility } from "./common/ecryme-utility.js";
/* -------------------------------------------- */
export class EcrymeNPCSheet extends ActorSheet {
/** @override */
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
classes: ["Ecryme", "sheet", "actor"],
template: "systems/fvtt-ecryme/templates/npc-sheet.html",
width: 640,
height: 720,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "stats" }],
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
editScore: true
});
}
/* -------------------------------------------- */
async getData() {
const objectData = this.object.system
let actorData = duplicate(objectData)
let formData = {
title: this.title,
id: this.actor.id,
type: this.actor.type,
img: this.actor.img,
name: this.actor.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
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()) ),
equippedArmor: this.actor.getEquippedArmor(),
equippedShield: this.actor.getEquippedShield(),
subActors: duplicate(this.actor.getSubActors()),
moneys: duplicate(this.actor.getMoneys()),
encCapacity: this.actor.getEncumbranceCapacity(),
saveRolls: this.actor.getSaveRoll(),
conditions: this.actor.getConditions(),
containersTree: this.actor.containersTree,
encCurrent: this.actor.encCurrent,
options: this.options,
owner: this.document.isOwner,
editScore: this.options.editScore,
isGM: game.user.isGM
}
this.formData = formData;
console.log("PC : ", formData, this.object);
return formData;
}
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
super.activateListeners(html);
// 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 => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
const item = this.actor.items.get( itemId );
item.sheet.render(true);
});
// Delete Inventory Item
html.find('.item-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item")
EcrymeUtility.confirmDelete(this, li)
})
html.find('.item-add').click(ev => {
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");
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");
this.actor.delSubActor(actorId);
});
html.find('.quantity-minus').click(event => {
const li = $(event.currentTarget).parents(".item");
this.actor.incDecQuantity( li.data("item-id"), -1 );
} );
html.find('.quantity-plus').click(event => {
const li = $(event.currentTarget).parents(".item");
this.actor.incDecQuantity( li.data("item-id"), +1 );
} );
html.find('.ammo-minus').click(event => {
const li = $(event.currentTarget).parents(".item")
this.actor.incDecAmmo( li.data("item-id"), -1 );
} );
html.find('.ammo-plus').click(event => {
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);
});
html.find('.roll-skill').click((event) => {
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");
const skillId = li.data("item-id")
this.actor.rollWeapon(skillId)
});
html.find('.roll-armor-die').click((event) => {
this.actor.rollArmorDie()
});
html.find('.roll-shield-die').click((event) => {
this.actor.rollShieldDie()
});
html.find('.roll-target-die').click((event) => {
this.actor.rollDefenseRanged()
});
html.find('.roll-save').click((event) => {
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);
});
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 = {}) {
const position = super.setPosition(options);
const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192;
sheetBody.css("height", bodyHeight);
return position;
}
/* -------------------------------------------- */
/** @override */
_updateObject(event, formData) {
// Update the Actor
return this.object.update(formData);
}
}

View File

@ -9,8 +9,6 @@ export class EcrymeCommands {
static init() { static init() {
if (!game.system.ecryme.commands) { if (!game.system.ecryme.commands) {
const commands = new EcrymeCommands(); const commands = new EcrymeCommands();
commands.registerCommand({ path: ["/tirage"], func: (content, msg, params) => EcrymeCommands.createTirage(msg), descr: "Tirage des tarots" });
commands.registerCommand({ path: ["/carte"], func: (content, msg, params) => EcrymeCommands.tirerCarte(msg), descr: "Tirer une carte" });
commands.registerCommand({ path: ["/resume"], func: (content, msg, params) => EcrymeCharacterSummary.displayPCSummary(), descr: "Affiche la liste des PJs!" }); commands.registerCommand({ path: ["/resume"], func: (content, msg, params) => EcrymeCharacterSummary.displayPCSummary(), descr: "Affiche la liste des PJs!" });
game.system.ecryme.commands = commands; game.system.ecryme.commands = commands;
} }
@ -104,42 +102,4 @@ export class EcrymeCommands {
ChatMessage.create(msg); ChatMessage.create(msg);
} }
/* --------------------------------------------- */
static async createTirage(msg) {
if (game.user.isGM) {
let tirageData = {
state: 'select-player',
nbCard: 0,
maxPlayerCard: 4,
maxSecretCard: 1,
cards: [],
players: duplicate(game.users),
secretCards: [],
deck: EcrymeUtility.getTarots()
}
for (let i = 0; i < 4; i++) {
tirageData.cards.push({ name: "???", img: "systems/fvtt-ecryme/images/tarots/background.webp" })
}
tirageData.secretCards.push({ name: "???", img: "systems/fvtt-ecryme/images/tarots/background.webp" })
let tirageDialog = await EcrymeTirageTarotDialog.create(this, tirageData)
tirageDialog.render(true)
}
}
/* --------------------------------------------- */
static async tirerCarte(msg) {
let deck = EcrymeUtility.getTarots()
let index = Math.round(Math.random() * (deck.length-1))
let selectedCard = deck[index]
selectedCard.system.ispositif = true
if ( selectedCard.system.isdualside) { // Cas des cartes pouvant avoir 2 sens
selectedCard.system.ispositif = (Math.random() > 0.5)
}
selectedCard.system.isgm = false
selectedCard.value = (selectedCard.system.ispositif)? selectedCard.system.numericvalueup : selectedCard.system.numericvaluedown
EcrymeUtility.createChatMessage(game.user.name, "", {
content: await renderTemplate(`systems/fvtt-ecryme/templates/chat/display-tarot-card.hbs`, selectedCard)
})
}
} }

View File

@ -14,7 +14,7 @@ export class EcrymeHotbar {
if (documentData.type == "Item") { if (documentData.type == "Item") {
console.log("Drop done !!!", bar, documentData, slot) console.log("Drop done !!!", bar, documentData, slot)
let item = documentData.data let item = documentData.data
let command = `game.system.Ecryme.EcrymeHotbar.rollMacro("${item.name}", "${item.type}");` let command = `game.system.ecryme.EcrymeHotbar.rollMacro("${item.name}", "${item.type}");`
let macro = game.macros.contents.find(m => (m.name === item.name) && (m.command === command)) let macro = game.macros.contents.find(m => (m.name === item.name) && (m.command === command))
if (!macro) { if (!macro) {
macro = await Macro.create({ macro = await Macro.create({

View File

@ -9,7 +9,7 @@ export class EcrymeCharacterSummary extends Application {
if (game.user.isGM) { if (game.user.isGM) {
game.system.ecryme.charSummary.render(true) game.system.ecryme.charSummary.render(true)
} else { } else {
ui.notifications.info("Commande /tirage réservée au MJ !") ui.notifications.info("Commande /summary réservée au MJ !")
} }
} }

View File

@ -44,17 +44,6 @@ export class EcrymeUtility {
return parseInt(a) + parseInt(b); return parseInt(a) + parseInt(b);
}) })
game.settings.register("world", "character-summary-data", {
name: "character-summary-data",
scope: "world",
config: false,
default: { npcList: [], x: 200, y: 200 },
type: Object
})
const tarots = await EcrymeUtility.loadCompendium("fvtt-ecryme.ecryme-tarots")
this.tarots = tarots.map(i => i.toObject())
} }
/*-------------------------------------------- */ /*-------------------------------------------- */
@ -63,14 +52,6 @@ export class EcrymeUtility {
return text.charAt(0).toUpperCase() + text.slice(1) return text.charAt(0).toUpperCase() + text.slice(1)
} }
/*-------------------------------------------- */
static getTarots() {
return duplicate(this.tarots)
}
static getTarot(tId) {
return this.tarots.find(t => t._id == tId)
}
/* -------------------------------------------- */ /* -------------------------------------------- */
static async loadCompendiumData(compendium) { static async loadCompendiumData(compendium) {
const pack = game.packs.get(compendium) const pack = game.packs.get(compendium)
@ -94,14 +75,6 @@ export class EcrymeUtility {
} }
return actor return actor
} }
/* -------------------------------------------- */
static drawDeckCard(msgId) {
if (game.user.isGM) {
game.system.ecryme.currentTirage.addCard(msgId)
} else {
game.socket.emit( "system.fvtt-ecryme", {name: "msg-draw-card", data: {msgId: msgId}})
}
}
/* -------------------------------------------- */ /* -------------------------------------------- */
static async chatListeners(html) { static async chatListeners(html) {
@ -268,75 +241,6 @@ export class EcrymeUtility {
} }
} }
/* -------------------------------------------- */
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"))
if (actorCard) {
EcrymeUtility.createChatMessage(actor.name, "gmroll", {
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"))
if (actorCard) {
EcrymeUtility.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).` })
actor.incDecMPMB(1)
}
}
if (rollData.selectedCard.name.toLowerCase().includes("chance")) {
let actorCard = actor.items.find( c => c.type =="tarot" && c.name.toLowerCase().includes("chance"))
if (actorCard) {
EcrymeUtility.createChatMessage(actor.name, "gmroll", {
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"))
if (actorCard) {
EcrymeUtility.createChatMessage(actor.name, "gmroll", {
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"))
if (actorCard) {
EcrymeUtility.createChatMessage(actor.name, "gmroll", {
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"))
if (actorCard) {
EcrymeUtility.createChatMessage(actor.name, "blindroll", {
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"))
if (actorCard) {
EcrymeUtility.createChatMessage(actor.name, "blindroll", {
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"))
if (actorCard) {
EcrymeUtility.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).` })
actor.incDecMPMN(1)
}
}
}
/* -------------------------------------------- */ /* -------------------------------------------- */
static computeResults(rollData) { static computeResults(rollData) {
rollData.isSuccess = false rollData.isSuccess = false
@ -355,38 +259,7 @@ export class EcrymeUtility {
rollData.isPart = true rollData.isPart = true
} }
} }
/* -------------------------------------------- */
static async tirageConfrontationEcryme(rollData) {
let actor = game.actors.get(rollData.actorId)
rollData.target = rollData.attr.value - rollData.confrontationDegre + rollData.confrontationModif
let deck = this.getTarots()
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
rollData.total = selectedCard.value
rollData.selectedCard = selectedCard
await EcrymeUtility.createChatMessage(actor.name, "gmroll", {
content: await renderTemplate(`systems/fvtt-ecryme/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 )
} else {
rollData.gainAttr = rollData.confrontationDegre
actor.incDecAttr(rollData.attr.abbrev, -rollData.gainAttr )
}
await EcrymeUtility.createChatMessage(actor.name, "gmroll", {
content: await renderTemplate(`systems/fvtt-ecryme/templates/chat/chat-confrontation-result.hbs`, rollData)
})
this.processSpecialCard(actor, rollData)
}
/* -------------------------------------------- */ /* -------------------------------------------- */
static async rollEcryme(rollData) { static async rollEcryme(rollData) {

View File

@ -1,19 +1,15 @@
import { MaleficesUtility } from "./malefices-utility.js"; import { EcrymeUtility } from "./ecryme-utility.js";
export const defaultItemImg = { export const defaultItemImg = {
arme: "systems/fvtt-malefices/images/icons/arme.webp", weapon: "systems/fvtt-ecryme/images/icons/weapon.webp",
equipement: "systems/fvtt-malefices/images/icons/equipement.webp", equipement: "systems/fvtt-ecryme/images/icons/equipement.webp"
elementbio: "systems/fvtt-malefices/images/icons/wisdom.webp",
archetype: "systems/fvtt-malefices/images/icons/archetype.webp",
tarot: "systems/fvtt-malefices/images/icons/tarot.webp",
sortilege: "systems/fvtt-malefices/images/icons/sortilege.webp",
} }
/** /**
* Extend the basic ItemSheet with some very simple modifications * Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet} * @extends {ItemSheet}
*/ */
export class MaleficesItem extends Item { export class EcrymeItem extends Item {
constructor(data, context) { constructor(data, context) {
if (!data.img) { if (!data.img) {

View File

@ -1,7 +1,7 @@
/* ==================== (A) Fonts ==================== */ /* ==================== (A) Fonts ==================== */
@font-face { @font-face {
font-family: "Rivanna"; font-family: "MailartRubberstamp";
src: url('../fonts/rivanna.ttf') format("truetype"); src: url('../fonts/MailartRubberstamp-Regular.otf') format("otf");
} }
:root { :root {
@ -52,7 +52,7 @@
.sheet nav.sheet-tabs { .sheet nav.sheet-tabs {
font-size: 0.8rem; font-size: 0.8rem;
} /* For nav and title */ } /* For nav and title */
.window-app input, .fvtt-malefices .item-form, .sheet header.sheet-header .flex-group-center.flex-compteurs, .sheet header.sheet-header .flex-group-center.flex-fatigue, select, button, .item-checkbox, #sidebar, #players, #navigation #nav-toggle { .window-app input, .fvtt-ecryme .item-form, .sheet header.sheet-header .flex-group-center.flex-compteurs, .sheet header.sheet-header .flex-group-center.flex-fatigue, select, button, .item-checkbox, #sidebar, #players, #navigation #nav-toggle {
font-size: 0.8rem; font-size: 0.8rem;
} }
@ -202,7 +202,7 @@ table {border: 1px solid #7a7971;}
} }
/* Styles limited to sheets */ /* Styles limited to sheets */
.fvtt-malefices .sheet-header { .fvtt-ecryme .sheet-header {
-webkit-box-flex: 0; -webkit-box-flex: 0;
-ms-flex: 0 0 210px; -ms-flex: 0 0 210px;
flex: 0 0 210px; flex: 0 0 210px;
@ -222,7 +222,7 @@ table {border: 1px solid #7a7971;}
margin-bottom: 10px; margin-bottom: 10px;
} }
.fvtt-malefices .sheet-header .profile-img { .fvtt-ecryme .sheet-header .profile-img {
-webkit-box-flex: 0; -webkit-box-flex: 0;
-ms-flex: 0 0 128px; -ms-flex: 0 0 128px;
flex: 0 0 128px; flex: 0 0 128px;
@ -271,38 +271,38 @@ table {border: 1px solid #7a7971;}
vertical-align: bottom; vertical-align: bottom;
} }
.fvtt-malefices .sheet-header .header-fields { .fvtt-ecryme .sheet-header .header-fields {
-webkit-box-flex: 1; -webkit-box-flex: 1;
-ms-flex: 1; -ms-flex: 1;
flex: 1; flex: 1;
} }
.fvtt-malefices .sheet-header h1.charname { .fvtt-ecryme .sheet-header h1.charname {
height: 50px; height: 50px;
padding: 0px; padding: 0px;
margin: 5px 0; margin: 5px 0;
border-bottom: 0; border-bottom: 0;
} }
.fvtt-malefices .sheet-header h1.charname input { .fvtt-ecryme .sheet-header h1.charname input {
font-family: Rivanna; font-family: MailartRubberstamp;
font-size: 3rem; font-size: 3rem;
width: 100%; width: 100%;
height: 100%; height: 100%;
margin: 0; margin: 0;
} }
.fvtt-malefices .sheet-tabs { .fvtt-ecryme .sheet-tabs {
-webkit-box-flex: 0; -webkit-box-flex: 0;
-ms-flex: 0; -ms-flex: 0;
flex: 0; flex: 0;
font-family: Rivanna; font-family: MailartRubberstamp;
font-size: 2.2rem; font-size: 2.2rem;
} }
.fvtt-malefices .sheet-body, .fvtt-ecryme .sheet-body,
.fvtt-malefices .sheet-body .tab, .fvtt-ecryme .sheet-body .tab,
.fvtt-malefices .sheet-body .tab .editor { .fvtt-ecryme .sheet-body .tab .editor {
height: 100%; height: 100%;
font-size: 0.8rem; font-size: 0.8rem;
} }
@ -325,70 +325,70 @@ table {border: 1px solid #7a7971;}
padding: 0 3px; padding: 0 3px;
} }
.fvtt-malefices .tox .tox-editor-container { .fvtt-ecryme .tox .tox-editor-container {
background: #fff; background: #fff;
} }
.fvtt-malefices .tox .tox-edit-area { .fvtt-ecryme .tox .tox-edit-area {
padding: 0 8px; padding: 0 8px;
} }
.fvtt-malefices .resource-label { .fvtt-ecryme .resource-label {
font-weight: bold; font-weight: bold;
text-transform: uppercase; text-transform: uppercase;
} }
.fvtt-malefices .tabs { .fvtt-ecryme .tabs {
height: 40px; height: 40px;
border-top: 1px solid #AAA; border-top: 1px solid #AAA;
border-bottom: 1px solid #AAA; border-bottom: 1px solid #AAA;
color: #000000; color: #000000;
} }
.fvtt-malefices .tabs .item { .fvtt-ecryme .tabs .item {
line-height: 40px; line-height: 40px;
font-weight: bold; font-weight: bold;
} }
.fvtt-malefices .tabs .item.active { .fvtt-ecryme .tabs .item.active {
text-decoration: underline; text-decoration: underline;
text-shadow: none; text-shadow: none;
} }
.fvtt-malefices .items-list { .fvtt-ecryme .items-list {
list-style: none; list-style: none;
margin: 1px 0; margin: 1px 0;
padding: 0; padding: 0;
overflow-y: auto; overflow-y: auto;
} }
.fvtt-malefices .items-list .item-header { .fvtt-ecryme .items-list .item-header {
font-weight: bold; font-weight: bold;
} }
.fvtt-malefices .items-list .item { .fvtt-ecryme .items-list .item {
height: 30px; height: 30px;
line-height: 24px; line-height: 24px;
padding: 1px 0; padding: 1px 0;
border-bottom: 1px solid #BBB; border-bottom: 1px solid #BBB;
} }
.fvtt-malefices .items-list .item .item-image { .fvtt-ecryme .items-list .item .item-image {
-webkit-box-flex: 0; -webkit-box-flex: 0;
-ms-flex: 0 0 24px; -ms-flex: 0 0 24px;
flex: 0 0 24px; flex: 0 0 24px;
margin-right: 5px; margin-right: 5px;
} }
.fvtt-malefices .items-list .item img { .fvtt-ecryme .items-list .item img {
display: block; display: block;
} }
.fvtt-malefices .items-list .item-name { .fvtt-ecryme .items-list .item-name {
margin: 0; margin: 0;
} }
.fvtt-malefices .items-list .item-controls { .fvtt-ecryme .items-list .item-controls {
-webkit-box-flex: 0; -webkit-box-flex: 0;
-ms-flex: 0 0 86px; -ms-flex: 0 0 86px;
flex: 0 0 86px; flex: 0 0 86px;
@ -840,7 +840,7 @@ ul, li {
.chat-result-text, .chat-result-text,
.chat-actor-name { .chat-actor-name {
font-weight: bold; font-weight: bold;
font-family: Rivanna; font-family: MailartRubberstamp;
font-size: 1.2rem; font-size: 1.2rem;
padding: 4px; padding: 4px;
} }

View File

@ -43,13 +43,13 @@
"max": 0, "max": 0,
"value": 0 "value": 0
}, },
"brawl": { "brawling": {
"name": "ECRY.ui.brawl", "name": "ECRY.ui.brawling",
"max": 0, "max": 0,
"value": 0 "value": 0
}, },
"shoot": { "shooting": {
"name": "ECRY.ui.shoot", "name": "ECRY.ui.shooting",
"max": 0, "max": 0,
"value": 0 "value": 0
} }
@ -58,8 +58,8 @@
"mental": { "mental": {
"name": "ECRY.ui.mental", "name": "ECRY.ui.mental",
"skilllist": { "skilllist": {
"anthropomechanicologys": { "anthropomecanology": {
"name": "ECRY.ui.anthropomechanicologys", "name": "ECRY.ui.anthropomecanology",
"value": 0, "value": 0,
"max": 10 "max": 10
}, },
@ -88,8 +88,8 @@
"social": { "social": {
"name": "ECRY.ui.social", "name": "ECRY.ui.social",
"skilllist": { "skilllist": {
"quibble": { "quibbling": {
"name": "ECRY.ui.quibble", "name": "ECRY.ui.quibbling",
"value": 0, "value": 0,
"max": 10 "max": 10
}, },
@ -103,8 +103,8 @@
"value": 0, "value": 0,
"max": 10 "max": 10
}, },
"skulduggery": { "guile": {
"name": "ECRY.ui.skulduggery", "name": "ECRY.ui.guile",
"value": 0, "value": 0,
"max": 10 "max": 10
}, },
@ -130,7 +130,7 @@
} }
}, },
"Item": { "Item": {
"types": ["item", "trait", "weapon", "scar", "specialization","anence", "boheme", "contact"], "types": ["item", "trait", "weapon", "scar", "specialization","annency", "boheme", "contact"],
"templates": { "templates": {
"base": { "base": {
"description": "" "description": ""