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 }],
editCaracComp: false,
showCompNiveauBase: false,
montrerArchetype: false,
hideControls: true
vueDetaillee: false
});
}
@ -80,7 +79,7 @@ export class RdDActorSheet extends ActorSheet {
formData.competences.forEach(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 => {
@ -277,52 +276,34 @@ export class RdDActorSheet extends ActorSheet {
// Roll Skill
html.find('a.competence-label').click(async event => {
let compName = event.currentTarget.name;
this.actor.rollCompetence(compName);
this.actor.rollCompetence(this._getItemId(event));
});
html.find('.tache-label a').click(async event => {
const li = $(event.currentTarget).parents(".item");
let tacheId = li.data('item-id');
this.actor.rollTache(tacheId);
this.actor.rollTache(this._getItemId(event));
});
html.find('.meditation-label a').click(async event => {
const li = $(event.currentTarget).parents(".item");
let meditationId = li.data('item-id');
this.actor.rollMeditation(meditationId);
this.actor.rollMeditation(this._getItemId(event));
});
html.find('.chant-label a').click(async event => {
const li = $(event.currentTarget).parents(".item");
let chantId = li.data('item-id');
this.actor.rollChant(chantId);
this.actor.rollChant(this._getItemId(event));
});
html.find('.danse-label a').click(async event => {
const li = $(event.currentTarget).parents(".item");
let danseId = li.data('item-id');
this.actor.rollDanse(danseId);
this.actor.rollDanse(this._getItemId(event));
});
html.find('.musique-label a').click(async event => {
const li = $(event.currentTarget).parents(".item");
let musiqueId = li.data('item-id');
this.actor.rollMusique(musiqueId);
this.actor.rollMusique(this._getItemId(event));
});
html.find('.oeuvre-label a').click(async event => {
const li = $(event.currentTarget).parents(".item");
let oeuvreId = li.data('item-id');
this.actor.rollOeuvre(oeuvreId);
this.actor.rollOeuvre(this._getItemId(event));
});
html.find('.jeu-label a').click(async event => {
const li = $(event.currentTarget).parents(".item");
let jeuId = li.data('item-id');
this.actor.rollJeu(jeuId);
this.actor.rollJeu(this._getItemId(event));
});
html.find('.recettecuisine-label a').click(async event => {
const li = $(event.currentTarget).parents(".item");
let recetteId = li.data('item-id');
this.actor.rollRecetteCuisine(recetteId);
this.actor.rollRecetteCuisine(this._getItemId(event));
});
html.find('.subacteur-label a').click(async event => {
const li = $(event.currentTarget).parents(".item");
let actorId = li.data('actor-id');
let actorId = this._getEventItemData(event, 'actor-id');
let actor = game.actors.get(actorId);
if (actor) {
actor.sheet.render(true);
@ -344,16 +325,14 @@ export class RdDActorSheet extends ActorSheet {
// Roll Weapon1
html.find('.arme-label a').click(async event => {
const li = $(event.currentTarget).parents(".item");
let arme = this._getArmeCombat(li);
let arme = this._getEventArmeCombat(event);
this.actor.rollArme( duplicate(arme) );
});
// Initiative pour l'arme
html.find('.arme-initiative a').click(async event => {
let combatant = game.combat.data.combatants.find(c => c.actor.data._id == this.actor.data._id);
if (combatant) {
const li = $(event.currentTarget).parents(".item");
let arme = this._getArmeCombat(li);
let arme = this._getEventArmeCombat(event);
RdDCombatManager.rollInitiativeCompetence(combatant._id, arme);
} else {
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();
});
html.find('.conteneur-name a').click(async event => {
let myID = event.currentTarget.attributes['data-item-id'].value;
RdDUtility.toggleAfficheContenu(myID);
RdDUtility.toggleAfficheContenu(this._getItemId(event));
this.render(true);
});
html.find('.carac-xp-augmenter').click(async event => {
@ -394,10 +372,12 @@ export class RdDActorSheet extends ActorSheet {
this.actor.updateCaracXPAuto(caracName);
});
html.find('.competence-xp-augmenter').click(async event => {
let compName = event.currentTarget.attributes.compname.value;
this.actor.updateCompetenceXPAuto(compName);
this.actor.updateCompetenceXPAuto(this._getItemId(event));
});
html.find('.competence-stress-augmenter').click(async event => {
this.actor.updateCompetenceStress(this._getItemId(event));
});
if (this.options.editCaracComp) {
// On carac change
html.find('.carac-value').change(async event => {
@ -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.render(true);
});
@ -441,13 +421,9 @@ export class RdDActorSheet extends ActorSheet {
this.options.editCaracComp = !this.options.editCaracComp;
this.render(true);
});
html.find('#show-hide-archetype').click(async event => {
this.options.montrerArchetype = !this.options.montrerArchetype;
this.render(true);
});
html.find('.lock-unlock-controls').click(async event => {
console.log("CONTROLS", this.options.hideControls)
this.options.hideControls = !this.options.hideControls;
html.find('.vue-detaillee').click(async event => {
console.log("CONTROLS", this.options.vueDetaillee)
this.options.vueDetaillee = !this.options.vueDetaillee;
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 compName = li.data('competence-name');
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) {
let competence = this.getCompetence(compName);
async updateCompetenceXPAuto(idOrName) {
let competence = this.getCompetence(idOrName);
if (competence) {
let compData = Misc.data(competence);
let xp = Number(compData.data.xp);
@ -914,35 +914,65 @@ export class RdDActor extends Actor {
xp -= RdDItemCompetence.getCompetenceNextXp(niveau);
niveau++;
}
competence.update({
await competence.update({
"data.xp": xp,
"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) {
let comp = this.getCompetence(compName);
if (comp) {
const update = { _id: comp.id }
async updateCreatureCompetence(idOrName, fieldName, compValue) {
let competence = this.getCompetence(idOrName);
if (competence) {
const update = { _id: competence.id }
if (fieldName == "niveau")
update['data.niveau'] = compValue;
else if (fieldName == "dommages")
update['data.dommages'] = compValue;
else
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) {
let comp = this.getCompetence(compName);
if (comp) {
let troncList = RdDItemCompetence.isTronc(compName);
let nouveauNiveau = compValue ?? RdDItemCompetence.getNiveauBase(Misc.data(comp).data.categorie);
async updateCompetence(idOrName, compValue) {
let competence = this.getCompetence(idOrName);
if (competence) {
let troncList = RdDItemCompetence.isTronc(competence.name);
let nouveauNiveau = compValue ?? RdDItemCompetence.getNiveauBase(Misc.data(competence).data.categorie);
if (troncList) {
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) {
@ -953,50 +983,50 @@ export class RdDActor extends Actor {
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
} else {
console.log("Competence not found", compName);
console.log("Competence not found", idOrName);
}
}
/* -------------------------------------------- */
async updateCompetenceXP(compName, newXp) {
let comp = this.getCompetence(compName);
if (comp) {
async updateCompetenceXP(idOrName, newXp) {
let competence = this.getCompetence(idOrName);
if (competence) {
if (isNaN(newXp) || typeof (newXp) != 'number') newXp = 0;
this.checkCompetenceXP(compName, newXp);
const update = { _id: comp.id, 'data.xp': newXp };
this.checkCompetenceXP(idOrName, newXp);
const update = { _id: competence.id, 'data.xp': newXp };
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 {
console.log("Competence not found", compName);
console.log("Competence not found", idOrName);
}
RdDUtility.checkThanatosXP(compName);
RdDUtility.checkThanatosXP(idOrName);
}
/* -------------------------------------------- */
async updateCompetenceXPSort(compName, compValue) {
let comp = this.getCompetence(compName);
if (comp) {
async updateCompetenceXPSort(idOrName, compValue) {
let competence = this.getCompetence(idOrName);
if (competence) {
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
this.updateExperienceLog("XP Sort", compValue, "XP modifié en sort de " + compName);
this.updateExperienceLog("XP Sort", compValue, "XP modifié en sort de " + competence.name);
} else {
console.log("Competence not found", compName);
console.log("Competence not found", idOrName);
}
}
/* -------------------------------------------- */
async updateCompetenceArchetype(compName, compValue) {
let comp = this.getCompetence(compName);
if (comp) {
async updateCompetenceArchetype(idOrName, compValue) {
let competence = this.getCompetence(idOrName);
if (competence) {
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
} 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) {
let rollData = { competence: Misc.data(this.getCompetence(name)) }
async rollCompetence(idOrName) {
let rollData = { competence: Misc.data(this.getCompetence(idOrName)) }
//console.log("COMP CREATURE", name, rollData, name);
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' }, {
name: 'jet-competence',
label: 'Jet ' + Grammar.apostrophe('de', name),
label: 'Jet ' + Grammar.apostrophe('de', rollData.competence.name),
callbacks: [
this.createCallbackExperience(),
this.createCallbackAppelAuMoral(),
@ -2588,15 +2618,16 @@ export class RdDActor extends Actor {
rollData.appliquerFatigue = ReglesOptionelles.isUsing("appliquer-fatigue");
rollData.tache = duplicate(rollData.tache);
rollData.tache.data.points_de_tache_courant += rollData.rolled.ptTache;
rollData.tache.data.tentatives++;
if (rollData.rolled.isETotal) {
rollData.tache.data.difficulte--;
}
if (rollData.rolled.isSuccess) {
rollData.tache.data.nb_jet_succes = rollData.tache.data.nb_jet_succes + 1;
rollData.tache.data.nb_jet_succes++;
} 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.santeIncDec("fatigue", rollData.tache.data.fatigue);

View File

@ -84,7 +84,7 @@ export class RdDItemCompetence extends Item {
/* -------------------------------------------- */
static getVoieDraconic(competences, voie) {
return RdDItemCompetence.findCompetence(competences.filter(it => RdDItemCompetence.isDraconic(it) ), voie);
return RdDItemCompetence.findCompetence(competences.filter(it => RdDItemCompetence.isDraconic(it)), voie);
}
/* -------------------------------------------- */
@ -145,11 +145,11 @@ export class RdDItemCompetence extends Item {
static computeEconomieXPTronc(competences) {
return competenceTroncs.map(
list => list.map(name => RdDItemCompetence.findCompetence(competences, name))
// 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)))
.sort(Misc.ascending())
.splice(0, list.length-1) // prendre toutes les valeurs sauf l'une des plus élevées
.reduce(Misc.sum(), 0)
// 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)))
.sort(Misc.ascending())
.splice(0, list.length - 1) // prendre toutes les valeurs sauf l'une des plus élevées
.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];
}
/* -------------------------------------------- */
static computeCompetenceXPCost(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.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]);
/** De7 pour les jets de rencontre */
export class De7 extends Die {
/** De pour les jets de rencontre */
export class DeTMR extends Die {
/** @override */
static DENOMINATION = "7";
static DENOMINATION = "t";
static diceSoNiceData(system) {
return {
type: "d7",
type: "dt",
font: "HeuresDraconiques",
fontScale: 0.7,
labels: ['1', '2', '3', '4', '5', '6', 'd', '0'],
@ -119,7 +119,7 @@ export class DeHeure extends Die {
export class RdDDice {
static init() {
CONFIG.Dice.terms[De7.DENOMINATION] = De7;
CONFIG.Dice.terms[DeTMR.DENOMINATION] = DeTMR;
CONFIG.Dice.terms[DeDraconique.DENOMINATION] = DeDraconique;
CONFIG.Dice.terms[DeHeure.DENOMINATION] = DeHeure;
}
@ -153,7 +153,7 @@ export class RdDDice {
static diceSoNiceReady(dice3d) {
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(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 myRoll = await RdDDice.rollTotal("1d7");
let myRoll = await RdDDice.rollTotal("1dt");
if (TMRUtility.isForceRencontre() || myRoll == 7) {
this._tellToUser(myRoll + ": Rencontre en " + locTMR);
return await this.rencontreTMRRoll(tmr, this.actor.isRencontreSpeciale());

File diff suppressed because one or more lines are too long

View File

@ -28,44 +28,52 @@
font-weight: normal;
font-style: normal;
}
:root {
/* =================== 1. ACTOR SHEET FONT STYLES =========== */
--window-header-title-font-family: CaslonAntique;
--window-header-title-font-size: 1.5rem;
--window-header-title-font-weight: normal;
--window-header-title-color: #f5f5f5;
:root {
/* =================== 1. ACTOR SHEET FONT STYLES =========== */
--window-header-title-font-family: CaslonAntique;
--window-header-title-font-size: 1.5rem;
--window-header-title-font-weight: normal;
--window-header-title-color: #f5f5f5;
--major-button-font-family: CaslonAntique;
--major-button-font-size: 1.25rem;
--major-button-font-weight: normal;
--major-button-color: #dadada;
--major-button-font-family: CaslonAntique;
--major-button-font-size: 1.25rem;
--major-button-font-weight: normal;
--major-button-color: #dadada;
--tab-header-font-family: CaslonAntique;
--tab-header-font-size: 1.2rem;
--tab-header-font-weight: 700;
--tab-header-color: #403f3e;
--tab-header-color-active: #4a0404;
--tab-header-font-family: CaslonAntique;
--tab-header-font-size: 1.2rem;
--tab-header-font-weight: 700;
--tab-header-color: #403f3e;
--tab-header-color-active: #4a0404;
--actor-input-font-family: CaslonAntique;
--actor-input-font-size: 1.2rem;
--actor-input-font-weight: 500;
--actor-input-color: black;
--actor-input-font-family: CaslonAntique;
--actor-input-font-size: 1.2rem;
--actor-input-font-weight: 500;
--actor-input-color: black;
--actor-label-font-family: CaslonAntique;
--actor-label-font-size: 1.2rem;
--actor-label-font-weight: 700;
--actor-label-color: #464331c4;
--actor-label-font-family: CaslonAntique;
--actor-label-font-size: 1.2rem;
--actor-label-font-weight: 700;
--actor-label-color: #464331c4;
/* =================== 2. DEBUGGING HIGHLIGHTERS ============ */
--debug-background-color-red: #ff000054;
--debug-background-color-blue: #1d00ff54;
--debug-background-color-green: #54ff0054;
/* =================== 2. DEBUGGING HIGHLIGHTERS ============ */
--debug-background-color-red: #ff000054;
--debug-background-color-blue: #1d00ff54;
--debug-background-color-green: #54ff0054;
--debug-box-shadow-red: inset 0 0 2px red;
--debug-box-shadow-blue: inset 0 0 2px blue;
--debug-box-shadow-green: inset 0 0 2px green;
--debug-box-shadow-red: inset 0 0 2px red;
--debug-box-shadow-blue: inset 0 0 2px blue;
--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");*/
/* Global styles & Font */
@ -78,7 +86,9 @@
/* 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 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 {
font-family: "CaslonAntique"; /* For sheet parts */
}
@ -476,31 +486,31 @@ table {border: 1px solid #7a7971;}
.rdd-roll-part{
align-items: center;
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{
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{
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{
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{
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{
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{
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{
@ -576,7 +586,7 @@ section.sheet-body{padding: 0.25rem 0.5rem;}
.sheet nav.sheet-tabs {
font-size: 0.65rem;
font-weight: bold;
height: 5rem;
height: 4rem;
flex: 0 0 5rem;
margin: 0;
padding: 0 0 0 0.25rem;
@ -720,13 +730,22 @@ ul, li {
.alterne-list > .list-item:nth-child(odd) {
background: rgb(160, 130, 100, 0.05);
}
.xp-level-up {
.xp-level-up {
margin: 0.125rem;
box-shadow: inset 0px 0px 1px #00000096;
border-radius: 0.25rem;
padding: 0.125rem;
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 {

View File

@ -21,16 +21,22 @@
value="{{numberFormat data.xp_sort decimals=0 sign=false}}" data-dtype="number"
{{#unless @root.options.editCaracComp}}disabled{{/unless}}/>
{{/if}}
{{#if @root.options.montrerArchetype}}
<input class="competence-archetype" type="text" compname="{{name}}" name="comp-archetype-{{name}}"
value="{{numberFormat data.niveau_archetype decimals=0 sign=true}}" data-dtype="number"
{{#unless @root.options.editCaracComp}}disabled{{/unless}} />
{{/if}}
{{#unless @root.options.hideControls}}
{{#if @root.options.vueDetaillee}}
<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"
{{#unless @root.options.editCaracComp}}disabled{{/unless}} />
<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>
{{/if}}
</div>
{{/unless}}
{{/if}}
</li>
{{/if}}

View File

@ -212,15 +212,14 @@
<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"
>{{#if options.editCaracComp}}Verrouiller{{else}}Déverrouiller{{/if}}</a></span>
<span><a id="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"
>{{#if options.showCompNiveauBase}}Montrer tout{{else}}Filtrer{{/if}}</a></span>
<span><a id="show-hide-archetype"><img class="small-button-container"
src="systems/foundryvtt-reve-de-dragon/icons/{{#if options.montrerArchetype}}no-filter.svg{{else}}filter.svg{{/if}}" alt="filter/montrer l'archétype"
>{{#if options.montrerArchetype}}Masquer l'archétype{{else}}Voir l'archétype{{/if}}</a></span>
<span><a class="lock-unlock-controls"><i class="fas fa-lock{{#if options.hideControls}}-open{{/if}}"></i>
{{#if options.hideControls}}Contrôles On{{else}}Contrôles Off{{/if}}
</a></span>
<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">
{{#if options.showCompNiveauBase}}Montrer tout{{else}}Filtrer{{/if}}</a>
</span>
<span><a class="vue-detaillee">
<i class="fas {{#if options.vueDetaillee}}fa-eye-slash{{else}}fa-eye{{/if}}"></i>
{{#if options.vueDetaillee}}Vue simplifiée{{else}}Vue détaillée{{/if}}</a>
</span>
</div>
<div class="grid grid-2col">
<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.lancer) categorie="Compétences de Lancer"}}
{{> "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"}}
{{/if}}
@ -249,11 +248,14 @@
<span class="generic-label">Total XP compétences</span>
<span class="competence-value">{{calc.competenceXPTotal}}</span>
</li>
{{#if options.montrerArchetype}}
{{#if options.vueDetaillee}}
<li>Niveaux d'archétype à répartir</li>
{{#each calc.comptageArchetype as |archetype key|}}
{{#if (lt archetype.nombre archetype.nombreMax)}}
<li class="item flexrow">
<label class="generic-label">Archetype {{archetype.niveau}} : {{archetype.nombre}} / {{archetype.nombreMax}}</label>
</li>
{{/if}}
{{/each}}
{{/if}}
</ul>

View File

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

View File

@ -1,10 +1,10 @@
<h3>Dés spéciaux</h3>
<ul class="alterne-list">
<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 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 class="list-item">
<strong>/roll 1dh</strong>: lance le dé des heures (de 1 à 12)