Ajout/rework
This commit is contained in:
parent
ec4223085c
commit
b9978545d2
BIN
fonts/MailartRubberstamp-Regular.otf
Normal file
BIN
fonts/MailartRubberstamp-Regular.otf
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -35,15 +35,10 @@ export class EcrymeActorSheet extends ActorSheet {
|
||||
cssClass: this.isEditable ? "editable" : "locked",
|
||||
system: duplicate(this.object.system),
|
||||
limited: this.object.limited,
|
||||
armes: duplicate(this.actor.getArmes()),
|
||||
tarots: duplicate(this.actor.getTarots()),
|
||||
tarotsCache: duplicate(this.actor.getHiddenTarots()),
|
||||
weapons: duplicate(this.actor.getWeapons()),
|
||||
archetype: duplicate(this.actor.getArchetype()),
|
||||
equipements: duplicate(this.actor.getEquipements()),
|
||||
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 }),
|
||||
notes: await TextEditor.enrichHTML(this.object.system.notes, { 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 );
|
||||
} );
|
||||
|
||||
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-attribut').click((event) => {
|
||||
html.find('.roll-skill').click((event) => {
|
||||
let attrKey = $(event.currentTarget).data("attr-key")
|
||||
this.actor.rollAttribut(attrKey)
|
||||
});
|
||||
html.find('.roll-arme').click((event) => {
|
||||
html.find('.roll-weapon').click((event) => {
|
||||
const armeId = $(event.currentTarget).data("arme-id")
|
||||
this.actor.rollArme(armeId)
|
||||
});
|
||||
@ -131,17 +117,11 @@ export class EcrymeActorSheet extends ActorSheet {
|
||||
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);
|
||||
|
@ -75,22 +75,12 @@ export class EcrymeActor extends Actor {
|
||||
super._preUpdate(changed, options, user);
|
||||
}
|
||||
|
||||
/*_onUpdateEmbeddedDocuments( embeddedName, ...args ) {
|
||||
this.rebuildSkills()
|
||||
super._onUpdateEmbeddedDocuments(embeddedName, ...args)
|
||||
}*/
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getMoneys() {
|
||||
let comp = this.items.filter(item => item.type == 'money');
|
||||
EcrymeUtility.sortArrayObjectsByName(comp)
|
||||
return comp;
|
||||
}
|
||||
getSorts() {
|
||||
let comp = this.items.filter(item => item.type == 'sortilege');
|
||||
EcrymeUtility.sortArrayObjectsByName(comp)
|
||||
return comp;
|
||||
}
|
||||
getArchetype() {
|
||||
let comp = duplicate(this.items.find(item => item.type == 'archetype') || {name: "Pas d'archetype"})
|
||||
if (comp && comp.system) {
|
||||
@ -100,26 +90,8 @@ export class EcrymeActor extends Actor {
|
||||
return comp;
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
getElementsBio() {
|
||||
let comp = duplicate(this.items.filter(item => item.type == 'elementbio') || [])
|
||||
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') || [])
|
||||
getWeapons() {
|
||||
let comp = duplicate(this.items.filter(item => item.type == 'weapon') || [])
|
||||
EcrymeUtility.sortArrayObjectsByName(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() {
|
||||
return this.items.filter(item => item.type == 'equipement')
|
||||
@ -272,29 +233,7 @@ export class EcrymeActor extends Actor {
|
||||
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) {
|
||||
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() {
|
||||
|
||||
let rollData = EcrymeUtility.getBasicRollData()
|
||||
rollData.alias = this.name
|
||||
rollData.actorImg = this.img
|
||||
rollData.actorId = this.id
|
||||
rollData.img = this.img
|
||||
rollData.phyMalus = this.getPhysiqueMalus()
|
||||
rollData.elementsbio = this.getElementsBio()
|
||||
rollData.destin = this.system.pointdestin
|
||||
rollData.isReroll = false
|
||||
rollData.confrontationDegre = 0
|
||||
rollData.confrontationModif = 0
|
||||
|
||||
console.log("ROLLDATA", rollData)
|
||||
|
||||
return rollData
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
getPhysiqueMalus() {
|
||||
if ( this.system.attributs.constitution.value <= 8) {
|
||||
return -(9 - this.system.attributs.constitution.value)
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
rollAttribut(attrKey) {
|
||||
let attr = this.system.attributs[attrKey]
|
||||
rollSkill(attrKey, skillKey) {
|
||||
let skill = this.system.skills[attrKey].skilllist[skillKey]
|
||||
let rollData = this.getCommonRollData()
|
||||
rollData.attr = duplicate(attr)
|
||||
rollData.mode = "attribut"
|
||||
rollData.title = attr.label
|
||||
rollData.img = this.getAtttributImage(attrKey)
|
||||
rollData.skill = duplicate(skill)
|
||||
rollData.mode = "skill"
|
||||
rollData.title = game.i18n.localize(skill.name)
|
||||
rollData.img = skill.img
|
||||
this.startRoll(rollData)
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
rollArme(weaponId) {
|
||||
let arme = this.items.get(weaponId)
|
||||
if (arme) {
|
||||
arme = duplicate(arme)
|
||||
rollWeapon(weaponId) {
|
||||
let weapon = this.items.get(weaponId)
|
||||
if (weapon) {
|
||||
weapon = duplicate(weapon)
|
||||
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) }
|
||||
} else {
|
||||
rollData.attr = duplicate(this.system.attributs.habilite)
|
||||
}
|
||||
rollData.mode = "arme"
|
||||
rollData.arme = arme
|
||||
rollData.img = arme.img
|
||||
rollData.title = arme.name
|
||||
rollData.mode = "weapon"
|
||||
rollData.weapon = weapon
|
||||
rollData.img = weapon.img
|
||||
rollData.title = weapon.name
|
||||
this.startRoll(rollData)
|
||||
} else {
|
||||
ui.notifications.warn("Impossible de trouver l'arme concernée ")
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
@ -9,8 +9,6 @@ export class EcrymeCommands {
|
||||
static init() {
|
||||
if (!game.system.ecryme.commands) {
|
||||
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!" });
|
||||
game.system.ecryme.commands = commands;
|
||||
}
|
||||
@ -104,42 +102,4 @@ export class EcrymeCommands {
|
||||
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)
|
||||
})
|
||||
}
|
||||
|
||||
}
|
@ -14,7 +14,7 @@ export class EcrymeHotbar {
|
||||
if (documentData.type == "Item") {
|
||||
console.log("Drop done !!!", bar, documentData, slot)
|
||||
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))
|
||||
if (!macro) {
|
||||
macro = await Macro.create({
|
||||
|
@ -9,7 +9,7 @@ export class EcrymeCharacterSummary extends Application {
|
||||
if (game.user.isGM) {
|
||||
game.system.ecryme.charSummary.render(true)
|
||||
} else {
|
||||
ui.notifications.info("Commande /tirage réservée au MJ !")
|
||||
ui.notifications.info("Commande /summary réservée au MJ !")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -44,17 +44,6 @@ export class EcrymeUtility {
|
||||
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)
|
||||
}
|
||||
|
||||
/*-------------------------------------------- */
|
||||
static getTarots() {
|
||||
return duplicate(this.tarots)
|
||||
}
|
||||
static getTarot(tId) {
|
||||
return this.tarots.find(t => t._id == tId)
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async loadCompendiumData(compendium) {
|
||||
const pack = game.packs.get(compendium)
|
||||
@ -94,14 +75,6 @@ export class EcrymeUtility {
|
||||
}
|
||||
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) {
|
||||
@ -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) {
|
||||
rollData.isSuccess = false
|
||||
@ -355,38 +259,7 @@ export class EcrymeUtility {
|
||||
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) {
|
||||
|
||||
|
@ -1,19 +1,15 @@
|
||||
import { MaleficesUtility } from "./malefices-utility.js";
|
||||
import { EcrymeUtility } from "./ecryme-utility.js";
|
||||
|
||||
export const defaultItemImg = {
|
||||
arme: "systems/fvtt-malefices/images/icons/arme.webp",
|
||||
equipement: "systems/fvtt-malefices/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",
|
||||
weapon: "systems/fvtt-ecryme/images/icons/weapon.webp",
|
||||
equipement: "systems/fvtt-ecryme/images/icons/equipement.webp"
|
||||
}
|
||||
|
||||
/**
|
||||
* Extend the basic ItemSheet with some very simple modifications
|
||||
* @extends {ItemSheet}
|
||||
*/
|
||||
export class MaleficesItem extends Item {
|
||||
export class EcrymeItem extends Item {
|
||||
|
||||
constructor(data, context) {
|
||||
if (!data.img) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* ==================== (A) Fonts ==================== */
|
||||
@font-face {
|
||||
font-family: "Rivanna";
|
||||
src: url('../fonts/rivanna.ttf') format("truetype");
|
||||
font-family: "MailartRubberstamp";
|
||||
src: url('../fonts/MailartRubberstamp-Regular.otf') format("otf");
|
||||
}
|
||||
|
||||
:root {
|
||||
@ -52,7 +52,7 @@
|
||||
.sheet nav.sheet-tabs {
|
||||
font-size: 0.8rem;
|
||||
} /* 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;
|
||||
}
|
||||
|
||||
@ -202,7 +202,7 @@ table {border: 1px solid #7a7971;}
|
||||
}
|
||||
|
||||
/* Styles limited to sheets */
|
||||
.fvtt-malefices .sheet-header {
|
||||
.fvtt-ecryme .sheet-header {
|
||||
-webkit-box-flex: 0;
|
||||
-ms-flex: 0 0 210px;
|
||||
flex: 0 0 210px;
|
||||
@ -222,7 +222,7 @@ table {border: 1px solid #7a7971;}
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.fvtt-malefices .sheet-header .profile-img {
|
||||
.fvtt-ecryme .sheet-header .profile-img {
|
||||
-webkit-box-flex: 0;
|
||||
-ms-flex: 0 0 128px;
|
||||
flex: 0 0 128px;
|
||||
@ -271,38 +271,38 @@ table {border: 1px solid #7a7971;}
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
.fvtt-malefices .sheet-header .header-fields {
|
||||
.fvtt-ecryme .sheet-header .header-fields {
|
||||
-webkit-box-flex: 1;
|
||||
-ms-flex: 1;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.fvtt-malefices .sheet-header h1.charname {
|
||||
.fvtt-ecryme .sheet-header h1.charname {
|
||||
height: 50px;
|
||||
padding: 0px;
|
||||
margin: 5px 0;
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.fvtt-malefices .sheet-header h1.charname input {
|
||||
font-family: Rivanna;
|
||||
.fvtt-ecryme .sheet-header h1.charname input {
|
||||
font-family: MailartRubberstamp;
|
||||
font-size: 3rem;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.fvtt-malefices .sheet-tabs {
|
||||
.fvtt-ecryme .sheet-tabs {
|
||||
-webkit-box-flex: 0;
|
||||
-ms-flex: 0;
|
||||
flex: 0;
|
||||
font-family: Rivanna;
|
||||
font-family: MailartRubberstamp;
|
||||
font-size: 2.2rem;
|
||||
}
|
||||
|
||||
.fvtt-malefices .sheet-body,
|
||||
.fvtt-malefices .sheet-body .tab,
|
||||
.fvtt-malefices .sheet-body .tab .editor {
|
||||
.fvtt-ecryme .sheet-body,
|
||||
.fvtt-ecryme .sheet-body .tab,
|
||||
.fvtt-ecryme .sheet-body .tab .editor {
|
||||
height: 100%;
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
@ -325,70 +325,70 @@ table {border: 1px solid #7a7971;}
|
||||
padding: 0 3px;
|
||||
}
|
||||
|
||||
.fvtt-malefices .tox .tox-editor-container {
|
||||
.fvtt-ecryme .tox .tox-editor-container {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.fvtt-malefices .tox .tox-edit-area {
|
||||
.fvtt-ecryme .tox .tox-edit-area {
|
||||
padding: 0 8px;
|
||||
}
|
||||
|
||||
.fvtt-malefices .resource-label {
|
||||
.fvtt-ecryme .resource-label {
|
||||
font-weight: bold;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.fvtt-malefices .tabs {
|
||||
.fvtt-ecryme .tabs {
|
||||
height: 40px;
|
||||
border-top: 1px solid #AAA;
|
||||
border-bottom: 1px solid #AAA;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.fvtt-malefices .tabs .item {
|
||||
.fvtt-ecryme .tabs .item {
|
||||
line-height: 40px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.fvtt-malefices .tabs .item.active {
|
||||
.fvtt-ecryme .tabs .item.active {
|
||||
text-decoration: underline;
|
||||
text-shadow: none;
|
||||
}
|
||||
|
||||
.fvtt-malefices .items-list {
|
||||
.fvtt-ecryme .items-list {
|
||||
list-style: none;
|
||||
margin: 1px 0;
|
||||
padding: 0;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.fvtt-malefices .items-list .item-header {
|
||||
.fvtt-ecryme .items-list .item-header {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.fvtt-malefices .items-list .item {
|
||||
.fvtt-ecryme .items-list .item {
|
||||
height: 30px;
|
||||
line-height: 24px;
|
||||
padding: 1px 0;
|
||||
border-bottom: 1px solid #BBB;
|
||||
}
|
||||
|
||||
.fvtt-malefices .items-list .item .item-image {
|
||||
.fvtt-ecryme .items-list .item .item-image {
|
||||
-webkit-box-flex: 0;
|
||||
-ms-flex: 0 0 24px;
|
||||
flex: 0 0 24px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.fvtt-malefices .items-list .item img {
|
||||
.fvtt-ecryme .items-list .item img {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.fvtt-malefices .items-list .item-name {
|
||||
.fvtt-ecryme .items-list .item-name {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.fvtt-malefices .items-list .item-controls {
|
||||
.fvtt-ecryme .items-list .item-controls {
|
||||
-webkit-box-flex: 0;
|
||||
-ms-flex: 0 0 86px;
|
||||
flex: 0 0 86px;
|
||||
@ -840,7 +840,7 @@ ul, li {
|
||||
.chat-result-text,
|
||||
.chat-actor-name {
|
||||
font-weight: bold;
|
||||
font-family: Rivanna;
|
||||
font-family: MailartRubberstamp;
|
||||
font-size: 1.2rem;
|
||||
padding: 4px;
|
||||
}
|
||||
|
@ -43,13 +43,13 @@
|
||||
"max": 0,
|
||||
"value": 0
|
||||
},
|
||||
"brawl": {
|
||||
"name": "ECRY.ui.brawl",
|
||||
"brawling": {
|
||||
"name": "ECRY.ui.brawling",
|
||||
"max": 0,
|
||||
"value": 0
|
||||
},
|
||||
"shoot": {
|
||||
"name": "ECRY.ui.shoot",
|
||||
"shooting": {
|
||||
"name": "ECRY.ui.shooting",
|
||||
"max": 0,
|
||||
"value": 0
|
||||
}
|
||||
@ -58,8 +58,8 @@
|
||||
"mental": {
|
||||
"name": "ECRY.ui.mental",
|
||||
"skilllist": {
|
||||
"anthropomechanicologys": {
|
||||
"name": "ECRY.ui.anthropomechanicologys",
|
||||
"anthropomecanology": {
|
||||
"name": "ECRY.ui.anthropomecanology",
|
||||
"value": 0,
|
||||
"max": 10
|
||||
},
|
||||
@ -88,8 +88,8 @@
|
||||
"social": {
|
||||
"name": "ECRY.ui.social",
|
||||
"skilllist": {
|
||||
"quibble": {
|
||||
"name": "ECRY.ui.quibble",
|
||||
"quibbling": {
|
||||
"name": "ECRY.ui.quibbling",
|
||||
"value": 0,
|
||||
"max": 10
|
||||
},
|
||||
@ -103,8 +103,8 @@
|
||||
"value": 0,
|
||||
"max": 10
|
||||
},
|
||||
"skulduggery": {
|
||||
"name": "ECRY.ui.skulduggery",
|
||||
"guile": {
|
||||
"name": "ECRY.ui.guile",
|
||||
"value": 0,
|
||||
"max": 10
|
||||
},
|
||||
@ -130,7 +130,7 @@
|
||||
}
|
||||
},
|
||||
"Item": {
|
||||
"types": ["item", "trait", "weapon", "scar", "specialization","anence", "boheme", "contact"],
|
||||
"types": ["item", "trait", "weapon", "scar", "specialization","annency", "boheme", "contact"],
|
||||
"templates": {
|
||||
"base": {
|
||||
"description": ""
|
||||
|
Loading…
Reference in New Issue
Block a user