Merge branch 'v1.5-stress-to-xp' into 'v1.5'

Expérience par le stress

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!297
This commit is contained in:
Leratier Bretonnien 2021-11-23 19:18:21 +00:00
commit d8ecd94ac3
11 changed files with 221 additions and 169 deletions

View File

@ -30,8 +30,7 @@ export class RdDActorSheet extends ActorSheet {
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }], dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
editCaracComp: false, editCaracComp: false,
showCompNiveauBase: false, showCompNiveauBase: false,
montrerArchetype: false, vueDetaillee: false
hideControls: true
}); });
} }
@ -80,7 +79,7 @@ export class RdDActorSheet extends ActorSheet {
formData.competences.forEach(item => { formData.competences.forEach(item => {
item.visible = !this.options.showCompNiveauBase || !RdDItemCompetence.isNiveauBase(item); item.visible = !this.options.showCompNiveauBase || !RdDItemCompetence.isNiveauBase(item);
RdDItemCompetence.levelUp(item); RdDItemCompetence.levelUp(item, formData.data.compteurs.experience.value);
}); });
Object.values(formData.data.carac).forEach(c => { Object.values(formData.data.carac).forEach(c => {
@ -277,52 +276,34 @@ export class RdDActorSheet extends ActorSheet {
// Roll Skill // Roll Skill
html.find('a.competence-label').click(async event => { html.find('a.competence-label').click(async event => {
let compName = event.currentTarget.name; this.actor.rollCompetence(this._getItemId(event));
this.actor.rollCompetence(compName);
}); });
html.find('.tache-label a').click(async event => { html.find('.tache-label a').click(async event => {
const li = $(event.currentTarget).parents(".item"); this.actor.rollTache(this._getItemId(event));
let tacheId = li.data('item-id');
this.actor.rollTache(tacheId);
}); });
html.find('.meditation-label a').click(async event => { html.find('.meditation-label a').click(async event => {
const li = $(event.currentTarget).parents(".item"); this.actor.rollMeditation(this._getItemId(event));
let meditationId = li.data('item-id');
this.actor.rollMeditation(meditationId);
}); });
html.find('.chant-label a').click(async event => { html.find('.chant-label a').click(async event => {
const li = $(event.currentTarget).parents(".item"); this.actor.rollChant(this._getItemId(event));
let chantId = li.data('item-id');
this.actor.rollChant(chantId);
}); });
html.find('.danse-label a').click(async event => { html.find('.danse-label a').click(async event => {
const li = $(event.currentTarget).parents(".item"); this.actor.rollDanse(this._getItemId(event));
let danseId = li.data('item-id');
this.actor.rollDanse(danseId);
}); });
html.find('.musique-label a').click(async event => { html.find('.musique-label a').click(async event => {
const li = $(event.currentTarget).parents(".item"); this.actor.rollMusique(this._getItemId(event));
let musiqueId = li.data('item-id');
this.actor.rollMusique(musiqueId);
}); });
html.find('.oeuvre-label a').click(async event => { html.find('.oeuvre-label a').click(async event => {
const li = $(event.currentTarget).parents(".item"); this.actor.rollOeuvre(this._getItemId(event));
let oeuvreId = li.data('item-id');
this.actor.rollOeuvre(oeuvreId);
}); });
html.find('.jeu-label a').click(async event => { html.find('.jeu-label a').click(async event => {
const li = $(event.currentTarget).parents(".item"); this.actor.rollJeu(this._getItemId(event));
let jeuId = li.data('item-id');
this.actor.rollJeu(jeuId);
}); });
html.find('.recettecuisine-label a').click(async event => { html.find('.recettecuisine-label a').click(async event => {
const li = $(event.currentTarget).parents(".item"); this.actor.rollRecetteCuisine(this._getItemId(event));
let recetteId = li.data('item-id');
this.actor.rollRecetteCuisine(recetteId);
}); });
html.find('.subacteur-label a').click(async event => { html.find('.subacteur-label a').click(async event => {
const li = $(event.currentTarget).parents(".item"); let actorId = this._getEventItemData(event, 'actor-id');
let actorId = li.data('actor-id');
let actor = game.actors.get(actorId); let actor = game.actors.get(actorId);
if (actor) { if (actor) {
actor.sheet.render(true); actor.sheet.render(true);
@ -344,16 +325,14 @@ export class RdDActorSheet extends ActorSheet {
// Roll Weapon1 // Roll Weapon1
html.find('.arme-label a').click(async event => { html.find('.arme-label a').click(async event => {
const li = $(event.currentTarget).parents(".item"); let arme = this._getEventArmeCombat(event);
let arme = this._getArmeCombat(li);
this.actor.rollArme( duplicate(arme) ); this.actor.rollArme( duplicate(arme) );
}); });
// Initiative pour l'arme // Initiative pour l'arme
html.find('.arme-initiative a').click(async event => { html.find('.arme-initiative a').click(async event => {
let combatant = game.combat.data.combatants.find(c => c.actor.data._id == this.actor.data._id); let combatant = game.combat.data.combatants.find(c => c.actor.data._id == this.actor.data._id);
if (combatant) { if (combatant) {
const li = $(event.currentTarget).parents(".item"); let arme = this._getEventArmeCombat(event);
let arme = this._getArmeCombat(li);
RdDCombatManager.rollInitiativeCompetence(combatant._id, arme); RdDCombatManager.rollInitiativeCompetence(combatant._id, arme);
} else { } else {
ui.notifications.info("Impossible de lancer l'initiative sans être dans un combat."); ui.notifications.info("Impossible de lancer l'initiative sans être dans un combat.");
@ -385,8 +364,7 @@ export class RdDActorSheet extends ActorSheet {
this.actor.enleverTousLesEffets(); this.actor.enleverTousLesEffets();
}); });
html.find('.conteneur-name a').click(async event => { html.find('.conteneur-name a').click(async event => {
let myID = event.currentTarget.attributes['data-item-id'].value; RdDUtility.toggleAfficheContenu(this._getItemId(event));
RdDUtility.toggleAfficheContenu(myID);
this.render(true); this.render(true);
}); });
html.find('.carac-xp-augmenter').click(async event => { html.find('.carac-xp-augmenter').click(async event => {
@ -394,8 +372,10 @@ export class RdDActorSheet extends ActorSheet {
this.actor.updateCaracXPAuto(caracName); this.actor.updateCaracXPAuto(caracName);
}); });
html.find('.competence-xp-augmenter').click(async event => { html.find('.competence-xp-augmenter').click(async event => {
let compName = event.currentTarget.attributes.compname.value; this.actor.updateCompetenceXPAuto(this._getItemId(event));
this.actor.updateCompetenceXPAuto(compName); });
html.find('.competence-stress-augmenter').click(async event => {
this.actor.updateCompetenceStress(this._getItemId(event));
}); });
if (this.options.editCaracComp) { if (this.options.editCaracComp) {
@ -433,7 +413,7 @@ export class RdDActorSheet extends ActorSheet {
}); });
} }
html.find('#show-hide-competences').click(async event => { html.find('.show-hide-competences').click(async event => {
this.options.showCompNiveauBase = !this.options.showCompNiveauBase; this.options.showCompNiveauBase = !this.options.showCompNiveauBase;
this.render(true); this.render(true);
}); });
@ -441,13 +421,9 @@ export class RdDActorSheet extends ActorSheet {
this.options.editCaracComp = !this.options.editCaracComp; this.options.editCaracComp = !this.options.editCaracComp;
this.render(true); this.render(true);
}); });
html.find('#show-hide-archetype').click(async event => { html.find('.vue-detaillee').click(async event => {
this.options.montrerArchetype = !this.options.montrerArchetype; console.log("CONTROLS", this.options.vueDetaillee)
this.render(true); this.options.vueDetaillee = !this.options.vueDetaillee;
});
html.find('.lock-unlock-controls').click(async event => {
console.log("CONTROLS", this.options.hideControls)
this.options.hideControls = !this.options.hideControls;
this.render(true); this.render(true);
}); });
@ -534,8 +510,17 @@ export class RdDActorSheet extends ActorSheet {
}); });
} }
_getItemId(event) {
return this._getEventItemData(event, "item-id");
}
_getArmeCombat(li) { _getEventItemData(event, property) {
const li = $(event.currentTarget)?.parents(".item");
return li?.data(property);
}
_getEventArmeCombat(event) {
const li = $(event.currentTarget)?.parents(".item");
let armeName = li.data("arme-name"); let armeName = li.data("arme-name");
let compName = li.data('competence-name'); let compName = li.data('competence-name');
const arme = this.armesList.find(a => a.name == armeName && a.data.competence == compName); const arme = this.armesList.find(a => a.name == armeName && a.data.competence == compName);

View File

@ -904,8 +904,8 @@ export class RdDActor extends Actor {
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
async updateCompetenceXPAuto(compName) { async updateCompetenceXPAuto(idOrName) {
let competence = this.getCompetence(compName); let competence = this.getCompetence(idOrName);
if (competence) { if (competence) {
let compData = Misc.data(competence); let compData = Misc.data(competence);
let xp = Number(compData.data.xp); let xp = Number(compData.data.xp);
@ -914,35 +914,65 @@ export class RdDActor extends Actor {
xp -= RdDItemCompetence.getCompetenceNextXp(niveau); xp -= RdDItemCompetence.getCompetenceNextXp(niveau);
niveau++; niveau++;
} }
competence.update({ await competence.update({
"data.xp": xp, "data.xp": xp,
"data.niveau": niveau, "data.niveau": niveau,
}); });
this.updateExperienceLog("Compétence +", xp, compName + " passée à " + niveau); this.updateExperienceLog("Compétence +", xp, competence.name + " passée à " + niveau);
} }
} }
async updateCompetenceStress(idOrName) {
const competence = this.getCompetence(idOrName);
if (!competence) {
return;
}
const compData = Misc.data(competence);
const niveau = Number(compData.data.niveau);
const stressTransforme = Misc.data(this).data.compteurs.experience.value;
const xpRequis = RdDItemCompetence.getCompetenceNextXp(niveau) - compData.data.xp;
if (stressTransforme <= 0 || niveau >= compData.data.niveau_archetype || xpRequis <=0) {
ui.notifications.info(`La compétence ne peut pas augmenter!
stress disponible: ${stressTransforme}
expérience requise: ${xpRequis}
niveau : ${niveau}
archétype : ${compData.data.niveau_archetype}`);
return;
}
const xpUtilise = Math.min(stressTransforme, xpRequis);
const stressTransformeRestant = Math.max(0, stressTransforme - xpUtilise);
const gainNiveau = xpUtilise>=xpRequis ? 1 : 0;
await this.update({ "data.compteurs.experience.value": stressTransformeRestant });
const nouveauNiveau = niveau + gainNiveau;
await competence.update({
"data.xp": Math.max(compData.data.xp - xpRequis, 0),
"data.niveau": nouveauNiveau,
});
this.updateExperienceLog('Dépense stress', xpUtilise, `Stress en ${competence.name} ${gainNiveau? "pour passer à "+nouveauNiveau : ""}`);
}
/* -------------------------------------------- */ /* -------------------------------------------- */
async updateCreatureCompetence(compName, fieldName, compValue) { async updateCreatureCompetence(idOrName, fieldName, compValue) {
let comp = this.getCompetence(compName); let competence = this.getCompetence(idOrName);
if (comp) { if (competence) {
const update = { _id: comp.id } const update = { _id: competence.id }
if (fieldName == "niveau") if (fieldName == "niveau")
update['data.niveau'] = compValue; update['data.niveau'] = compValue;
else if (fieldName == "dommages") else if (fieldName == "dommages")
update['data.dommages'] = compValue; update['data.dommages'] = compValue;
else else
update['data.carac_value'] = compValue; update['data.carac_value'] = compValue;
const updated = await this.updateEmbeddedDocuments('Item', [update]); // pdates one EmbeddedEntity await this.updateEmbeddedDocuments('Item', [update]); // updates one EmbeddedEntity
} }
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
async updateCompetence(compName, compValue) { async updateCompetence(idOrName, compValue) {
let comp = this.getCompetence(compName); let competence = this.getCompetence(idOrName);
if (comp) { if (competence) {
let troncList = RdDItemCompetence.isTronc(compName); let troncList = RdDItemCompetence.isTronc(competence.name);
let nouveauNiveau = compValue ?? RdDItemCompetence.getNiveauBase(Misc.data(comp).data.categorie); let nouveauNiveau = compValue ?? RdDItemCompetence.getNiveauBase(Misc.data(competence).data.categorie);
if (troncList) { if (troncList) {
let message = "Vous avez modifié une compétence 'tronc'. Vérifiez que les compétences suivantes évoluent ensemble jusqu'au niveau 0 : "; let message = "Vous avez modifié une compétence 'tronc'. Vérifiez que les compétences suivantes évoluent ensemble jusqu'au niveau 0 : ";
for (let troncName of troncList) { for (let troncName of troncList) {
@ -953,50 +983,50 @@ export class RdDActor extends Actor {
content: message content: message
}); });
} }
const update = { _id: comp.id, 'data.niveau': nouveauNiveau }; const update = { _id: competence.id, 'data.niveau': nouveauNiveau };
await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity
} else { } else {
console.log("Competence not found", compName); console.log("Competence not found", idOrName);
} }
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
async updateCompetenceXP(compName, newXp) { async updateCompetenceXP(idOrName, newXp) {
let comp = this.getCompetence(compName); let competence = this.getCompetence(idOrName);
if (comp) { if (competence) {
if (isNaN(newXp) || typeof (newXp) != 'number') newXp = 0; if (isNaN(newXp) || typeof (newXp) != 'number') newXp = 0;
this.checkCompetenceXP(compName, newXp); this.checkCompetenceXP(idOrName, newXp);
const update = { _id: comp.id, 'data.xp': newXp }; const update = { _id: competence.id, 'data.xp': newXp };
await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity
this.updateExperienceLog("XP", newXp, "XP modifié en " + compName); this.updateExperienceLog("XP", newXp, "XP modifié en " + competence.name);
} else { } else {
console.log("Competence not found", compName); console.log("Competence not found", idOrName);
} }
RdDUtility.checkThanatosXP(compName); RdDUtility.checkThanatosXP(idOrName);
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
async updateCompetenceXPSort(compName, compValue) { async updateCompetenceXPSort(idOrName, compValue) {
let comp = this.getCompetence(compName); let competence = this.getCompetence(idOrName);
if (comp) { if (competence) {
if (isNaN(compValue) || typeof (compValue) != 'number') compValue = 0; if (isNaN(compValue) || typeof (compValue) != 'number') compValue = 0;
const update = { _id: comp.id, 'data.xp_sort': compValue }; const update = { _id: competence.id, 'data.xp_sort': compValue };
await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity
this.updateExperienceLog("XP Sort", compValue, "XP modifié en sort de " + compName); this.updateExperienceLog("XP Sort", compValue, "XP modifié en sort de " + competence.name);
} else { } else {
console.log("Competence not found", compName); console.log("Competence not found", idOrName);
} }
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
async updateCompetenceArchetype(compName, compValue) { async updateCompetenceArchetype(idOrName, compValue) {
let comp = this.getCompetence(compName); let competence = this.getCompetence(idOrName);
if (comp) { if (competence) {
compValue = compValue ?? 0; compValue = compValue ?? 0;
const update = { _id: comp.id, 'data.niveau_archetype': compValue }; const update = { _id: competence.id, 'data.niveau_archetype': compValue };
await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity
} else { } else {
console.log("Competence not found", compName); console.log("Competence not found", idOrName);
} }
} }
@ -2489,8 +2519,8 @@ export class RdDActor extends Actor {
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
async rollCompetence(name) { async rollCompetence(idOrName) {
let rollData = { competence: Misc.data(this.getCompetence(name)) } let rollData = { competence: Misc.data(this.getCompetence(idOrName)) }
//console.log("COMP CREATURE", name, rollData, name); //console.log("COMP CREATURE", name, rollData, name);
if (rollData.competence.type == 'competencecreature') { if (rollData.competence.type == 'competencecreature') {
@ -2510,7 +2540,7 @@ export class RdDActor extends Actor {
const dialog = await RdDRoll.create(this, rollData, { html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.html' }, { const dialog = await RdDRoll.create(this, rollData, { html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.html' }, {
name: 'jet-competence', name: 'jet-competence',
label: 'Jet ' + Grammar.apostrophe('de', name), label: 'Jet ' + Grammar.apostrophe('de', rollData.competence.name),
callbacks: [ callbacks: [
this.createCallbackExperience(), this.createCallbackExperience(),
this.createCallbackAppelAuMoral(), this.createCallbackAppelAuMoral(),
@ -2588,15 +2618,16 @@ export class RdDActor extends Actor {
rollData.appliquerFatigue = ReglesOptionelles.isUsing("appliquer-fatigue"); rollData.appliquerFatigue = ReglesOptionelles.isUsing("appliquer-fatigue");
rollData.tache = duplicate(rollData.tache); rollData.tache = duplicate(rollData.tache);
rollData.tache.data.points_de_tache_courant += rollData.rolled.ptTache; rollData.tache.data.points_de_tache_courant += rollData.rolled.ptTache;
rollData.tache.data.tentatives++;
if (rollData.rolled.isETotal) { if (rollData.rolled.isETotal) {
rollData.tache.data.difficulte--; rollData.tache.data.difficulte--;
} }
if (rollData.rolled.isSuccess) { if (rollData.rolled.isSuccess) {
rollData.tache.data.nb_jet_succes = rollData.tache.data.nb_jet_succes + 1; rollData.tache.data.nb_jet_succes++;
} else { } else {
rollData.tache.data.nb_jet_echec = rollData.tache.data.nb_jet_echec + 1; rollData.tache.data.nb_jet_echec++;
} }
rollData.tache.data.tentatives = rollData.tache.data.nb_jet_succes+rollData.tache.data.nb_jet_echec;
this.updateEmbeddedDocuments('Item', [rollData.tache]); this.updateEmbeddedDocuments('Item', [rollData.tache]);
this.santeIncDec("fatigue", rollData.tache.data.fatigue); this.santeIncDec("fatigue", rollData.tache.data.fatigue);

View File

@ -84,7 +84,7 @@ export class RdDItemCompetence extends Item {
/* -------------------------------------------- */ /* -------------------------------------------- */
static getVoieDraconic(competences, voie) { static getVoieDraconic(competences, voie) {
return RdDItemCompetence.findCompetence(competences.filter(it => RdDItemCompetence.isDraconic(it) ), voie); return RdDItemCompetence.findCompetence(competences.filter(it => RdDItemCompetence.isDraconic(it)), voie);
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
@ -148,7 +148,7 @@ export class RdDItemCompetence extends Item {
// calcul du coût xp jusqu'au niveau 0 maximum // calcul du coût xp jusqu'au niveau 0 maximum
.map(it => RdDItemCompetence.computeDeltaXP(it?.data.base ?? -11, Math.min(it?.data.niveau ?? -11, 0))) .map(it => RdDItemCompetence.computeDeltaXP(it?.data.base ?? -11, Math.min(it?.data.niveau ?? -11, 0)))
.sort(Misc.ascending()) .sort(Misc.ascending())
.splice(0, list.length-1) // prendre toutes les valeurs sauf l'une des plus élevées .splice(0, list.length - 1) // prendre toutes les valeurs sauf l'une des plus élevées
.reduce(Misc.sum(), 0) .reduce(Misc.sum(), 0)
).reduce(Misc.sum(), 0); ).reduce(Misc.sum(), 0);
} }
@ -160,7 +160,6 @@ export class RdDItemCompetence extends Item {
return competence_xp_cumul[to] - competence_xp_cumul[from]; return competence_xp_cumul[to] - competence_xp_cumul[from];
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
static computeCompetenceXPCost(competence) { static computeCompetenceXPCost(competence) {
const compData = Misc.data(competence); const compData = Misc.data(competence);
@ -186,9 +185,15 @@ export class RdDItemCompetence extends Item {
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
static levelUp(itemData) { static levelUp(itemData, stressTransforme) {
itemData.data.xpNext = RdDItemCompetence.getCompetenceNextXp(itemData.data.niveau); itemData.data.xpNext = RdDItemCompetence.getCompetenceNextXp(itemData.data.niveau);
itemData.data.isLevelUp = itemData.data.xp >= itemData.data.xpNext; const xpManquant = itemData.data.xpNext - itemData.data.xp;
itemData.data.isLevelUp = xpManquant <= 0;
itemData.data.isStressLevelUp = (xpManquant > 0 && stressTransforme >= xpManquant && itemData.data.niveau < itemData.data.niveau_archetype);
itemData.data.stressXpMax = 0;
if (xpManquant > 0 && stressTransforme > 0 && itemData.data.niveau < itemData.data.niveau_archetype) {
itemData.data.stressXpMax = Math.min(xpManquant , stressTransforme);
}
} }
/* -------------------------------------------- */ /* -------------------------------------------- */

View File

@ -16,14 +16,14 @@ const imagesHeures = [1, 2, 3, 4, 5, 6, 7, 9, 9, 10, 11, 12].map(it => iconHeure
const imgSigneDragon = img(imagesHeures[4]); const imgSigneDragon = img(imagesHeures[4]);
/** De7 pour les jets de rencontre */ /** De pour les jets de rencontre */
export class De7 extends Die { export class DeTMR extends Die {
/** @override */ /** @override */
static DENOMINATION = "7"; static DENOMINATION = "t";
static diceSoNiceData(system) { static diceSoNiceData(system) {
return { return {
type: "d7", type: "dt",
font: "HeuresDraconiques", font: "HeuresDraconiques",
fontScale: 0.7, fontScale: 0.7,
labels: ['1', '2', '3', '4', '5', '6', 'd', '0'], labels: ['1', '2', '3', '4', '5', '6', 'd', '0'],
@ -119,7 +119,7 @@ export class DeHeure extends Die {
export class RdDDice { export class RdDDice {
static init() { static init() {
CONFIG.Dice.terms[De7.DENOMINATION] = De7; CONFIG.Dice.terms[DeTMR.DENOMINATION] = DeTMR;
CONFIG.Dice.terms[DeDraconique.DENOMINATION] = DeDraconique; CONFIG.Dice.terms[DeDraconique.DENOMINATION] = DeDraconique;
CONFIG.Dice.terms[DeHeure.DENOMINATION] = DeHeure; CONFIG.Dice.terms[DeHeure.DENOMINATION] = DeHeure;
} }
@ -153,7 +153,7 @@ export class RdDDice {
static diceSoNiceReady(dice3d) { static diceSoNiceReady(dice3d) {
for (const system of Object.keys(dice3d.DiceFactory.systems)) { for (const system of Object.keys(dice3d.DiceFactory.systems)) {
dice3d.addDicePreset(De7.diceSoNiceData(system)); dice3d.addDicePreset(DeTMR.diceSoNiceData(system));
dice3d.addDicePreset(DeDraconique.diceSoNiceData(system)); dice3d.addDicePreset(DeDraconique.diceSoNiceData(system));
dice3d.addDicePreset(DeHeure.diceSoNiceData(system)); dice3d.addDicePreset(DeHeure.diceSoNiceData(system));
} }

View File

@ -541,7 +541,7 @@ export class RdDTMRDialog extends Dialog {
} }
let locTMR = (this.cacheTMR) ? Misc.upperFirst(tmr.type) + " ??" : tmr.label + " (" + tmr.coord + ")"; let locTMR = (this.cacheTMR) ? Misc.upperFirst(tmr.type) + " ??" : tmr.label + " (" + tmr.coord + ")";
let myRoll = await RdDDice.rollTotal("1d7"); let myRoll = await RdDDice.rollTotal("1dt");
if (TMRUtility.isForceRencontre() || myRoll == 7) { if (TMRUtility.isForceRencontre() || myRoll == 7) {
this._tellToUser(myRoll + ": Rencontre en " + locTMR); this._tellToUser(myRoll + ": Rencontre en " + locTMR);
return await this.rencontreTMRRoll(tmr, this.actor.isRencontreSpeciale()); return await this.rencontreTMRRoll(tmr, this.actor.isRencontreSpeciale());

File diff suppressed because one or more lines are too long

View File

@ -28,9 +28,8 @@
font-weight: normal; font-weight: normal;
font-style: normal; font-style: normal;
} }
:root {
:root { /* =================== 1. ACTOR SHEET FONT STYLES =========== */
/* =================== 1. ACTOR SHEET FONT STYLES =========== */
--window-header-title-font-family: CaslonAntique; --window-header-title-font-family: CaslonAntique;
--window-header-title-font-size: 1.5rem; --window-header-title-font-size: 1.5rem;
--window-header-title-font-weight: normal; --window-header-title-font-weight: normal;
@ -57,7 +56,7 @@
--actor-label-font-weight: 700; --actor-label-font-weight: 700;
--actor-label-color: #464331c4; --actor-label-color: #464331c4;
/* =================== 2. DEBUGGING HIGHLIGHTERS ============ */ /* =================== 2. DEBUGGING HIGHLIGHTERS ============ */
--debug-background-color-red: #ff000054; --debug-background-color-red: #ff000054;
--debug-background-color-blue: #1d00ff54; --debug-background-color-blue: #1d00ff54;
--debug-background-color-green: #54ff0054; --debug-background-color-green: #54ff0054;
@ -65,7 +64,16 @@
--debug-box-shadow-red: inset 0 0 2px red; --debug-box-shadow-red: inset 0 0 2px red;
--debug-box-shadow-blue: inset 0 0 2px blue; --debug-box-shadow-blue: inset 0 0 2px blue;
--debug-box-shadow-green: inset 0 0 2px green; --debug-box-shadow-green: inset 0 0 2px green;
}
/* =================== 3. some constants ============ */
--gradient-gold: linear-gradient(30deg, rgba(191, 149, 63, 0.3), rgba(252, 246, 186, 0.3), rgba(179, 135, 40, 0.3), rgba(251, 245, 183, 0.3), rgba(170, 119, 28, 0.3));
--gradient-silver: linear-gradient(30deg, rgba(61, 55, 93, 0.3), rgba(178, 179, 196, 0.3), rgba(59, 62, 63, 0.6), rgba(206, 204, 199, 0.3), rgba(61, 46, 49, 0.3));
--gradient-green: linear-gradient(30deg, rgba(7, 76, 0, 0.3), rgba(66, 163, 65, 0.2), rgba(184, 226, 163, 0.1), rgba(66, 163, 65, 0.2), rgba(184, 226, 163, 0.3));
--gradient-red: linear-gradient(150deg, rgba(255, 0, 0, 0.3), rgba(255, 200, 128, 0.05),rgba(255, 200, 128, 0.1), rgba(255,10,0,0.3));
--gradient-violet: linear-gradient(150deg, rgba(100, 45, 124, 0.6), rgba(216, 157, 192, 0.3), rgba(177, 157, 216, 0.5), rgba(107, 62, 121, 0.3), rgba(100, 45, 124, 0.6));
--gradient-purple-black: linear-gradient(150deg, rgba(0, 0, 0, 0.7), rgba(100, 45, 124, 0.4), rgba(82, 17, 131, 0.3),rgba(100, 45, 124, 0.4), rgba(0, 0, 0, 0.7));
--gradient-silver-light: linear-gradient(30deg, rgba(61, 55, 93, 0.2), rgba(178, 179, 196, 0.1), rgba(59, 62, 63, 0.2), rgba(206, 204, 199, 0.1), rgba(61, 46, 49, 0.2));
}
/*@import url("https://fonts.googleapis.com/css2?family=Martel:wght@400;800&family=Roboto:wght@300;400;500&display=swap");*/ /*@import url("https://fonts.googleapis.com/css2?family=Martel:wght@400;800&family=Roboto:wght@300;400;500&display=swap");*/
/* Global styles & Font */ /* Global styles & Font */
@ -78,7 +86,9 @@
/* Fonts */ /* Fonts */
.sheet header.sheet-header h1 input, .window-app .window-header, #actors .directory-list, #navigation #scene-list .scene.nav-item {font-family: "GoudyAcc"} /* For title, sidebar character and scene */ .sheet header.sheet-header h1 input, .window-app .window-header, #actors .directory-list, #navigation #scene-list .scene.nav-item {font-family: "GoudyAcc"} /* For title, sidebar character and scene */
.sheet nav.sheet-tabs {font-family: "CaslonAntique";} /* For nav and title */ .sheet nav.sheet-tabs {
font-family: "CaslonAntique";
} /* For nav and title */
.window-app input, .foundryvtt-reve-de-dragon .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, .foundryvtt-reve-de-dragon .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-family: "CaslonAntique"; /* For sheet parts */ font-family: "CaslonAntique"; /* For sheet parts */
} }
@ -476,31 +486,31 @@ table {border: 1px solid #7a7971;}
.rdd-roll-part{ .rdd-roll-part{
align-items: center; align-items: center;
border-radius: 6px; padding: 3px; border-radius: 6px; padding: 3px;
background: linear-gradient(30deg, rgba(191, 149, 63, 0.3), rgba(252, 246, 186, 0.3), rgba(179, 135, 40, 0.3), rgba(251, 245, 183, 0.3), rgba(170, 119, 28, 0.3)); background: var(--gradient-gold);
} }
.rdd-roll-sign{ .rdd-roll-sign{
border-radius: 6px; padding: 3px; border-radius: 6px; padding: 3px;
background: linear-gradient(30deg, rgba(61, 55, 93, 0.3), rgba(178, 179, 196, 0.3), rgba(59, 62, 63, 0.6), rgba(206, 204, 199, 0.3), rgba(61, 46, 49, 0.3)); background: var(--gradient-silver);
} }
.rdd-roll-norm{ .rdd-roll-norm{
border-radius: 6px; padding: 3px; border-radius: 6px; padding: 3px;
background: linear-gradient(30deg, rgba(7, 76, 0, 0.3), rgba(66, 163, 65, 0.2), rgba(184, 226, 163, 0.1), rgba(66, 163, 65, 0.2), rgba(184, 226, 163, 0.3)); background: var(--gradient-silver-green);
} }
.rdd-roll-notSign, .rdd-roll-echec{ .rdd-roll-notSign, .rdd-roll-echec{
border-radius: 6px; padding: 3px; border-radius: 6px; padding: 3px;
background-image: linear-gradient(150deg, rgba(255, 0, 0, 0.3), rgba(255, 200, 128, 0.05),rgba(255, 200, 128, 0.1), rgba(255,10,0,0.3)); background: var(--gradient-red);
} }
.rdd-roll-epart{ .rdd-roll-epart{
border-radius: 6px; padding: 3px; border-radius: 6px; padding: 3px;
background:linear-gradient(150deg, rgba(100, 45, 124, 0.6), rgba(216, 157, 192, 0.3), rgba(177, 157, 216, 0.5), rgba(107, 62, 121, 0.3), rgba(100, 45, 124, 0.6)); background: var(--gradient-violet);
} }
.rdd-roll-etotal{ .rdd-roll-etotal{
border-radius: 6px; padding: 3px; border-radius: 6px; padding: 3px;
background:linear-gradient(150deg, rgba(0, 0, 0, 0.7), rgba(100, 45, 124, 0.4), rgba(82, 17, 131, 0.3),rgba(100, 45, 124, 0.4), rgba(0, 0, 0, 0.7)); background: var(--gradient-purple-black);
} }
.rdd-diviseur{ .rdd-diviseur{
border-radius: 6px; padding: 3px; border-radius: 6px; padding: 3px;
background:linear-gradient(30deg, rgba(61, 55, 93, 0.2), rgba(178, 179, 196, 0.1), rgba(59, 62, 63, 0.2), rgba(206, 204, 199, 0.1), rgba(61, 46, 49, 0.2)); background: var(--gradient-silver-light);
} }
.rdd-niveau-requis{ .rdd-niveau-requis{
@ -576,7 +586,7 @@ section.sheet-body{padding: 0.25rem 0.5rem;}
.sheet nav.sheet-tabs { .sheet nav.sheet-tabs {
font-size: 0.65rem; font-size: 0.65rem;
font-weight: bold; font-weight: bold;
height: 5rem; height: 4rem;
flex: 0 0 5rem; flex: 0 0 5rem;
margin: 0; margin: 0;
padding: 0 0 0 0.25rem; padding: 0 0 0 0.25rem;
@ -726,7 +736,16 @@ ul, li {
border-radius: 0.25rem; border-radius: 0.25rem;
padding: 0.125rem; padding: 0.125rem;
flex: 1 1 5rem; flex: 1 1 5rem;
background: linear-gradient(30deg, rgba(191, 149, 63, 0.5), rgba(252, 246, 186, 0.5), rgba(179, 135, 40, 0.5), rgba(251, 245, 183, 0.5), rgba(170, 119, 28, 0.3)) !important; background: var(--gradient-gold) !important;
}
.niveau-archetype {
background: var(--gradient-silver-light) !important;
}
.fa-arrow-alt-circle-up.allouer-stress {
color: rgba(83, 60, 14, 0.8);
}
.fa-arrow-alt-circle-up.allouer-stress-level-up {
color: rgba(191, 149, 63, 0.8);
} }
.blessures-list ul { .blessures-list ul {

View File

@ -21,16 +21,22 @@
value="{{numberFormat data.xp_sort decimals=0 sign=false}}" data-dtype="number" value="{{numberFormat data.xp_sort decimals=0 sign=false}}" data-dtype="number"
{{#unless @root.options.editCaracComp}}disabled{{/unless}}/> {{#unless @root.options.editCaracComp}}disabled{{/unless}}/>
{{/if}} {{/if}}
{{#if @root.options.montrerArchetype}} {{#if @root.options.vueDetaillee}}
<input class="competence-archetype" type="text" compname="{{name}}" name="comp-archetype-{{name}}" <div class="item-controls">
{{#if data.stressXpMax}}
<a class="item-control competence-stress-augmenter" compname="{{name}}"
title="Dépenser {{data.stressXpMax}} points de stress {{#if data.isStressLevelUp}} pour augmenter d'un niveau {{/if}}">
<i class="fas fa-arrow-alt-circle-up allouer-stress{{#if data.isStressLevelUp}}-level-up{{/if}}"></i>
</a>
{{/if}}
<input class="competence-archetype niveau-archetype" type="text" compname="{{name}}" name="comp-archetype-{{name}}"
value="{{numberFormat data.niveau_archetype decimals=0 sign=true}}" data-dtype="number" value="{{numberFormat data.niveau_archetype decimals=0 sign=true}}" data-dtype="number"
{{#unless @root.options.editCaracComp}}disabled{{/unless}} /> {{#unless @root.options.editCaracComp}}disabled{{/unless}} />
{{/if}}
{{#unless @root.options.hideControls}}
<div class="item-controls">
<a class="item-control item-edit" title="Modifier"><i class="fas fa-edit"></i></a> <a class="item-control item-edit" title="Modifier"><i class="fas fa-edit"></i></a>
{{#if @root.options.isGM}}
<a class="item-control item-delete" title="Supprimer"><i class="fas fa-trash"></i></a> <a class="item-control item-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
{{/if}}
</div> </div>
{{/unless}} {{/if}}
</li> </li>
{{/if}} {{/if}}

View File

@ -212,15 +212,14 @@
<span><a class="lock-unlock-sheet"><img class="small-button-container" <span><a class="lock-unlock-sheet"><img class="small-button-container"
src="systems/foundryvtt-reve-de-dragon/icons/{{#if options.editCaracComp}}unlocked.svg{{else}}locked.svg{{/if}}" alt="blocker/débloquer" src="systems/foundryvtt-reve-de-dragon/icons/{{#if options.editCaracComp}}unlocked.svg{{else}}locked.svg{{/if}}" alt="blocker/débloquer"
>{{#if options.editCaracComp}}Verrouiller{{else}}Déverrouiller{{/if}}</a></span> >{{#if options.editCaracComp}}Verrouiller{{else}}Déverrouiller{{/if}}</a></span>
<span><a id="show-hide-competences"><img class="small-button-container" <span><a class="show-hide-competences"><img class="small-button-container"
src="systems/foundryvtt-reve-de-dragon/icons/{{#if options.showCompNiveauBase}}no-filter.svg{{else}}filter.svg{{/if}}" alt="filter/montrer tout" src="systems/foundryvtt-reve-de-dragon/icons/{{#if options.showCompNiveauBase}}no-filter.svg{{else}}filter.svg{{/if}}" alt="filter/montrer tout">
>{{#if options.showCompNiveauBase}}Montrer tout{{else}}Filtrer{{/if}}</a></span> {{#if options.showCompNiveauBase}}Montrer tout{{else}}Filtrer{{/if}}</a>
<span><a id="show-hide-archetype"><img class="small-button-container" </span>
src="systems/foundryvtt-reve-de-dragon/icons/{{#if options.montrerArchetype}}no-filter.svg{{else}}filter.svg{{/if}}" alt="filter/montrer l'archétype" <span><a class="vue-detaillee">
>{{#if options.montrerArchetype}}Masquer l'archétype{{else}}Voir l'archétype{{/if}}</a></span> <i class="fas {{#if options.vueDetaillee}}fa-eye-slash{{else}}fa-eye{{/if}}"></i>
<span><a class="lock-unlock-controls"><i class="fas fa-lock{{#if options.hideControls}}-open{{/if}}"></i> {{#if options.vueDetaillee}}Vue simplifiée{{else}}Vue détaillée{{/if}}</a>
{{#if options.hideControls}}Contrôles On{{else}}Contrôles Off{{/if}} </span>
</a></span>
</div> </div>
<div class="grid grid-2col"> <div class="grid grid-2col">
<div class="flex-group-left flexcol competence-column"> <div class="flex-group-left flexcol competence-column">
@ -234,7 +233,7 @@
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-categorie-competences-partial.html" competences=(sortCompetence competenceByCategory.tir) categorie="Compétences de Tir"}} {{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-categorie-competences-partial.html" competences=(sortCompetence competenceByCategory.tir) categorie="Compétences de Tir"}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-categorie-competences-partial.html" competences=(sortCompetence competenceByCategory.lancer) categorie="Compétences de Lancer"}} {{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-categorie-competences-partial.html" competences=(sortCompetence competenceByCategory.lancer) categorie="Compétences de Lancer"}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-categorie-competences-partial.html" competences=(sortCompetence competenceByCategory.connaissance) categorie="Connaissances"}} {{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-categorie-competences-partial.html" competences=(sortCompetence competenceByCategory.connaissance) categorie="Connaissances"}}
{{#if (or data.attributs.hautrevant.value options.montrerArchetype)}} {{#if (or data.attributs.hautrevant.value options.vueDetaillee)}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-categorie-competences-partial.html" competences=(sortCompetence competenceByCategory.draconic) categorie="Draconic"}} {{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-categorie-competences-partial.html" competences=(sortCompetence competenceByCategory.draconic) categorie="Draconic"}}
{{/if}} {{/if}}
@ -249,11 +248,14 @@
<span class="generic-label">Total XP compétences</span> <span class="generic-label">Total XP compétences</span>
<span class="competence-value">{{calc.competenceXPTotal}}</span> <span class="competence-value">{{calc.competenceXPTotal}}</span>
</li> </li>
{{#if options.montrerArchetype}} {{#if options.vueDetaillee}}
<li>Niveaux d'archétype à répartir</li>
{{#each calc.comptageArchetype as |archetype key|}} {{#each calc.comptageArchetype as |archetype key|}}
{{#if (lt archetype.nombre archetype.nombreMax)}}
<li class="item flexrow"> <li class="item flexrow">
<label class="generic-label">Archetype {{archetype.niveau}} : {{archetype.nombre}} / {{archetype.nombreMax}}</label> <label class="generic-label">Archetype {{archetype.niveau}} : {{archetype.nombre}} / {{archetype.nombreMax}}</label>
</li> </li>
{{/if}}
{{/each}} {{/each}}
{{/if}} {{/if}}
</ul> </ul>

View File

@ -32,11 +32,15 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="base">Niveau de base </label> <label for="base">Niveau de base </label>
{{#if isGM}}
<select name="data.base" id="base" data-dtype="Number"> <select name="data.base" id="base" data-dtype="Number">
{{#select data.base}} {{#select data.base}}
{{>"systems/foundryvtt-reve-de-dragon/templates/competence-base.html"}} {{>"systems/foundryvtt-reve-de-dragon/templates/competence-base.html"}}
{{/select}} {{/select}}
</select> </select>
{{else}}
<label id="base">{{data.base}}</label>
{{/if}}
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="defaut_carac">Caractéristique par défaut </label> <label for="defaut_carac">Caractéristique par défaut </label>

View File

@ -1,10 +1,10 @@
<h3>Dés spéciaux</h3> <h3>Dés spéciaux</h3>
<ul class="alterne-list"> <ul class="alterne-list">
<li class="list-item"> <li class="list-item">
<strong>/roll 1d7</strong>: lance un dé de rencontre <strong>/roll 1dt</strong>: lance un dé de rencontre dans les TMR
</li> </li>
<li class="list-item"> <li class="list-item">
<strong>/roll 1dr</strong>: lance un dé draconique (de 0à 7, relance et additionne en cas de 7) <strong>/roll 1dr</strong>: lance un dé draconique (de 0 à 7, relance et additionne en cas de 7)
</li> </li>
<li class="list-item"> <li class="list-item">
<strong>/roll 1dh</strong>: lance le dé des heures (de 1 à 12) <strong>/roll 1dh</strong>: lance le dé des heures (de 1 à 12)