Rework arts
This commit is contained in:
parent
d612b74675
commit
1875530b1c
211
module/actor.js
211
module/actor.js
@ -2013,129 +2013,87 @@ export class RdDActor extends Actor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async rollChant( id ) {
|
async _rollArt(artData, selectedCarac, competence, oeuvre) {
|
||||||
let chant = duplicate(this.getChant(id));
|
mergeObject(artData, {
|
||||||
let competence = duplicate(this.getCompetence("chant"));
|
oeuvre: oeuvre,
|
||||||
competence.data.defaut_carac = "ouie";
|
competence: duplicate(competence),
|
||||||
let chantData = {
|
diffLibre: -oeuvre.data.niveau,
|
||||||
competence: competence,
|
|
||||||
chant: chant,
|
|
||||||
diffLibre: -chant.data.niveau,
|
|
||||||
diffConditions: 0,
|
|
||||||
use: { libre: false, conditions: true, },
|
|
||||||
carac: {}
|
|
||||||
};
|
|
||||||
chantData.carac["ouie"] = duplicate(this.data.data.carac["ouie"]);
|
|
||||||
|
|
||||||
console.log("rollChant !!!", chantData);
|
|
||||||
|
|
||||||
const dialog = await RdDRoll.create(this, chantData, { html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-chant.html' }, {
|
|
||||||
name: 'jet-chant',
|
|
||||||
label: 'Chanter ' + chant.name,
|
|
||||||
height: 600,
|
|
||||||
callbacks: [
|
|
||||||
this.createCallbackExperience(),
|
|
||||||
{ action: r => this._chantResult(r) }
|
|
||||||
]
|
|
||||||
});
|
|
||||||
dialog.render(true);
|
|
||||||
}
|
|
||||||
/* -------------------------------------------- */
|
|
||||||
async _chantResult(chantData) {
|
|
||||||
if ( chantData.rolled.isSuccess) {
|
|
||||||
chantData.qualiteFinale = chantData.danse.data.niveau + chantData.rolled.ptQualite;
|
|
||||||
} else {
|
|
||||||
chantData.qualiteFinale = chantData.competence.data.niveau + chantData.rolled.ptQualite;
|
|
||||||
}
|
|
||||||
console.log("CHAN", chantData)
|
|
||||||
RdDResolutionTable.displayRollData(chantData, this.name, 'chat-resultat-chant.html');
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
|
||||||
async rollDanse( id ) {
|
|
||||||
let danse = duplicate(this.getDanse(id));
|
|
||||||
let competence = duplicate(this.getCompetence("danse"));
|
|
||||||
let danseData = {
|
|
||||||
competence: competence,
|
|
||||||
danse: danse,
|
|
||||||
diffLibre: -danse.data.niveau,
|
|
||||||
diffConditions: 0,
|
diffConditions: 0,
|
||||||
use: { libre: false, conditions: true, },
|
use: { libre: false, conditions: true, },
|
||||||
|
selectedCarac: duplicate(this.data.data.carac[selectedCarac]),
|
||||||
forceCarac: {}
|
forceCarac: {}
|
||||||
};
|
});
|
||||||
if ( danse.data.agilite) {
|
artData.competence.data.defaut_carac = selectedCarac;
|
||||||
competence.data.defaut_carac = "agilite";
|
artData.forceCarac[selectedCarac] = duplicate(this.data.data.carac[selectedCarac]);
|
||||||
danseData.selectedCarac = duplicate(this.data.data.carac["agilite"]);
|
|
||||||
danseData.forceCarac["agilite"] = duplicate(this.data.data.carac["agilite"]);
|
|
||||||
}
|
|
||||||
if ( danse.data.apparence) {
|
|
||||||
competence.data.defaut_carac = "apparence";
|
|
||||||
danseData.selectedCarac = duplicate(this.data.data.carac["apparence"]);
|
|
||||||
danseData.forceCarac["apparence"] = duplicate(this.data.data.carac["apparence"]);
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log("rollDanse !!!", danseData);
|
console.log("rollArtiste !!!", artData);
|
||||||
|
|
||||||
const dialog = await RdDRoll.create(this, danseData, { html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-danse.html' }, {
|
const dialog = await RdDRoll.create(this, artData, { html: `systems/foundryvtt-reve-de-dragon/templates/dialog-roll-${artData.art}.html` }, {
|
||||||
name: 'jet-danse',
|
name: `jet-${artData.art}`,
|
||||||
label: 'Danser ' + danse.name,
|
label: `${artData.verbe} ${oeuvre.name}`,
|
||||||
height: 600,
|
height: 600,
|
||||||
callbacks: [
|
callbacks: [
|
||||||
this.createCallbackExperience(),
|
this.createCallbackExperience(),
|
||||||
{ action: r => this._danseResult(r) }
|
{ action: r => this._resultArt(r) }
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
dialog.render(true);
|
dialog.render(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async _danseResult(danseData) {
|
async _resultArt(artData) {
|
||||||
if ( danseData.rolled.isSuccess) {
|
const baseQualite = (artData.rolled.isSuccess ? artData.oeuvre.data.niveau : artData.competence.data.niveau);
|
||||||
danseData.qualiteFinale = danseData.danse.data.niveau + danseData.rolled.ptQualite;
|
artData.qualiteFinale = Math.min(baseQualite, artData.oeuvre.data.niveau) + artData.rolled.ptQualite;
|
||||||
} else {
|
|
||||||
danseData.qualiteFinale = danseData.competence.data.niveau + danseData.rolled.ptQualite;
|
console.log("OEUVRE", artData.art, artData)
|
||||||
}
|
RdDResolutionTable.displayRollData(artData, this.name, `chat-resultat-${artData.art}.html`);
|
||||||
console.log("CHAN", danseData)
|
|
||||||
RdDResolutionTable.displayRollData(danseData, this.name, 'chat-resultat-danse.html');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async rollMusique( id ) {
|
async rollDanse(id) {
|
||||||
let musique = duplicate(this.getMusique(id));
|
const oeuvre = duplicate(this.getDanse(id));
|
||||||
let competence = duplicate(this.getCompetence("musique"));
|
const competence = this.getCompetence("danse");
|
||||||
competence.data.defaut_carac = "ouie";
|
const selectedCarac = this._getCaracDanse(oeuvre, competence);
|
||||||
let musiqueData = {
|
const artData = { art: 'danse', verbe: 'Danser' };
|
||||||
competence: competence,
|
await this._rollArt(artData, selectedCarac, competence, oeuvre);
|
||||||
musique: musique,
|
}
|
||||||
diffLibre: -musique.data.niveau,
|
|
||||||
diffConditions: 0,
|
_getCaracDanse(oeuvre, competence) {
|
||||||
use: { libre: false, conditions: true, },
|
if (oeuvre.data.agilite) { return "agilite"; }
|
||||||
carac: {}
|
else if (oeuvre.data.apparence) { return "apparence"; }
|
||||||
};
|
return competence.data.defaut_carac;
|
||||||
musiqueData.carac["ouie"] = duplicate(this.data.data.carac["ouie"]);
|
}
|
||||||
|
|
||||||
console.log("rollMusique !!!", musiqueData);
|
/* -------------------------------------------- */
|
||||||
|
async rollMusique(id) {
|
||||||
|
const oeuvre = duplicate(this.getMusique(id));
|
||||||
|
const competence = this.getCompetence("musique");
|
||||||
|
const selectedCarac = "ouie";
|
||||||
|
const artData = { art: 'musique', verbe: 'Jouer' };
|
||||||
|
await this._rollArt(artData, selectedCarac, competence, oeuvre);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
async rollRecetteCuisine(id) {
|
||||||
|
const oeuvre = duplicate(this.getRecetteCuisine(id));
|
||||||
|
const competence = this.getCompetence("cuisine");
|
||||||
|
const selectedCarac = 'odoratgout';
|
||||||
|
const artData = { art: 'cuisine', verbe: 'Cuisiner' };
|
||||||
|
await this._rollArt(artData, selectedCarac, competence, oeuvre);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
async rollJeu(id) {
|
||||||
|
const oeuvre = duplicate(this.getJeu(id));
|
||||||
|
const competence = this.getCompetence("jeu");
|
||||||
|
const selectedCarac = competence.data.defaut_carac;
|
||||||
|
const artData = {
|
||||||
|
art: 'jeu', verbe: 'Jeu',
|
||||||
|
use: { libre: true, conditions: true, },
|
||||||
|
};
|
||||||
|
await this._rollArt(artData, selectedCarac, competence, oeuvre);
|
||||||
|
}
|
||||||
|
|
||||||
const dialog = await RdDRoll.create(this, musiqueData, { html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-musique.html' }, {
|
|
||||||
name: 'jet-musique',
|
|
||||||
label: 'Jouer ' + musique.name,
|
|
||||||
height: 600,
|
|
||||||
callbacks: [
|
|
||||||
this.createCallbackExperience(),
|
|
||||||
{ action: r => this._musiqueResult(r) }
|
|
||||||
]
|
|
||||||
});
|
|
||||||
dialog.render(true);
|
|
||||||
}
|
|
||||||
/* -------------------------------------------- */
|
|
||||||
async _musiqueResult(musiqueData) {
|
|
||||||
if ( musiqueData.rolled.isSuccess) {
|
|
||||||
musiqueData.qualiteFinale = musiqueData.musique.data.niveau + musiqueData.rolled.ptQualite;
|
|
||||||
} else {
|
|
||||||
musiqueData.qualiteFinale = musiqueData.competence.data.niveau + musiqueData.rolled.ptQualite;
|
|
||||||
}
|
|
||||||
console.log("MUSIQUE", musiqueData)
|
|
||||||
RdDResolutionTable.displayRollData(musiqueData, this.name, 'chat-resultat-musique.html');
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async rollJeu( id ) {
|
async rollJeu( id ) {
|
||||||
@ -2169,46 +2127,7 @@ export class RdDActor extends Actor {
|
|||||||
RdDResolutionTable.displayRollData(jeudData, this.name, 'chat-resultat-jeu.html');
|
RdDResolutionTable.displayRollData(jeudData, this.name, 'chat-resultat-jeu.html');
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
|
||||||
async rollRecetteCuisine( id ) {
|
|
||||||
let cuisine = duplicate(this.getRecetteCuisine(id));
|
|
||||||
let competence = duplicate(this.getCompetence("cuisine"));
|
|
||||||
competence.data.defaut_carac = "odoratgout";
|
|
||||||
let cuisineData = {
|
|
||||||
competence: competence,
|
|
||||||
cuisine: cuisine,
|
|
||||||
diffLibre: -cuisine.data.niveau,
|
|
||||||
diffConditions: 0,
|
|
||||||
use: { libre: true, conditions: true, },
|
|
||||||
carac: {}
|
|
||||||
};
|
|
||||||
cuisineData.carac["odoratgout"] = duplicate(this.data.data.carac["odoratgout"]);
|
|
||||||
|
|
||||||
console.log("rollRecetteCuisine !!!", cuisineData);
|
|
||||||
|
|
||||||
const dialog = await RdDRoll.create(this, cuisineData, { html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-cuisine.html' }, {
|
|
||||||
name: 'jet-jeu',
|
|
||||||
label: 'Cuisiner ' + cuisine.name,
|
|
||||||
height: 600,
|
|
||||||
callbacks: [
|
|
||||||
this.createCallbackExperience(),
|
|
||||||
{ action: r => this._recetteCuisineResult(r) }
|
|
||||||
]
|
|
||||||
});
|
|
||||||
dialog.render(true);
|
|
||||||
}
|
|
||||||
/* -------------------------------------------- */
|
|
||||||
async _recetteCuisineResult(cuisineData) {
|
|
||||||
if ( cuisineData.rolled.isSuccess) {
|
|
||||||
cuisineData.qualiteFinale = cuisineData.cuisine.data.niveau + cuisineData.rolled.ptQualite;
|
|
||||||
} else {
|
|
||||||
cuisineData.qualiteFinale = cuisineData.competence.data.niveau + cuisineData.rolled.ptQualite;
|
|
||||||
}
|
|
||||||
console.log("Cuisine", cuisineData)
|
|
||||||
RdDResolutionTable.displayRollData(cuisineData, this.name, 'chat-resultat-cuisine.html');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async rollMeditation(id) {
|
async rollMeditation(id) {
|
||||||
let meditation = duplicate(this.getMeditation(id));
|
let meditation = duplicate(this.getMeditation(id));
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<img class="chat-icon" src="systems/foundryvtt-reve-de-dragon/icons/competence_chant.png" alt="chant" />
|
<img class="chat-icon" src="systems/foundryvtt-reve-de-dragon/icons/competence_chant.png" alt="chant" />
|
||||||
<h4>
|
<h4>
|
||||||
{{alias}} tente de chanter la chanson : {{chant.name}} (niveau {{chant.data.niveau}})
|
{{alias}} tente de chanter la chanson : {{oeuvre.name}} (niveau {{oeuvre.data.niveau}})
|
||||||
</h4>
|
</h4>
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-infojet.html"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-infojet.html"}}
|
||||||
<hr>
|
<hr>
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
<img class="chat-icon" src="systems/foundryvtt-reve-de-dragon/icons/competence_cuisine.webp" alt="cuisine" />
|
<img class="chat-icon" src="systems/foundryvtt-reve-de-dragon/icons/competence_cuisine.webp" alt="cuisine" />
|
||||||
<h4>
|
<h4>
|
||||||
{{alias}} tente cuisiner la recette : {{cuisine.name}} (niveau {{cuisine.data.niveau}})
|
{{alias}} tente de cuisiner la recette : {{oeuvre.name}} (niveau {{oeuvre.data.niveau}})
|
||||||
</h4>
|
</h4>
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-infojet.html"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-infojet.html"}}
|
||||||
<hr>
|
<hr>
|
||||||
<div>
|
<div>
|
||||||
{{#if rolled.isSuccess}}
|
{{#if rolled.isSuccess}}
|
||||||
{{alias}} réussit sa cuisine, avec un plat de {{qualiteFinale}} pour {{cuisine.data.sust}} Points de Sustentation.
|
{{alias}} réussit sa recette, avec un plat de {{qualiteFinale}} pour {{oeuvre.data.sust}} Points de Sustentation.
|
||||||
{{else}}
|
{{else}}
|
||||||
{{alias}} fait un pière cuisinier(e), et obtient une qualité de {{qualiteFinale}}. Selon la décision du MJ, le plat peut fournir {{cuisine.data.sust}} Points de Sustentation
|
{{alias}} fait un pière cuisinier(e), et obtient une qualité de {{qualiteFinale}}. Selon la décision du MJ, le plat peut fournir {{oeuvre.data.sust}} Points de Sustentation
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<img class="chat-icon" src="systems/foundryvtt-reve-de-dragon/icons/competence_danse.webp" alt="danse" />
|
<img class="chat-icon" src="systems/foundryvtt-reve-de-dragon/icons/competence_danse.webp" alt="danse" />
|
||||||
<h4>
|
<h4>
|
||||||
{{alias}} tente de danser : {{danse.name}} (niveau {{danse.data.niveau}})
|
{{alias}} tente de danser : {{oeuvre.name}} (niveau {{oeuvre.data.niveau}})
|
||||||
</h4>
|
</h4>
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-infojet.html"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-infojet.html"}}
|
||||||
<hr>
|
<hr>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<img class="chat-icon" src="systems/foundryvtt-reve-de-dragon/icons/competence_jeu.webp" alt="jeu" />
|
<img class="chat-icon" src="systems/foundryvtt-reve-de-dragon/icons/competence_jeu.webp" alt="jeu" />
|
||||||
<h4>
|
<h4>
|
||||||
{{alias}} joue à : {{jeu.name}}
|
{{alias}} joue à : {{oeuvre.name}}
|
||||||
</h4>
|
</h4>
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-infojet.html"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-infojet.html"}}
|
||||||
<hr>
|
<hr>
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
<img class="chat-icon" src="systems/foundryvtt-reve-de-dragon/icons/competence_musique.webp" alt="musique" />
|
<img class="chat-icon" src="systems/foundryvtt-reve-de-dragon/icons/competence_musique.webp" alt="musique" />
|
||||||
<h4>
|
<h4>
|
||||||
{{alias}} tente de chanter la chanson : {{musique.name}} (niveau {{musique.data.niveau}})
|
{{alias}} tente de jouer le morceau : {{oeuvre.name}} (niveau {{oeuvre.data.niveau}})
|
||||||
</h4>
|
</h4>
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-infojet.html"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-infojet.html"}}
|
||||||
<hr>
|
<hr>
|
||||||
<div>
|
<div>
|
||||||
{{#if rolled.isSuccess}}
|
{{#if rolled.isSuccess}}
|
||||||
{{alias}} réussi son interprétation avec une qualité de {{qualiteFinale}} .
|
{{alias}} réussit son interprétation avec une qualité de {{qualiteFinale}} .
|
||||||
{{else}}
|
{{else}}
|
||||||
{{alias}} est peu inspiré(e) et son interprétation a une qualité de {{qualiteFinale}}.
|
{{alias}} est peu inspiré(e) et son interprétation a une qualité de {{qualiteFinale}}.
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
Loading…
Reference in New Issue
Block a user