#52 Gestion astrologie
This commit is contained in:
parent
5aba029da9
commit
59a54b8a90
@ -1259,9 +1259,8 @@ export class RdDActor extends Actor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async _appliquerAjoutExperience(rollData) {
|
async _appliquerAjoutExperience(rollData) {
|
||||||
// TODO: si pas de compétence, minimum 1 pour carac
|
this.appliquerExperience( rollData.rolled, rollData.selectedCarac.label, (rollData.competence) ? rollData.competence.data.name: undefined );
|
||||||
// TODO: appliquer l'expérience automatiquement
|
|
||||||
let xpmsg = RdDResolutionTable.buildXpMessage(rollData.rolled, rollData.finalLevel);
|
let xpmsg = RdDResolutionTable.buildXpMessage(rollData.rolled, rollData.finalLevel);
|
||||||
let message = ChatUtility.prepareChatMessage('gmroll', this.name);
|
let message = ChatUtility.prepareChatMessage('gmroll', this.name);
|
||||||
message.content = "<strong>" + rollData.selectedCarac.label + "</strong>"
|
message.content = "<strong>" + rollData.selectedCarac.label + "</strong>"
|
||||||
@ -1515,8 +1514,31 @@ export class RdDActor extends Actor {
|
|||||||
return game.system.rdd.calendrier.getAjustementAstrologique(this.data.data.heure);
|
return game.system.rdd.calendrier.getAjustementAstrologique(this.data.data.heure);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
appliquerExperience( rolled, caracName, competenceName = undefined ) {
|
||||||
|
// TODO gestion derobe/tir/lance/melee
|
||||||
|
if (caracName == 'derobee') caracName = 'agilite';
|
||||||
|
|
||||||
|
if ( rolled.isPart && rolled.finalLevel < 0) {
|
||||||
|
if ( !compentenceName) {
|
||||||
|
this.actor.data.data.carac[caracName].xp += 1;
|
||||||
|
} else {
|
||||||
|
let competence = RdDUtility.findCompetence( this.data.items, competenceName );
|
||||||
|
let xpCarac = Math.floor(Math.abs(rolled.finalLevel) / 2);
|
||||||
|
if ( xpCarac == 0 ) {
|
||||||
|
competence.data.xp += 1; // XP en priorité à la compétencence
|
||||||
|
} else
|
||||||
|
competence.data.xp += Math.ceil(Math.abs(rolled.finalLevel) / 2); // XP majoritaire en compentece (ie cas impair)
|
||||||
|
this.actor.data.data.carac[caracName].xp += xpCarac;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async ajouteNombreAstral( data ) {
|
async ajouteNombreAstral( data ) {
|
||||||
|
// Gestion expérience (si existante)
|
||||||
|
this.appliquerExperience( request.rolled, "vue", "astrologie");
|
||||||
|
|
||||||
// Ajout du nombre astral
|
// Ajout du nombre astral
|
||||||
const item = {name: "Nombre Astral", type: "nombreastral", data:
|
const item = {name: "Nombre Astral", type: "nombreastral", data:
|
||||||
{ value: data.nbAstral, istrue: data.isvalid, jourindex: Number(data.date), jourlabel: game.system.rdd.calendrier.getDateFromIndex( Number(data.date) ) } };
|
{ value: data.nbAstral, istrue: data.isvalid, jourindex: Number(data.date), jourlabel: game.system.rdd.calendrier.getDateFromIndex( Number(data.date) ) } };
|
||||||
|
@ -239,6 +239,7 @@ export class RdDCalendrier extends Application {
|
|||||||
let nbAstral = this.getNombreAstral( request.date );
|
let nbAstral = this.getNombreAstral( request.date );
|
||||||
let nbAstralFaux = nbAstral;
|
let nbAstralFaux = nbAstral;
|
||||||
request.isValid = true;
|
request.isValid = true;
|
||||||
|
request.rolled = rolled;
|
||||||
if ( !rolled .isSuccess ) {
|
if ( !rolled .isSuccess ) {
|
||||||
request.isValid = false;
|
request.isValid = false;
|
||||||
while ( nbAstralFaux == nbAstral ) {
|
while ( nbAstralFaux == nbAstral ) {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<form class="{{cssClass}}" autocomplete="off">
|
<form class="{{cssClass}}" autocomplete="off">
|
||||||
<header class="sheet-header">
|
<header class="sheet-header">
|
||||||
<div class="header-fields">
|
<div class="header-fields">
|
||||||
<h1 class="charname">Astrologie</h1>
|
<h1 class="charname">Horoscope</h1>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user